-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TODO fix test opcode GAS * Adds tests PUSH opcodes * Adds test DUP opcodes * Adds tests SWAP opcodes * Ignore .DS_Store * Adds tests CALL opcode * Adds tests CALLCODE opcode * Adds tests DELEGATECALL opcode
- Loading branch information
Showing
75 changed files
with
1,662 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,7 @@ flattened.txt | |
# Ignore Broadcasts | ||
broadcast | ||
|
||
private | ||
private | ||
|
||
# macOS | ||
.DS_Store |
Large diffs are not rendered by default.
Oops, something went wrong.
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,23 @@ | ||
# See callContract for more info on this call | ||
|
||
# Set in memory a dummy parameter | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
MSTORE | ||
|
||
# Call to callContract with dummy parameter | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x20 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
CALL | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,18 @@ | ||
# See callContract for more info on this call | ||
|
||
# Call to callContract with no paramter | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
CALL | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,23 @@ | ||
# See callcodeContract for more info on this call | ||
|
||
# Set first slot in the current contract | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
SSTORE | ||
|
||
# Callcode to callcodeContract contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
CALLCODE | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,23 @@ | ||
# See callcodeContract for more info on this call | ||
|
||
# Reset first slot in current contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
SSTORE | ||
|
||
# Callcode to callcodeContract contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
CALLCODE | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,12 @@ | ||
# creates an exception if first word of calldata is 0 | ||
# Source: https://www.evm.codes/ playground for CALL | ||
# 0x67600035600757FE5B60005260086018F3 | ||
# you can decompile it with pyevmasm to get | ||
# mnemonic creation code and logic (below) | ||
|
||
PUSH1 0x0 | ||
CALLDATALOAD | ||
PUSH1 0x7 | ||
JUMPI | ||
INVALID | ||
JUMPDEST |
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,12 @@ | ||
# creates an exception if first slot of storage is 0 | ||
# Source: https://www.evm.codes/ playground for CALLCODE | ||
# 0x67600054600757FE5B60005260086018F3 | ||
# you can decompile it with pyevmasm to get | ||
# mnemonic creation code and logic (below) | ||
|
||
PUSH1 0x0 | ||
SLOAD | ||
PUSH1 0x7 | ||
JUMPI | ||
INVALID | ||
JUMPDEST |
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,23 @@ | ||
# See callcodeContract for more info on this call | ||
|
||
# Set first slot in the current contract | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
SSTORE | ||
|
||
# Callcode contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
DELEGATECALL | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,23 @@ | ||
# See callcodeContract for more info on this call | ||
|
||
# Reset first slot in current contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
SSTORE | ||
|
||
# Delegatecall to callcodeContract contract | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH1 0x0 | ||
PUSH20 0x1231231231231231231231231231231231231231 | ||
PUSH2 0xFFFF | ||
DELEGATECALL | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,11 @@ | ||
PUSH1 0x1 | ||
DUP1 | ||
|
||
# Store the 2 stack instructions and return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0x20 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,19 @@ | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP10 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,20 @@ | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP11 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,21 @@ | ||
PUSH1 0xb | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP12 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,22 @@ | ||
PUSH1 0xc | ||
PUSH1 0xb | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP13 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,23 @@ | ||
PUSH1 0xd | ||
PUSH1 0xc | ||
PUSH1 0xb | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP14 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,24 @@ | ||
PUSH1 0xe | ||
PUSH1 0xd | ||
PUSH1 0xc | ||
PUSH1 0xb | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP15 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,25 @@ | ||
PUSH1 0xf | ||
PUSH1 0xe | ||
PUSH1 0xd | ||
PUSH1 0xc | ||
PUSH1 0xb | ||
PUSH1 0xa | ||
PUSH1 0x9 | ||
PUSH1 0x8 | ||
PUSH1 0x7 | ||
PUSH1 0x6 | ||
PUSH1 0x5 | ||
PUSH1 0x4 | ||
PUSH1 0x3 | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP16 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,11 @@ | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP2 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
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,12 @@ | ||
PUSH1 0x2 | ||
PUSH1 0x1 | ||
PUSH1 0x0 | ||
|
||
DUP3 | ||
|
||
# return result | ||
PUSH1 0x0 | ||
MSTORE | ||
PUSH1 0xff | ||
PUSH1 0x00 | ||
RETURN |
Oops, something went wrong.