-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2068 from rsksmart/add-push0-instruction
Implement EIP-3855: PUSH0 instruction
- Loading branch information
Showing
11 changed files
with
229 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
comment | ||
|
||
// Contracts compiled using 0.8.20 (txCreateNew) and 0.8.17 (txCreateOld) | ||
// the contract source code | ||
|
||
contract PushZero { | ||
function add(uint256 a, uint256 b) external returns (uint256) { | ||
unchecked { | ||
return a + b; | ||
} | ||
} | ||
} | ||
|
||
end | ||
|
||
account_new acc1 10000000 | ||
|
||
# deploy contract compiled with 0.8.20 (generates PUSH0) | ||
transaction_build txCreateNew | ||
sender acc1 | ||
receiverAddress 00 | ||
value 0 | ||
data 608060405234801561000f575f80fd5b506101238061001d5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c8063771602f714602a575b5f80fd5b60406004803603810190603c91906092565b6054565b604051604b919060d6565b60405180910390f35b5f818301905092915050565b5f80fd5b5f819050919050565b6074816064565b8114607d575f80fd5b50565b5f81359050608c81606d565b92915050565b5f806040838503121560a55760a46060565b5b5f60b0858286016080565b925050602060bf858286016080565b9150509250929050565b60d0816064565b82525050565b5f60208201905060e75f83018460c9565b9291505056fea264697066735822122045ed7bb05dd9f1947b2804a8d76b6b7336f31495e814ca7c00a1c4bf60828d8364736f6c63430008140033 | ||
gas 1200000 | ||
build | ||
|
||
block_build b01 | ||
parent g00 | ||
transactions txCreateNew | ||
build | ||
|
||
block_connect b01 | ||
|
||
# Assert best block | ||
assert_best b01 | ||
|
||
# call add(0,3) | ||
transaction_build txCallNew | ||
sender acc1 | ||
nonce 1 | ||
contract txCreateNew # created in txCreateNew | ||
value 0 | ||
data 771602f700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 | ||
gas 30000 | ||
build | ||
|
||
block_build b02 | ||
parent b01 | ||
transactions txCallNew | ||
gasLimit 6500000 | ||
build | ||
|
||
block_connect b02 | ||
|
||
# Assert best block | ||
assert_best b02 | ||
|
||
# deploy contract compiled with 0.8.17 (does not generate PUSH0) | ||
transaction_build txCreateOld | ||
sender acc1 | ||
receiverAddress 00 | ||
nonce 2 | ||
value 0 | ||
data 608060405234801561001057600080fd5b5061012f806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063771602f714602d575b600080fd5b60436004803603810190603f9190609a565b6057565b604051604e919060e0565b60405180910390f35b6000818301905092915050565b600080fd5b6000819050919050565b607a816069565b8114608457600080fd5b50565b6000813590506094816073565b92915050565b6000806040838503121560ae5760ad6064565b5b600060ba858286016087565b925050602060c9858286016087565b9150509250929050565b60da816069565b82525050565b600060208201905060f3600083018460d3565b9291505056fea2646970667358221220b386c5fbaa1f4fa300a7ba86a498ed9bdf2b01bffc7263abc34cc285d973482264736f6c63430008110033 | ||
gas 1200000 | ||
build | ||
|
||
block_build b03 | ||
parent b02 | ||
transactions txCreateOld | ||
gasLimit 6500000 | ||
build | ||
|
||
block_connect b03 | ||
|
||
# Assert best block | ||
assert_best b03 | ||
|
||
# call add(0,3) | ||
transaction_build txCallOld | ||
sender acc1 | ||
nonce 3 | ||
contract txCreateOld # created in txCreateOld | ||
value 0 | ||
data 771602f700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 | ||
gas 30000 | ||
build | ||
|
||
block_build b04 | ||
parent b03 | ||
transactions txCallOld | ||
gasLimit 6500000 | ||
build | ||
|
||
block_connect b04 | ||
|
||
# Assert best block | ||
assert_best b04 |