
Explore basic operations in yul-style solidity, including for loops and if statements, a prime-check function using modulus on 32-byte words, and truthiness without booleans.
Master reading and writing storage with sload and sstore, explore slot and offset, and see how packing variables into the same slot affects access and security.
Errata: The illustration at 2:37 should have the array finishing as 0x1c, 0x1d, 0x1f as it is in hex, not decimal.
Explore how memory handles data larger than 32 bytes in youll, using explicit memory addressing to return and hash data with keccak256, including scratch space and free memory pointer.
Discover calldata in ethereum smart contracts, including function selectors and ABI-encoded arguments, how arbitrary transaction data is structured and gas costs are affected.
Learn to imitate a solidity contract in fuel using yul, handling call data, function selectors, and a switch statement, calling get two or get 99, with leave and return semantics.
Explore building a 100% Yul contract with an all-in constructor, using memory slots and data markers, compiling with yield, and interfacing for testing on remix.
Deploy to Rink B and inspect etherscan verification challenges when using yul versus solidity, and prefer writing in solidity with assembly only for small, gas-efficient functions.
Illustrate an ERC-20 example showing constructor storage, function selectors, balance and total supply operations, and non-payable calls with memory and storage access and return behavior.
Explore how balanceOf loads a user's ERC20 balance by computing a storage offset from the address into a mapping, using hex 1000, and returning the balance.
Examine ERC20 approval via OpenZeppelin, detailing owner and spender allowances and transferFrom. See how storage slots, hashing, and memory choices influence gas efficiency and contract clarity.
Explore rarely used signed arithmetic in yul and assembly, including signed division, modulus, comparisons, and signed shifts, with sign extension and EVM 32-byte word handling.
If you've wondered what solidity is doing behind the scenes, this is the course to take. Perhaps you've head of assembly in Ethereum smart contracts and heard it can be efficient but dangerous. After you finish this course, you will have a ground-up understanding of what exactly happens when a smart contract receives a function call, how it encodes that data, where exactly it stores it, and how it updates the blockchain state. Even if you don't write contracts in assembly, you will have a much better understanding of solidity's design choices and previously cryptic error messages will make perfect sense.
We will learn how solidity represents various data types, and how we can come up with more efficient representations ourselves depending on the application. We will learn the assumptions solidity makes about memory layout and how to avoid violating those assumptions when we use low level instructions. We will learn what happens behind the scenes when smart contracts make function calls to each other, and how to implement that protocol by hand. And of course, we will build smart contracts from scratch in assembly.
Nobody can claim to be an expert in solidity without mastering assembly (also known as Yul). So if mastery is your goal, take this class!
Note: This class is not for beginners. You should be very comfortable with solidity before taking this course.