Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

fix bytecode for shanghai #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/tutorial/the-basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ Congratulations you've just compiled your first contract!
The bytecode output of the compiler will echo the following into the console `600f8060093d393df36000356020350160005260206000f3`.

When you deploy this contract code it will have the runtime bytecode of the main macro we just created! In the above snippet you will find it after the first `f3` (the preceding bytecode is boiler plate constructor logic.)
That leaves us with this: `6000356020350160005260206000f3`
That leaves us with this: `5f35602035015f5260205ff3`
Below, this example dissembles what you have just created!

```
BYTECODE MNEMONIC STACK ACTION
60 00 // PUSH1 0x00 // [0x00]
5f // PUSH0 // [0x00]
35 // CALLDATALOAD // [number1] Store the first 32 bytes on the stack
60 20 // PUSH1 0x20 // [0x20, number1]
35 // CALLDATALOAD // [number2, number1] Store the second 32 bytes on the stack
01 // ADD // [number2+number1] Take two stack inputs and add the result
60 00 // PUSH1 0x00 // [0x0, (n2+n1)]
5f // PUSH0 // [0x0, (n2+n1)]
52 // MSTORE // [] Store (n2+n1) in the first 32 bytes of memory
60 20 // PUSH1 0x20 // [0x20]
60 00 // PUSH1 0x00 // [0x00, 0x20]
5f // PUSH0 // [0x00, 0x20]
f3 // RETURN // [] Return the first 32 bytes of memory
```

Expand Down