1/5
_Follow along with this video:_ --- ### Stepping Through the Execution Alright! This is very exciting, let's start by grabbing the compiled runtime bytecode of our contract. ``` huffc src/horseStoreV1/HorseStore.huff --bin-runtime 5f3560e01c8063cdfead2e1461001a5763e026c0171461001b575b5b ``` Entering this bytecode into the evm.codes playground we should see our contract, broken down into it's individual op codes. Make note of the two distinct `JUMPDEST` codes at the bottom of the call list. ::image{src='/formal-verification-1/24-testing-jumpdest/testing-jumpdest-1.png' style='width: 100%; height: auto;'} If we assure that the call data we're passing begins with the updateHorseNumber function selector, things should be business as usual, until reach our first `JUMPI` code. ::image{src='/formal-verification-1/24-testing-jumpdest/testing-jumpdest-2.png' style='width: 50%; height: auto;'} We can see our first `JUMPI` code pertains to one of the JUMPDEST codes at the bottom of our list of operations. Because we're passing JUMPI this location, and a 1 (which represents a matching selector), we would expect our next step to jump our execution to this location further in the code-bypassing the second check entirely. ::image{src='/formal-verification-1/24-testing-jumpdest/testing-jumpdest-3.png' style='width: 50%; height: auto;'} And that's exactly what happens! Great work! 🎉I encourage you to experiment further before moving forward, try placing different contracts into the evm.codes playground and investigating how their op codes function and interact. The more experience you have with these concepts the better!
A deep dive into the JUMP and JUMPDEST Opcode. This lesson shows you how to use the JUMP and JUMPDEST opcodes to control the flow of execution in your Solidity code, giving you more control and flexibility. You'll learn what the JUMP and JUMPDEST opcodes do and how they can be used to create more complex smart contracts. The lesson also provides practical examples that you can try out for yourself to understand how these opcodes can be used in different scenarios.
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 January 17, 2025
Solidity Developer
Assembly and Formal VerificationDuration: 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 January 17, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar