How โจI found a critical vulnerabilityโจ in @zora's ERC20Z contract via a little known Uniswap v3/v4 property
When Zora put out this article: zora.co/writings/onchaโฆ outlining their new protocol, I was intrigued and had to learn more
From a high level, the system works by
๐งตHow memory works under the hood in the EVM and how this knowledge led me to recently discover a โจcritical vulnerabilityโจ
Oh and if you're new to assembly, don't worry, it's simpler than you think
Memory Layout
Starting with the basics, Solidity reserves the following 4
if you're optimizing your smart contracts, at this point the easiest way to go about it is to just run `solstat`. one command and a detailed report is generated explaining optimizations you can make and how they work under the hood, with gas benchmarks
How I found a critical bug thanks to my low level understanding of abi encoding
Let's start with a quick quiz: What is the `result` here?
If you guessed that it would be a 64 (0x40) byte array with two 32 byte words, each with a value of 1, you'd be correct
This is because all
started cleaning up this old repo documenting common smart contract vulnerabilities
goal is to be an all-in-one resource for known vulnerabilities, with clear explanations, examples, audit findings and indexed real world exploits
contributions welcome!
github.com/kadenzipfel/smโฆ
"so your ai audit bot found a $2.4m critical vuln?"
"that's right"
"but it gets stolen a few wei at a time?"
"correct"
"and it costs more than a few wei in gas to execute?"
"yes"
"and this could have been found by a static analyzer?"
"uh huh"
my smart-contract-vulnerabilities repo is officially MIT licensed!
the goal in making this repo was to improve security for the overall ecosystem. so please, fork it, improve it, and use it how you wish so we can continue to push web3 security forward ๐
repo linked below