aboutsummaryrefslogtreecommitdiffstats
path: root/src/GeneralStateTestsFiller/stCreate2
diff options
context:
space:
mode:
authorDimitry <dimitry@ethereum.org>2018-09-08 23:54:53 +0800
committerDimitry <dimitry@ethereum.org>2018-09-08 23:54:53 +0800
commit827fec4bc47db888b0f50aa8251f2987f42fd1e8 (patch)
tree4808aa34995371537887c5fe6a020b83fc30c6d3 /src/GeneralStateTestsFiller/stCreate2
parente740a725a28bf7714abd0c400439f060fdd1e873 (diff)
downloaddexon-tests-827fec4bc47db888b0f50aa8251f2987f42fd1e8.tar.gz
dexon-tests-827fec4bc47db888b0f50aa8251f2987f42fd1e8.tar.zst
dexon-tests-827fec4bc47db888b0f50aa8251f2987f42fd1e8.zip
more create2 tests
Diffstat (limited to 'src/GeneralStateTestsFiller/stCreate2')
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/create2checkFieldsInInitcodeFiller.json94
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/returndatacopy_0_0_following_successful_createFiller.json66
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/returndatacopy_afterFailing_createFiller.json64
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/returndatacopy_following_createFiller.json95
4 files changed, 315 insertions, 4 deletions
diff --git a/src/GeneralStateTestsFiller/stCreate2/create2checkFieldsInInitcodeFiller.json b/src/GeneralStateTestsFiller/stCreate2/create2checkFieldsInInitcodeFiller.json
index fc00eb1c8..21bf14b61 100644
--- a/src/GeneralStateTestsFiller/stCreate2/create2checkFieldsInInitcodeFiller.json
+++ b/src/GeneralStateTestsFiller/stCreate2/create2checkFieldsInInitcodeFiller.json
@@ -1,7 +1,7 @@
{
"create2checkFieldsInInitcode" : {
"_info" : {
- "comment" : "Check opcode values in create2 init code. Create2 called with different call types."
+ "comment" : "Check opcode values in create2 init code. Create2 called with different call types. CREATE2 inside CRETE2 inside CALL, CALLCODE, DELEGATECALL, STATICCALL << test values of SENDER,address and so on."
},
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
@@ -14,7 +14,7 @@
"expect" : [
{
"indexes" : {
- "data" : 0,
+ "data" : [0,4],
"gas" : -1,
"value" : -1
},
@@ -95,7 +95,7 @@
},
{
"indexes" : {
- "data" : 3,
+ "data" : [3, 7],
"gas" : -1,
"value" : -1
},
@@ -105,6 +105,60 @@
"nonce" : "1"
}
}
+ },
+ {
+ "indexes" : {
+ "data" : 5,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "dd216ee8d9ec9d48768efa989e3c599b0327f1ba" : {
+ "balance" : "0",
+ "nonce" : "1",
+ "storage" : {
+ "0x00" : "0xdd216ee8d9ec9d48768efa989e3c599b0327f1ba",
+ "0x01" : "0",
+ "0x02" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "0x03" : "0x1bebe06c0893a047ea4ce821f24668d9034e204f",
+ "0x04" : "0",
+ "0x05" : "0",
+ "0x06" : "0x21",
+ "0x07" : "1"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "nonce" : "1"
+ }
+ }
+ },
+ {
+ "indexes" : {
+ "data" : 6,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "ce2c5c4667c2e59af5767b677a65e31fa14f62ad" : {
+ "balance" : "0",
+ "nonce" : "1",
+ "storage" : {
+ "0x00" : "0xce2c5c4667c2e59af5767b677a65e31fa14f62ad",
+ "0x01" : "0",
+ "0x02" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "0x03" : "0xab166837a8bc12757f73555d296f726df214cd4c",
+ "0x04" : "0",
+ "0x05" : "0",
+ "0x06" : "0x21",
+ "0x07" : "1"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "nonce" : "1"
+ }
+ }
}
],
"pre" : {
@@ -129,6 +183,13 @@
"storage" : {
}
},
+ "1100000000000000000000000000000000000000" : {
+ "balance" : "0x00",
+ "code" : "{ (CREATE2 0 0 (lll (seq (CALL (GAS) 0xf000000000000000000000000000000000000000 0 0 0 0 0)) 0) 0) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
"2000000000000000000000000000000000000000" : {
"balance" : "0x00",
"code" : "{ (CALLCODE (GAS) 0xf000000000000000000000000000000000000000 0 0 0 0 0) }",
@@ -136,6 +197,13 @@
"storage" : {
}
},
+ "2200000000000000000000000000000000000000" : {
+ "balance" : "0x00",
+ "code" : "{ (CREATE2 0 0 (lll (seq (CALLCODE (GAS) 0xf000000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
"3000000000000000000000000000000000000000" : {
"balance" : "0x00",
"code" : "{ (DELEGATECALL (GAS) 0xf000000000000000000000000000000000000000 0 0 0 0) }",
@@ -143,6 +211,13 @@
"storage" : {
}
},
+ "3300000000000000000000000000000000000000" : {
+ "balance" : "0x00",
+ "code" : "{ (CREATE2 0 0 (lll (seq (DELEGATECALL (GAS) 0xf000000000000000000000000000000000000000 0 0 0 0) ) 0) 0) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
"4000000000000000000000000000000000000000" : {
"balance" : "0x00",
"code" : "{ (STATICCALL (GAS) 0xf200000000000000000000000000000000000000 0 0 0 256) [[10]] (MLOAD 0) }",
@@ -150,6 +225,13 @@
"storage" : {
}
},
+ "4400000000000000000000000000000000000000" : {
+ "balance" : "0x00",
+ "code" : "{ (CREATE2 0 0 (lll (seq (STATICCALL (GAS) 0xf200000000000000000000000000000000000000 0 0 0 256) [[10]] (MLOAD 0) ) 0) 0 ) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
"f000000000000000000000000000000000000000" : {
"balance" : "0x00",
"code" : "{ (CREATE2 0 0 (lll (seq [[0]] (ADDRESS) [[1]] (BALANCE (ADDRESS)) [[2]] (ORIGIN) [[3]] (CALLER) [[4]] (CALLVALUE) [[5]] (CALLDATASIZE) [[6]] (CODESIZE) [[7]] (GASPRICE) ) 0) 0) }",
@@ -170,7 +252,11 @@
"0x0000000000000000000000001000000000000000000000000000000000000000",
"0x0000000000000000000000002000000000000000000000000000000000000000",
"0x0000000000000000000000003000000000000000000000000000000000000000",
- "0x0000000000000000000000004000000000000000000000000000000000000000"
+ "0x0000000000000000000000004000000000000000000000000000000000000000",
+ "0x0000000000000000000000001100000000000000000000000000000000000000",
+ "0x0000000000000000000000002200000000000000000000000000000000000000",
+ "0x0000000000000000000000003300000000000000000000000000000000000000",
+ "0x0000000000000000000000004400000000000000000000000000000000000000"
],
"gasLimit" : [
"600000"
diff --git a/src/GeneralStateTestsFiller/stCreate2/returndatacopy_0_0_following_successful_createFiller.json b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_0_0_following_successful_createFiller.json
new file mode 100644
index 000000000..423fd56fa
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_0_0_following_successful_createFiller.json
@@ -0,0 +1,66 @@
+{
+ "returndatacopy_0_0_following_successful_create" : {
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "0x0a00000000",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "storage" : {
+ "0x00" : "0x00"
+ }
+ },
+ "bd70f8d180fa7825cf80ec820740e80187f35db5" : {
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "0x00",
+ "code" : "{ (create2 0 0 (lll {(SSTORE 0 1)} 0) 0) (RETURNDATACOPY 0 0 0) (SSTORE 0 0) }",
+ "nonce" : "0x00",
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ },
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x6400000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "0x0a00000000"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stCreate2/returndatacopy_afterFailing_createFiller.json b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_afterFailing_createFiller.json
new file mode 100644
index 000000000..4b2470b06
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_afterFailing_createFiller.json
@@ -0,0 +1,64 @@
+{
+ "returndatacopy_afterFailing_create" : {
+ "_info" : {
+ "comment" : "Returndatacopy after failing create case due to 0xfd code."
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "0x0a00000000",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ { "indexes" : {
+ "data" : -1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "storage" : {
+ "0x00" : "0x20",
+ "0x01" : "0x02"
+ }
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "0x00",
+ "code" : "{ (MSTORE 0 0x600260005260206000fd) (create2 0 22 10 0) (SSTORE 0 (RETURNDATASIZE)) (RETURNDATACOPY 0 0 32) (SSTORE 1 (MLOAD 0)) }",
+ "nonce" : "0x00",
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ },
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x6400000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "0x0a00000000"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stCreate2/returndatacopy_following_createFiller.json b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_following_createFiller.json
new file mode 100644
index 000000000..3cd1b489a
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/returndatacopy_following_createFiller.json
@@ -0,0 +1,95 @@
+{
+ "returndatacopy_following_create" : {
+ "_info" : {
+ "comment" : "Check that create2 does not fill returndata buffer with its return opcode."
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "0x0a00000000",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : 0,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "indexes" : {
+ "data" : 1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x1f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "1aabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "0x00",
+ "code" : "{ (CALL (GAS) (CALLDATALOAD 0) 0 0 0 0 0) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "0x00",
+ "code" : "{ (CREATE2 0 0 (lll (seq (MSTORE 0 0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff) (RETURN 0 32)) 0) 0) (RETURNDATACOPY 0 0 32) (SSTORE 0 (MLOAD 0)) }",
+ "nonce" : "0x00",
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ },
+ "1f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "0x00",
+ "code" : "{ (seq (create2 0 0 (lll (STOP) 0) 0) (RETURNDATACOPY 0 0 32) (SSTORE 0 (MLOAD 0)) )}",
+ "nonce" : "0x00",
+ "storage" : {
+ "0x00" : "0x01"
+ }
+ },
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x6400000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ "0x0000000000000000000000000f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "0x0000000000000000000000001f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
+ ],
+ "gasLimit" : [
+ "0x0a00000000"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0x1aabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}