paint-brush
A Beginner's Guide to Auditing an ERC20 Contract by@uvvirus
223 reads

A Beginner's Guide to Auditing an ERC20 Contract

by yuvaraj2mDecember 15th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Things to check when auditing the ERC20 contract: When transferring tokens from one account to another, check whether the values are being updated correctly. Similarly, when transferring ETH, check whether the state changes are happening before the transfer. For example, the balance should be reduced from the sender’s account before transferring it to the receiver. This will stop attacks like reentrancy. Check all the external calls. Because external functions are the ones that can be called by anyone. If it has any bug then the attacker will drain the balance in the contract. If the contract is having multiple user roles, then check all the roles, and check whether the access controls are applied properly. Check whether the parent contracts (ERC20, Ownable) are standard contracts (e.g. written by OpenZeppelin) or are they custom-written contracts by the dev.
featured image - A Beginner's Guide to Auditing an ERC20 Contract
yuvaraj HackerNoon profile picture
yuvaraj

yuvaraj

@uvvirus

I am a security engineer who writes articles related to security, mostly web3 security.

L O A D I N G
. . . comments & more!

About Author

yuvaraj HackerNoon profile picture
yuvaraj@uvvirus
I am a security engineer who writes articles related to security, mostly web3 security.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite