We’re going to learn how to attack smart contracts with other smart contracts, because this is the active practice of complementary opposites. By understanding the different vulnerabilities which have been exploited over time, we can learn both how “smart” contracts actually work, as well as how to employ better patterns of thinking which will improve our craft.
By becoming conscious of our limitations and weakness, we are made stronger and more resilient. By looking into the shadows, we become certain that there is light.Preparation¶
- Ensure that you still have some Goerli ETH left in your account. Use the faucet if you need to top up.
- If you feel highly motivated, familiarise yourself with Integrated Development Environments (IDEs) and Remix.
- Sit and breathe quietly for at least 10 minutes.
We’re going to take on the next 2 Ethernaut challenges in this lesson: CoinFlip and Telephone. This requires writing our own contracts and learning how to compile and deploy them, for which we will use the IDE provided by the Ethereum Foundation, called Remix.
- What is an IDE and what purpose does it serve in this life?
- How can I read and understand what is going on in a smart contract?
- What are global variables, and how global is global?
- From where do my transactions truly originate?
- What does it mean to compile a contract? What is an ABI and what is bytecode?
- Hang on, you mean all these contracts can actually speak to one another?
In this session, you will have learned:
- How to read Solidity in more detail, along with some of the nuances it has.
- How to deploy your own contracts directly from the browser.
- How to programme contracts to interact with other contracts.
- How difficult it is to programme randomness, and how a single, shared, global computing surface makes this even more challenging.
- Why everyone having access to the same information at the same time is both very cool, but also a very challenging context in which to programme.
- How even very simple code can have unintended consequences if you aren’t careful and considerate about how you approach your craft.