Infiltrating the EVM-I: Demystifying Smart Contracts & Auditing comprises of information about compilation breakdown of solidity code, the vulnerable components of blockchain ecosystem and how Smart contract auditing is crucial.
Starting all the way from a blockchain engineer’s to an auditor’s internship, half a year later grabbing a junior smart contract auditor position, here at BlockApex, I decided to set out with my current auditing skills in an open market to test the waters.
One thing happened. It came as a blow.
“Ethereum is a developer’s blockchain, built by developers, for developers.”
Mastering Ethereum: Building Smart Contracts and DApps
- Andreas Antonopoulos
As soon as I got into blockchain from the conventional software development universe of the web2, I found myself into a crosshair of what they at paradigm.xyz term as the Dark Forest. Indeed, exploring the details of EVM and Solidity as a programming language introduced me to sensitive traits and precise characteristics of the blockchain which I would like to call a pure child of Computer Science.
All the while, it was a constant effort to try and connect the dots with DeFi after learning through different concepts. It still amazes me what many things one can learn and achieve within this fast and growing world of web3 and that too in such a short period of six months.
Smart Contract Auditing and Security Review is an uncharted territory where a great landscape needs discovery. But switching into audit even from an expert developer background does not guarantee a potentially successful security researcher’s career. Auditing requires a solid approach to security mindset and for an individual’s Sherlock skills to outperform each time. I confess that even time after time I went through the cycle of audits for various DeFi projects, I would find myself restricted in terms of a comprehensive story building and a proper reconnaissance phasing by looking at the smart contract codes or the documentations.
Whereas, I’d often find my mentor make up stories for some protocol we were auditing in pairs and come to some exploitable hack not just by following the coding/ logical errors but supplying it with a dense knowledge of DeFi and hence, pertaining to the scenario at hand.
I bear witness to the magic of composable knowledge that auditing demands. It is a constant association and context-switching where one combines the knowledge of economics, finance, blockchain technology and the rational thinking of actors.
Intrinsically, smart contracts being a software program inspire one to get their hands dirty with the building blocks of this ecosystem through a technical roadmap. The fundamentals are composed of getting a deeper understanding of the EVM (Ethereum Virtual Machine) and the working of a public blockchain at lower scientific levels.
Securing this piece of software from most kinds of privacy exploits and monetary attacks starts as a fun ride where you grab the Solidity concepts through courses, blogs, youtube channels and the best one; Documentations. Developing the sophistication of security recommendations and the common vulnerabilities is another great journey where the story building develops through making small exploits here and there, reading upon some famous relevant tweets/ hack analyses, and popular researcher’s works to catch up.
I find auditing as a smooth switch from a development background. One can start right away by solving and attempting challenges/CTFs or the best option in my opinion is Secureum. Secureum encourages such an approach and provides a complete glossary of security based learning and guide to different paths of smart contract audit. Another golden egg is an audit report, loads of insight, information and knowledge captured in just 10-20 pages of publication where a diverse audience is expected.
I was set up to meet a really cool person for the auditor’s position interview at one of the top-tier firms in smart contract security who was a web3 security researcher and had a cyber security background. After talking for around more than 1 and a half hours, it was really exciting for me to get to experience the different concepts through a proper auditor’s lens and how things were supposed to be seen in perspective.
The first question which any auditing interview concerns is mostly regarding what is your preferred audit process? Answers could be subjective, but I like to follow the industry standard as in this ‘Solcurity Standard’ article by Rari-Capital along with the Consensys’ best practices set of guidelines which pave a path for a thorough audit process.
Summary of my personal process which is kind of mixed up with the one that my senior auditor exercises (and I learned it from him) would be as follows;
Moving up with some generalized questions such as;
A further session was switched into more code focused and best practices formatting where we wandered off towards some factual questions e.g.;
When you attempt a Capture-The-Flag CTF challenge, the goal is to extract sheer ingenuity of an exploit. This way you get an exposure to the unimaginable attack vectors observed in the solution of the challenge.
Consider the example of a challenge named King Of Ether. Although winning this challenge by becoming the king is a feat, what if you are asked to stay as the king of that contract, persistently? Answer which I learnt that day was something like this; create a fallback in your version of contract that reverts the tx required to become the next king whenever it receives funds to be redeemed for your contract. These ingenious solutions open up a world of possibilities and perspectives for an auditor to let their mind go berserk.
(forever incomplete) List of Solidity CTFs:
Honestly speaking, I don't know the answer to this yet.
When I read about a hack in a researcher’s tweet, some news reporting handle or any article, I deep dive into the technical perspectives of the motivation behind the devs code writing. My question raised is how as an auditor (had this attack not happened then) would I get to it, prove/verify the severity and report the issue/bug? This cycle keeps on repeating and takes me from one audit report to another, introducing the minor details of how auditors actually come to the understanding of hacks and how in the first place report them as vulnerability within the code.
This, to me, is like a superpower and leaves me in awe of the beauty of story building, slowly and gradually making up my mind to think and construct in the same patterns and ways to exploit the code during the audit.
If you (a web2 developer) think you have a good imagination and can quickly understand what is going on in the mind of the person across from you, either be a dev or a fellow auditor, then search for Secureum now and start learning auditing. You will be amazed at how easily the resources are available and the number of opportunities present to you on the way. After that, it's just code4rena and you (You’re welcome ;-)).
Infiltrating the EVM-I: Demystifying Smart Contracts & Auditing comprises of information about compilation breakdown of solidity code, the vulnerable components of blockchain ecosystem and how Smart contract auditing is crucial.
It is crucial to come up with innovative solutions against cyberattacks, especially when your workforce is remotely working. Since we know that remote work comes with a bunch of security risks, it is essential to cater to them.
Play-to-earn or P2E for short, typically refers to a business model where players can earn real-world or in-game currency by playing games, completing tasks, and performing different activities. This in-game currency is usually the project’s native cryptocurrency and is used to reward users.
Borderless Money is a decentralized finance protocol redefining how Social Investments are made, using yield-generating strategies and contributing to social causes. An open, borderless digital society, with borderless money, where the goods, services, technology, information, opportunities, and capital can flow through the borders from one hand to many, fairly, transparently.
BlockApex (Auditor) was contracted by PhoenixDAO (Client) for the purpose of conducting a Smart Contract Audit/Code Review. This document presents the findings of our analysis which took place on 28th October 2021.
Web 3.0 is a semantic web where it promises to establish information in a better-existing way than any current search engine can ever attain. Web 3.0 promotes four concepts which mainly are authenticity, i.e, every piece of information existing on the internet is a fact or derived from a fact. Integrity, willingness to abide by moral principles, and ethical values. Transparency, the data present on the internet is accessible for every user to witness. Lastly, Confidentiality which is achieved by Blockchain technology, where every user’s identity is anonymous, making it secure.
Yamato Protocol is a crypto-secured stablecoin generator DApp pegged to JPY. Yamato Protocol is a lending decentralized financial application (DeFi) that can generate Japanese Yen stablecoin "CJPY". It is being developed by DeFiGeek Community Japan, a decentralized autonomous organization.
In our first iteration, we found 1 critical-risk issue, 4 high-risk issues, 1 medium-risk, 1 low-risk issue and 1 informatory issue. All these issues were refactored and fixes have been made. A detailed report on the first review can be found here.
Rain Protocol lets you build web3 economies at any scale.Rain scripts are a combination of low level functions (opcodes) like addition and subtraction and very high level functions like fetching an ERC20 balance at a given snapshot ID (Open Zeppelin), or fetching a chainlink oracle price.