DEV Community

wslyvh
wslyvh

Posted on • Originally published at wslyvh.com on

Clean Contracts - a guide on smart contract patterns & practices

Blockchain and smart contract development are still relatively new and highly experimental. They require a different engineering mindset than traditional web, or app development where ‘move fast and break things’ has become the norm.

Blockchain development is much more like hardware, or financial service development. Smart contracts are complex instruments that offer the possibility to have self-enforcing contracts including transparent, tamper-proof, and immutable information. They have the authority to allocate high-value resources between complex systems. Often working autonomously. With huge financial loss at risk. This makes smart contracts critical components in these systems. Development of such components requires more investment, design, and effort upfront. Solid engineering practices, rigorous testing, and a strong security mindset.

WTFs per minute

In a series of blog posts, I’m planning to go through several patterns, practices, and principles that can be applied to blockchain and smart contract development to reduce the risks associated with it.

In this first article, I’ll cover more general engineering practices based on the concepts of Clean Code.

  1. Naming
  2. Structure & Ordering
  3. Documentation & Natspec
  4. Formatting
  5. Contracts & Data structures
  6. Systems
  7. Standards & Libraries
  8. Error handling
  9. Testing
  10. Security & code analysis
  11. Continuous Integration

Full blog post at wslyvh.com

Latest comments (0)