aboutsummaryrefslogtreecommitdiffstats
path: root/src/GeneralStateTestsFiller/stCreate2
diff options
context:
space:
mode:
authorwinsvega <winsvega@mail.ru>2018-09-14 05:11:08 +0800
committerGitHub <noreply@github.com>2018-09-14 05:11:08 +0800
commite6be2c8f0a4222dd3b42bb4e08aa344c42da3fc9 (patch)
tree3e2beba771a1fb382902a38c01c9c2d1af00a1a3 /src/GeneralStateTestsFiller/stCreate2
parent3864810c499597684e8e92eb31c938a9db359c31 (diff)
parented0830e9a5348dac050dbf9cb788f980e4fb6059 (diff)
downloaddexon-tests-e6be2c8f0a4222dd3b42bb4e08aa344c42da3fc9.tar.gz
dexon-tests-e6be2c8f0a4222dd3b42bb4e08aa344c42da3fc9.tar.zst
dexon-tests-e6be2c8f0a4222dd3b42bb4e08aa344c42da3fc9.zip
Merge pull request #508 from ethereum/create2
create2 on depth 1023 1024
Diffstat (limited to 'src/GeneralStateTestsFiller/stCreate2')
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1023Filler.json79
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1024Filler.json80
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/Create2RecursiveFiller.json77
-rw-r--r--src/GeneralStateTestsFiller/stCreate2/RevertDepthCreateAddressCollisionFiller.json150
4 files changed, 386 insertions, 0 deletions
diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1023Filler.json b/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1023Filler.json
new file mode 100644
index 000000000..284a10650
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1023Filler.json
@@ -0,0 +1,79 @@
+{
+ "Create2OnDepth1023" : {
+ "_info" : {
+ "comment" : "Create2OnDepth1023, 0x0400 indicates 1022 level."
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "9223372036854775807",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x4f05179f0987710f94f2cbde67c5357bc1815af3" : {
+ "nonce" : "1"
+ },
+ "0xa3da9580897e90044fa0de6969815406b3172e3a" : {
+ "storage" : {
+ "0x01" : "0x4f05179f0987710f94f2cbde67c5357bc1815af3"
+ }
+ },
+ "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "storage" : {
+ "0x01" : "0xa3da9580897e90044fa0de6969815406b3172e3a"
+ }
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "70368744177664000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "//codeinsidecreate2" : "{ [[1]] (CREATE2 0 0 0 0) } ",
+ "code" : "{ (MSTORE 0 (CALLDATALOAD 0)) (MSTORE 0 (ADD 2 (MLOAD 0))) (if (EQ (MLOAD 0) 0x0400) (seq (MSTORE 32 0x6000600060006000f5600155) [[1]] (CREATE2 0 52 12 0)) (CALL (GAS) 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b (EQ (MLOAD 0) 0x0400) 0 32 0 0)) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "code" : "{ (MSTORE 0 (CALLDATALOAD 0)) (CALL (GAS) 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 32 0 0) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "9223372036854775806"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1024Filler.json b/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1024Filler.json
new file mode 100644
index 000000000..3d6d8f401
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/Create2OnDepth1024Filler.json
@@ -0,0 +1,80 @@
+{
+ "Create2OnDepth1024" : {
+ "_info" : {
+ "comment" : "Create2OnDepth1024, 0x0400 indicates 1022 level."
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "9223372036854775807",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x436b8f99e8d953cdaf8f9472116add83ccd82a65" : {
+ "//comment" : "this nonce would have been equal to 2 if create worked",
+ "nonce" : "1"
+ },
+ "0xb250d8cdad4a7a81323be508f4ac44584dd27597" : {
+ "storage" : {
+ "0x01" : "0x436b8f99e8d953cdaf8f9472116add83ccd82a65"
+ }
+ },
+ "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "storage" : {
+ "0x01" : "0xb250d8cdad4a7a81323be508f4ac44584dd27597"
+ }
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "70368744177664000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "//codeinsidecreate2" : "{ (MSTORE 0 0x6000600060006000f5) [[1]] (CREATE2 0 23 9 0) } ",
+ "code" : "{ (MSTORE 0 (CALLDATALOAD 0)) (MSTORE 0 (ADD 2 (MLOAD 0))) (if (EQ (MLOAD 0) 0x0400) (seq (MSTORE 32 0x686000600060006000f56000526000600960176000f5600155) [[1]] (CREATE2 0 39 25 0)) (CALL (GAS) 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b (EQ (MLOAD 0) 0x0400) 0 32 0 0)) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "code" : "{ (MSTORE 0 (CALLDATALOAD 0)) (CALL (GAS) 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 32 0 0) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "9223372036854775806"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2RecursiveFiller.json b/src/GeneralStateTestsFiller/stCreate2/Create2RecursiveFiller.json
new file mode 100644
index 000000000..785967098
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/Create2RecursiveFiller.json
@@ -0,0 +1,77 @@
+{
+ "Create2Recursive" : {
+ "_info" : {
+ "comment" : "Create2 inside Create2 inside Create2...."
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x20000",
+ "currentGasLimit" : "9223372036854775807",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x4b17a07e119e86a0ff1fd21cdc9b4aba196ed3f8" : {
+ "//comment" : "1024's address",
+ "nonce" : "1"
+ }
+ }
+ },
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : 1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "0x471a0e624a2ac11c82cf1ff843127f1c6aa98351" : {
+ "//comment" : "1023's address",
+ "nonce" : "1"
+ }
+ }
+ }
+ ],
+ "pre" : {
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "70368744177664000000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0",
+ "//code" : "{ (CODECOPY 0 0 100) (if (LT (GAS) 1000) (GAS) (CREATE2 0 0 100 0)) }",
+ "code" : "{ (MSTORE 0 0x606460006000396103e85a10601b576000606460006000f5601d565b5a5b) (CREATE2 0 2 30 0) }",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "9223372036854775806", "20060000000000"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : [
+ "0x00"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stCreate2/RevertDepthCreateAddressCollisionFiller.json b/src/GeneralStateTestsFiller/stCreate2/RevertDepthCreateAddressCollisionFiller.json
new file mode 100644
index 000000000..b3f4cebd5
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stCreate2/RevertDepthCreateAddressCollisionFiller.json
@@ -0,0 +1,150 @@
+{
+ "RevertDepthCreateAddressCollision" : {
+ "_info" : {
+ "comment" : "copy of this test for CREATE2"
+ },
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x020000",
+ "currentGasLimit" : "10000000",
+ "currentNumber" : "1",
+ "currentTimestamp" : "1000",
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : 1,
+ "gas" : 1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "3e180b1862f9d158abb5e519a6d8605540c23682" : {
+ "code" : "0x60016000556000600060006000600073b000000000000000000000000000000000000000600035f1600155600c600455",
+ "nonce" : "54",
+ "storage" : {
+ "0x00" : "0x01",
+ "0x01" : "0x01",
+ "0x04" : "0x0c"
+ }
+ },
+ "b000000000000000000000000000000000000000" : {
+ "storage" : {
+ "0x02" : "0x08",
+ "0x03" : "0x0c"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "OOG in subcall",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 1,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "3e180b1862f9d158abb5e519a6d8605540c23682" : {
+ "code" : "{ [[0]] 1 [[1]] (CALL (CALLDATALOAD 0) 0xb000000000000000000000000000000000000000 0 0 0 0 0) [[4]] 12 }",
+ "nonce" : "54",
+ "storage" : {
+ "0x00" : "0x01",
+ "0x04" : "0x0c"
+ }
+ },
+ "b000000000000000000000000000000000000000" : {
+ "storage" : {
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "OOG after subcall",
+ "indexes" : {
+ "data" : 1,
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "3e180b1862f9d158abb5e519a6d8605540c23682" : {
+ "balance" : "0x05",
+ "code" : "{ [[0]] 1 [[1]] (CALL (CALLDATALOAD 0) 0xb000000000000000000000000000000000000000 0 0 0 0 0) [[4]] 12 }",
+ "nonce" : "54",
+ "storage" : {
+ }
+ },
+ "b000000000000000000000000000000000000000" : {
+ "storage" : {
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "double OOG",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "3e180b1862f9d158abb5e519a6d8605540c23682" : {
+ "code" : "{ [[0]] 1 [[1]] (CALL (CALLDATALOAD 0) 0xb000000000000000000000000000000000000000 0 0 0 0 0) [[4]] 12 }",
+ "nonce" : "54",
+ "storage" : {
+ }
+ },
+ "b000000000000000000000000000000000000000" : {
+ "storage" : {
+ }
+ }
+ }
+ }
+ ],
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000000000000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "3e180b1862f9d158abb5e519a6d8605540c23682" : {
+ "balance" : "5",
+ "code" : "{ [[0]] 1 [[1]] (CALL (CALLDATALOAD 0) 0xb000000000000000000000000000000000000000 0 0 0 0 0) [[4]] 12 }",
+ "nonce" : "54",
+ "storage" : {
+ }
+ },
+ "b000000000000000000000000000000000000000" : {
+ "balance" : "",
+ "code" : "{ [[2]] 8 (CREATE2 0 0 0 0) [[3]] 12}",
+ "nonce" : "",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "//0 data" : "Call with value to address A, then another call X, in the call X CREATE of account A, OOG -> revert call X.",
+ "//1 data" : "d0g0 - double OOG, d0g1 - OOG inside subcall, d1g0 - OOG after subcall, d1g1 - no OOG",
+ "data" : [
+ "0x000000000000000000000000000000000000000000000000000000000000ea60",
+ "0x000000000000000000000000000000000000000000000000000000000001ea60"
+ ],
+ "gasLimit" : [
+ "110000", "160000"
+ ],
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "3e180b1862f9d158abb5e519a6d8605540c23682",
+ "value" : [
+ "1", "0"
+ ]
+ }
+ }
+}