Smart Contract Audits - Understanding system context

Smart Contract Audits - Understanding system context

steps to assemble knowledge base

As anyone starts their journey as Smart Contract Auditor, their first goal would be to gain in-depth knowledge of the Blockchain technology for the projects they are going to perform the audit. Many times having experience developing DAPPS will come in handy. But, considering blockchain is still in its infancy, as long as someone has good developer experience will shorten the learning curve.

EVM and Solidity

As a first step, get a good grasp on EVM and Solidity for EVM-based blockchains.

After getting a foothold in solidity, you should be able to read the code in smart contracts like other programming languages. But, you will soon realize the gap related to understanding

a) Different contexts, especially msg context as program flow interacts with different smart contracts.

b) code that sounds like a done deal is not done until the transaction makes it to a block in the longest blockchain

c) Miners' role and how paying higher gas could flip the behaviour and outcome that could be very different

Common Vulnerabilities

Reading smart contract code with EVM and blockchain architecture is very important. Code by itself looks solid and unbreakable but is vulnerable because of how it is executed in the blockchain.

This led me to learn about hacks from the past, common vulnerabilities and best practices to prevent them.

Defi concepts

With this foundation, when you try auditing projects on open audit platforms, you will notice a new gap in knowledge, which is understanding Defi. Defi might sound natural to understand with some finance and trading background, but that is only at the surface.

As you dwell into the logic of smart contracts, gaps will start to grow wider and once again, you need to spend time understanding the common concepts of Defi

a) Borrowing and lending

b) Liquidity pool

c) Staking and reward systems

d) Stablecoins

This lap exposes how smart minds have normalized computations using mathematical models and takes some effort to understand.

As you thought, you were ready, the ability to validate what you are reading and assuming from the code about the system will show where you need to go.

Foundry/Other testing tool

I say foundry because you can test in solidity for EVM projects. It is a sweet setup to start up quickly.

and then comes the most important question...

Visualizing Past Hacks in the Context of Audit

What are the vulnerabilities possible a good starting point would be to look at all the hacks from the past and review those possibilities with the project you are auditing.

If you can start forming these attack vectors while understanding the system from the code, you are at a good starting point to move forward. You have the skills and tools to help secure the projects. You can start rolling.

Learning should never stop and with Auditing as a career path, start learning something new each day.

A wealth of information at AuditOne

AuditOne has a repository of information that helped me through the journey.

Please refer to the below link.

https://auditone.notion.site/auditone/bb52d390910e4454baf56e0c8f32b13d?v=dfb1efd40e1548fd8ffa763d64bf5161

To learn more about AuditOne, visit their website.

https://www.auditone.io/

They also conduct quizzes and CTF challenges which help in verifying the progress, and also a great place to meet like-minded people. Join their discord channel to explore more.