Skip to content

Commit

Permalink
move test sources from assertoor repository
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Aug 13, 2024
1 parent df1bb5a commit b168a0b
Show file tree
Hide file tree
Showing 24 changed files with 2,100 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test-src/all-opcodes-test/01-all_opcodes/test-0x0.evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

ADD(1337, 42)
0x00 MSTORE
0x01 32 0x00 LOG1

MUL(1337, 42)
0x00 MSTORE
0x02 32 0x00 LOG1

SUB(1337, 42)
0x00 MSTORE
0x03 32 0x00 LOG1

DIV(1337, 42)
0x00 MSTORE
0x04 32 0x00 LOG1

SDIV(1337, -42)
0x00 MSTORE
0x05 32 0x00 LOG1

MOD(1337, 42)
0x00 MSTORE
0x06 32 0x00 LOG1

SMOD(1337, -42)
0x00 MSTORE
0x07 32 0x00 LOG1

ADDMOD(1337, 42, 1024)
0x00 MSTORE
0x08 32 0x00 LOG1

MULMOD(1337, 42, 1024)
0x00 MSTORE
0x09 32 0x00 LOG1

EXP(1337, 42)
0x00 MSTORE
0x0a 32 0x00 LOG1

SIGNEXTEND(1337, 42)
0x00 MSTORE
0x0b 32 0x00 LOG1

0x00 CODESIZE
DUP1 DUP3 DUP1 CODECOPY
SWAP1 RETURN
65 changes: 65 additions & 0 deletions test-src/all-opcodes-test/01-all_opcodes/test-0x1-0x2.evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

LT(1337, 42)
0x00 MSTORE
0x10 32 0x00 LOG1

GT(1337, 42)
0x00 MSTORE
0x11 32 0x00 LOG1

SLT(1337, -42)
0x00 MSTORE
0x12 32 0x00 LOG1

SGT(1337, -42)
0x00 MSTORE
0x13 32 0x00 LOG1

EQ(1337, 42)
0x00 MSTORE
0x14 32 0x00 LOG1

ISZERO(1337)
0x00 MSTORE
0x15 32 0x00 LOG1

AND(1337, 42)
0x00 MSTORE
0x16 32 0x00 LOG1

OR(1337, 42)
0x00 MSTORE
0x17 32 0x00 LOG1

XOR(1337, 42)
0x00 MSTORE
0x18 32 0x00 LOG1

NOT(1337)
0x00 MSTORE
0x19 32 0x00 LOG1

BYTE(1337, 42)
0x00 MSTORE
0x1a 32 0x00 LOG1

SHL(1337, 42)
0x00 MSTORE
0x1b 32 0x00 LOG1

SHR(1337, 42)
0x00 MSTORE
0x1c 32 0x00 LOG1

SAR(1337, -1)
0x00 MSTORE
0x1d 32 0x00 LOG1

1337 0x00 MSTORE
32 0x00 SHA3
0x00 MSTORE
0x20 32 0x00 LOG1

0x00 CODESIZE
DUP1 DUP3 DUP1 CODECOPY
SWAP1 RETURN
74 changes: 74 additions & 0 deletions test-src/all-opcodes-test/01-all_opcodes/test-0x3.evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

ADDRESS
0x00 MSTORE
0x30 32 0x00 LOG1

BALANCE(ADDRESS())
0x00 MSTORE
0x31 32 0x00 LOG1

ORIGIN
0x00 MSTORE
0x32 32 0x00 LOG1

CALLER
0x00 MSTORE
0x33 32 0x00 LOG1

CALLVALUE
0x00 MSTORE
0x34 32 0x00 LOG1

0x00 CALLDATALOAD
0x00 MSTORE
0x35 32 0x00 LOG1

CALLDATASIZE
0x00 MSTORE
0x36 32 0x00 LOG1

CALLDATACOPY(1, 2, 20)
0x37 32 0x00 LOG1

CODESIZE
0x00 MSTORE
0x38 32 0x00 LOG1

CODECOPY(1, 2, 20)
0x39 32 0x00 LOG1

GASPRICE
0x00 MSTORE
0x3a 32 0x00 LOG1

EXTCODESIZE(ADDRESS())
0x00 MSTORE
0x3b 32 0x00 LOG1

EXTCODECOPY(ADDRESS(), 1, 2, 20)
0x3c 32 0x00 LOG1

SHL(184, 0x6000388082803990f3)
0x00 MSTORE
9 0x00 0x00 CREATE
DUP1 DUP1
0x00 MSTORE
0xf0 32 0x00 LOG1

0x1000000000000000 0x00 MSTORE
32 PUSH0 PUSH0 PUSH0 PUSH0 DUP6 1000 CALL

RETURNDATASIZE
0x00 MSTORE
0x3d 32 0x00 LOG1

RETURNDATASIZE 0x00 0x00 RETURNDATACOPY
0x3e 32 0x00 LOG1

EXTCODEHASH
0x00 MSTORE
0x3f 32 0x00 LOG1

0x00 CODESIZE
DUP1 DUP3 DUP1 CODECOPY
SWAP1 RETURN
40 changes: 40 additions & 0 deletions test-src/all-opcodes-test/01-all_opcodes/test-0x4.evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

BLOCKHASH(SUB(NUMBER(), 1))
0x00 MSTORE
0x40 32 0x00 LOG1

COINBASE()
0x00 MSTORE
0x41 32 0x00 LOG1

TIMESTAMP()
0x00 MSTORE
0x42 32 0x00 LOG1

NUMBER()
0x00 MSTORE
0x43 32 0x00 LOG1

DIFFICULTY()
0x00 MSTORE
0x44 32 0x00 LOG1

GASLIMIT()
0x00 MSTORE
0x45 32 0x00 LOG1

CHAINID()
0x00 MSTORE
0x46 32 0x00 LOG1

SELFBALANCE()
0x00 MSTORE
0x47 32 0x00 LOG1

BASEFEE()
0x00 MSTORE
0x48 32 0x00 LOG1

0x00 CODESIZE
DUP1 DUP3 DUP1 CODECOPY
SWAP1 RETURN
50 changes: 50 additions & 0 deletions test-src/all-opcodes-test/01-all_opcodes/test-0x5.evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

1337
1
POP
0x00 MSTORE
0x50 32 0x00 LOG1

MLOAD(1)
0x00 MSTORE
0x51 32 0x00 LOG1

1337 0x00 MSTORE
0x52 32 0x00 LOG1

1337 0x00 MSTORE8
0x53 32 0x00 LOG1

SSTORE(1, 1337)
0x55 32 0x00 LOG1

SLOAD(1)
0x00 MSTORE
0x54 32 0x00 LOG1

0x42424242424242 0x00 MSTORE
JUMP(ADD(PC(), 15))
0x1000000000000000 0x00 MSTORE
JUMPDEST
0x56 32 0x00 LOG1

JUMPI(ADD(PC(), 15), GT(1337, 42))
0x1000000000000000 0x00 MSTORE
JUMPDEST
0x57 32 0x00 LOG1

PC()
0x00 MSTORE
0x58 32 0x00 LOG1

MSIZE()
0x00 MSTORE
0x59 32 0x00 LOG1

GAS()
0x00 MSTORE
0x5a 32 0x00 LOG1

0x00 CODESIZE
DUP1 DUP3 DUP1 CODECOPY
SWAP1 RETURN
Loading

0 comments on commit b168a0b

Please sign in to comment.