You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
[+] bytecode updated for EIP-3855 / fixed stack value missing from comments
[+] bytecode updated for EIP-3855 / fixed stack value missing from comments
[+] bytecode updated for EIP-3855 / fixed stack value missing from comments
[+] bytecode updated for EIP-3855 / fixed stack value missing from comments
Copy file name to clipboardExpand all lines: src/tutorial/the-basics/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,10 @@ The next thing we are going to create is the `MAIN macro`. This serves a single
29
29
```Huff
30
30
#define macro MAIN() = takes(0) returns(0) {
31
31
0x00 calldataload // [number1] // load first 32 bytes onto the stack - number 1
32
-
0x20 calldataload // [number2] // load second 32 bytes onto the stack - number 2
32
+
0x20 calldataload // [number2, number1] // load second 32 bytes onto the stack - number 2
33
33
add // [number1+number2] // add number 1 and 2 and put the result onto the stack
34
34
35
-
0x00 mstore // place [number1 + number2] in memory
35
+
0x00 mstore // place [number1+number2] in memory
36
36
0x20 0x00 return // return the result
37
37
}
38
38
```
@@ -45,10 +45,10 @@ Go ahead and copy the above macro into your `addTwo.huff` file. Run `huffc addTw
45
45
46
46
Congratulations you've just compiled your first contract!
47
47
48
-
The bytecode output of the compiler will echo the following into the console `600f8060093d393df36000356020350160005260206000f3`.
48
+
The bytecode output of the compiler will echo the following into the console `600c8060093d393df35f35602035015f5260205ff3`.
49
49
50
50
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.)
51
-
That leaves us with this: `6000356020350160005260206000f3`
51
+
That leaves us with this: `5f35602035015f5260205ff3`
52
52
Below, this example dissembles what you have just created!
0 commit comments