Blockchain smart contracts are a new and exciting technology, As such, a significant amount of effort should be made to secure a smart contract.

After developing numerous smart contracts, I’ve decided to share my experience on common pitfalls that might have major security implications, and suggest how to avoid them.
The first part is about dealing with race conditions.

Image for post
Image for post
The Race (CC Ricki Kern)

When you call an external contract, It may:
• Take over control flow
• Make changes to your data (When you didn’t expect it!)
Handling these difficult-to-anticipate situations was part of DAO’s bugs.

1. Reentry

Calling a function repeatedly, before the first invocation…

Gal Bracha

Digital Nomad. Blockchain Dev. Developing for Positive Impact. Helping communities and individuals who wants to change the status quo and make a better world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store