1/5
_Follow along with this video:_ --- ### Routing The Call We've done it! We have the function selector on our stack. Now we want to route the `call data` to the correct function. In Solidity, this is handled for us, but when we're programming in byte code we need to explicitly tell the EVM what's being done. Alright, now that we have the function selector, we're going to proceed by doing a couple of comparisons and `jump` to the data associated with the selector. In `HorseStore.sol` we've got two functions `updateHorseNumber()` and `readNumberOfHorses()`. Simple put, we're going to say: If f_select == updateHorseNumber -> jump to that data in the contract If f_select == readNumberOfHorses -> jump to that data in the contract Let's see how that looks in practice in the next lessons.
A comprehensive guide to understanding how Solidity functions are routed using function selectors and EVM Bytecode - This lesson demonstrates how Solidity functions are routed to the correct bytecode based on the function selector, and it shows how this routing process can be accomplished when developing bytecode in the Huff language.
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