SlideShare a Scribd company logo
Smart Contracts From The Trenches:
The Interface App Journey
Nik KALYANI
Co-founder/CTO
@techbubble
interface.whenhub.com
Smart Contracts from the Trenches – The Interface App Journey
for your
Smart Contracts
1. Don’t reinvent
Use vetted libraries such as OpenZeppelin
2. Minimize on-chain storage
Store only what’s really needed on the
blockchain. Hashes are your friend.
3. Build-in configurability
Things change. Plan ahead and make key
control variables settings. Don’t forget to
add a maintenance mode setting.
4. Architect for flexibility
Separate data and application logic into
separate contracts. You can upgrade app
contracts with no adverse impact.
5. Create access controls
Don’t hard code permissions. Use white lists in
which you can register/deregister authorized
callers.
6. Use SafeMath
Don’t gamble with large number arithmetic. Use
the SafeMath library.
7. Fail early (a.k.a. reduce gas cost)
Use require(…) at start of function for
prerequisites and minimize cost.
8. Fire meaningful events
Strategically fired events with indexed
parameters can benefit from ultra-cheap log
storage and increase flexibility for calling
applications.
9. Don’t use loops
Block gas limits make loops dangerous as
longer loops may never finish. Have the calling
app handle the iteration.
10. Customize ERC20
Use shadow variables to finesse ERC20
interface functions. Example: transfer() can block
based on shadow escrow variable.
Smart Contracts from the Trenches – The Interface App Journey

More Related Content

PPTX
Mininet Research Projects Help
PDF
Elastic APM: Amping up your logs and metrics for the full picture
PPTX
Smart Contract Testing
PDF
Handson Smart Contract Development With Solidity And Ethereum From Fundamenta...
PDF
Ethereum Smart Contracts 101 with Cryptizens.io
PPTX
Blockchain in enterprise - Challenges, Considerations and Designs
PDF
Blockchain-based Applications
PDF
Hyperledger Fabric Application Development 20190618
Mininet Research Projects Help
Elastic APM: Amping up your logs and metrics for the full picture
Smart Contract Testing
Handson Smart Contract Development With Solidity And Ethereum From Fundamenta...
Ethereum Smart Contracts 101 with Cryptizens.io
Blockchain in enterprise - Challenges, Considerations and Designs
Blockchain-based Applications
Hyperledger Fabric Application Development 20190618

Similar to Smart Contracts from the Trenches – The Interface App Journey (20)

PPTX
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
PDF
Token platform based on sidechain
PPTX
Abstract Factory pattern application on multi-contract on-chain deployments
PDF
Devcon 1 - Build a Ðapp: Contract and Design
PDF
“Create your own cryptocurrency in an hour” - Sandip Pandey
PPTX
Advanced smart contract
PDF
Blockchain In Action 1st Edition Bina Ramamurthy
PPTX
Creating Smart Contract
PDF
Step-by-Step Guide to Blockchain App Creation
PPTX
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
PDF
Company presentation
DOCX
BlockChain Online Training
DOCX
BlockChain Online Course
PPTX
Demystifying Smart Contracts
PPTX
Ton blockchain development complete guide.pptx
PDF
Molly Suda - Smart contracts for smart people and Applications in the U.S ene...
PPTX
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
PPTX
Key Questions to Ask Before Investing in Blockchain App Development.pptx
PPTX
SmartQuora - Learn to build a Smart Contract application on Hyperledger Block...
PDF
Blockchain Hyperledger Fabric
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
Token platform based on sidechain
Abstract Factory pattern application on multi-contract on-chain deployments
Devcon 1 - Build a Ðapp: Contract and Design
“Create your own cryptocurrency in an hour” - Sandip Pandey
Advanced smart contract
Blockchain In Action 1st Edition Bina Ramamurthy
Creating Smart Contract
Step-by-Step Guide to Blockchain App Creation
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
Company presentation
BlockChain Online Training
BlockChain Online Course
Demystifying Smart Contracts
Ton blockchain development complete guide.pptx
Molly Suda - Smart contracts for smart people and Applications in the U.S ene...
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Key Questions to Ask Before Investing in Blockchain App Development.pptx
SmartQuora - Learn to build a Smart Contract application on Hyperledger Block...
Blockchain Hyperledger Fabric
Ad

More from Nik Kalyani (6)

PPT
Advanced Skinning With DotNetNuke
PPT
Advanced Skinning with DotNetNuke 5
PPTX
DotNetNuke SEO
PPT
Using And Extending The DotNetNuke Widget Framework
PPTX
Hands On Windows Azure Building A Twitter Clone
PPTX
A Short Story
Advanced Skinning With DotNetNuke
Advanced Skinning with DotNetNuke 5
DotNetNuke SEO
Using And Extending The DotNetNuke Widget Framework
Hands On Windows Azure Building A Twitter Clone
A Short Story
Ad

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
A Presentation on Artificial Intelligence
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
A comparative analysis of optical character recognition models for extracting...
1 - Historical Antecedents, Social Consideration.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Programs and apps: productivity, graphics, security and other tools
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
A novel scalable deep ensemble learning framework for big data classification...
A Presentation on Artificial Intelligence
Chapter 5: Probability Theory and Statistics
Building Integrated photovoltaic BIPV_UPV.pdf
OMC Textile Division Presentation 2021.pptx
A comparative study of natural language inference in Swahili using monolingua...
Assigned Numbers - 2025 - Bluetooth® Document
Heart disease approach using modified random forest and particle swarm optimi...
Enhancing emotion recognition model for a student engagement use case through...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cloud_computing_Infrastucture_as_cloud_p
Univ-Connecticut-ChatGPT-Presentaion.pdf
Hybrid model detection and classification of lung cancer
WOOl fibre morphology and structure.pdf for textiles
SOPHOS-XG Firewall Administrator PPT.pptx

Smart Contracts from the Trenches – The Interface App Journey

  • 1. Smart Contracts From The Trenches: The Interface App Journey Nik KALYANI Co-founder/CTO @techbubble
  • 5. 1. Don’t reinvent Use vetted libraries such as OpenZeppelin
  • 6. 2. Minimize on-chain storage Store only what’s really needed on the blockchain. Hashes are your friend.
  • 7. 3. Build-in configurability Things change. Plan ahead and make key control variables settings. Don’t forget to add a maintenance mode setting.
  • 8. 4. Architect for flexibility Separate data and application logic into separate contracts. You can upgrade app contracts with no adverse impact.
  • 9. 5. Create access controls Don’t hard code permissions. Use white lists in which you can register/deregister authorized callers.
  • 10. 6. Use SafeMath Don’t gamble with large number arithmetic. Use the SafeMath library.
  • 11. 7. Fail early (a.k.a. reduce gas cost) Use require(…) at start of function for prerequisites and minimize cost.
  • 12. 8. Fire meaningful events Strategically fired events with indexed parameters can benefit from ultra-cheap log storage and increase flexibility for calling applications.
  • 13. 9. Don’t use loops Block gas limits make loops dangerous as longer loops may never finish. Have the calling app handle the iteration.
  • 14. 10. Customize ERC20 Use shadow variables to finesse ERC20 interface functions. Example: transfer() can block based on shadow escrow variable.