Skip to content

Commit

Permalink
Merge pull request #19 from gitglorythegreat/revert
Browse files Browse the repository at this point in the history
revert pull request #17
  • Loading branch information
AmazingAng authored Jun 25, 2024
2 parents f8d7c51 + 5df33d3 commit 23bef5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 03_StackOp/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EVM是基于堆栈的,堆栈遵循 LIFO(后入先出)原则,最后一个

`PUSH1`为例,它的操作码为`0x60`,它会将字节码中的下一个字节压入堆栈。例如,字节码`0x6001`就表示把`0x01`压入堆栈。`PUSH2`就是将字节码中的下两个字节压入堆栈,例如,`0x610101`就是把`0x0101`压入堆栈。其他的PUSH指令类似。

以太坊上还升级新加入了`PUSH0`,操作码为`0x5F`(即`0x60`的前一位),用于将`0`压入堆栈,gas消耗为2,比其他的PUSH指令更省gas。
以太坊上海升级新加入了`PUSH0`,操作码为`0x5F`(即`0x60`的前一位),用于将`0`压入堆栈,gas消耗为2,比其他的PUSH指令更省gas。

下面我们用python实现`PUSH0``PUSH32`,主要逻辑见`push()``run()`函数:

Expand Down

0 comments on commit 23bef5c

Please sign in to comment.