5/5
_Follow along with this video:_ --- ### Do You Understand How Cool This Is You now have the power to write READABLE Solidity code, and then rewrite it in Assembly/Huff to be SUPER gas optimized. Furthermore, you now possess the ability to FORMALLY VERIFY that the gas optimized code functions identically to the Solidity code. This is HUGE. I can't stress this enough. We've mathematically proven that _any_ function called on these two contracts will behave the same. Now, this admittedly comes with a couple caveats, we are making some assumptions about our `safeTransferFrom` and `onERC721Received` functions. In other situations, these may not be safe assumptions you want to make - these sorts of functions will literally be where you'll find vulnerabilities like reentrancy. ```js function _.onERC721Received(address, address, uint256, bytes) external => DISPATCHER(true); function _.safeTransferFrom(address,address,uint256) external => DISPATCHER(true); ``` That said, this new super power should be incredibly valuable in our journey moving forwards. Let's recap everything we've covered in the next lesson!
We take a moment to appreciate the power and potential of tools like formal verification in securing web3.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on May 28, 2025
Duration: 30min
Duration: 4h 38min
Duration: 3h 57min
Duration: 1h 56min
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on May 28, 2025