EVM Deep Dives: The Path to Shadowy Super Coder 🥷 💻 - Part 5

✅ The difference between the two functions is the changed variables of the contract.

We’re going to cover how these opcodes work at the solidity level, the EVM level, and the Geth client level to give you a complete understanding.

Execution Context

When the EVM executes a smart contract, a context is created for it. The context consists of the following.

Keep these items in your mind as we proceed through the article.

Solidity Example

Untitled

DelegateCall

6 Delegatecall

16 delegatecall slot

Proxy Patterns

Upgradable UUPS

Delegate Call & Storage Layout

Remember a function in a contract maps to some static bytecode that is calculated at compile time.

If we look at Contract B setVars(uint256) specifically “num = _num” this is saying store value _num into storage slot 0.

Untitled

■ Opcodes

CALL has exactly the same input variables with one additional value.

this is because DelageCall uses the msg.value from the parent call