We’ve lifted the veil in front of our browser, kissed smart contracts from the console and even deployed our own special vows, because everything is interconnected. Now it’s time to see why not even death can part us. Is it really true that a smart contract is forever? How does its storage actually work? What does it mean to delegate access to this forever-store? Is there such a thing as a “private” variable on a public network like Ethereum?
All this and more lies in wait for us as we continue our journey into shared truth.Preparation¶
- Ensure that you still have some Goerli ETH left in your account. Use the faucet if you need to top up.
- Review Remix and the work we did there last week. We’ll only use it once, at the end of our session today, but it’s still worth being familiar with.
- Sit and breathe quietly for at least 15 minutes.
We’re going to investigate storage on Ethereum by completing two Ethernaut challenges: Delegation and Vault. This is going to take us into a much lower-level look at some of the operations of the Ethereum Virtual Machine, and the different “slots” associated with each contract. We may even try to pick apart the would from the tries. If time allows, we’ll also attack Privacy.
After using some fun new web3 methods to investigate what each contract hides, we’ll finish the session off with another contract of our own to attack the Vault like kamikazes, as well as discussing compilers and companions.Summation¶
In this session, you will have learned:
- How low-level calls work in the EVM and the weird and wonderful, though dangerous, things that they can be used to achieve.
- How information gets stored in smart contracts, and therefore in Ethereum as a whole.
- What makes the information both public and permanent.
- More about the web3 API methods and how to use them to craft specific kinds of transactions, directly from your browser.
- What compilers do and how to use different versions of them.