How to audit Smart Contract

image Source: Dzone

Mentioned below are some of the smart contract attacks:

1. Reentrancy

Solution:

2. Cross-Function Race Condition

Solution:

3. Underflow

Solution:

Here are some of the necessary checks that should be undertaken with any smart contract:

Correct visibility of functions:

Prevent overflow and underflow:

Data Storage:

Check for reenterancy and ensure state committed before the external call:

Save gas on smart contracts:

Compiler warnings

Smart Contract Audit Tools

--

--

--

Full-stack software development company for startups and enterprises using blockchain, AI, IoT, AR and cloud computing. https://www.leewayhertz.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Gamestate Partners with Dig Chain to bring the Future of Real Estate Tokenization to the Megaverse

Altura Joins the Magic!

Protocol Weekly Issue #11

How Chainlink overcomes the problem of Blockchain Oracles?

Decentralised Natives and Asset Management

Top Blockchain Platforms to watch out in 2019

Blockchain in Health Information Exchange

BandChain Phase 1: Guan Yu

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
LeewayHertz

LeewayHertz

Full-stack software development company for startups and enterprises using blockchain, AI, IoT, AR and cloud computing. https://www.leewayhertz.com

More from Medium

Polygon Fellowship — Week 2 — Learnings

What are tokens and how to deploy token smart contracts?

Creating an NFT Contract using Hardhat and Setting NFT Metadata using IPFS on Filebase

Introduction to Solidity