diff options
author | Dimitry <dimitry@ethereum.org> | 2018-09-03 23:36:10 +0800 |
---|---|---|
committer | Dimitry <dimitry@ethereum.org> | 2018-09-03 23:36:10 +0800 |
commit | c6ea53a574a8a7716b4109f3afeb2580a914c2b4 (patch) | |
tree | ddbc9825a529d13a7ecebed1606012f8ad33b778 /src/GeneralStateTestsFiller/stCreate2 | |
parent | 55946c752613a5392c6b347d0a74956ffb361bd7 (diff) | |
download | dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar.gz dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar.bz2 dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar.lz dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar.xz dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.tar.zst dexon-tests-c6ea53a574a8a7716b4109f3afeb2580a914c2b4.zip |
create2 OOG tests
Diffstat (limited to 'src/GeneralStateTestsFiller/stCreate2')
8 files changed, 541 insertions, 1 deletions
diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeFiller.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeFiller.json new file mode 100644 index 000000000..a21584552 --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeFiller.json @@ -0,0 +1,83 @@ +{ + "Create2OOGafterInitCode" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : 0, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0" + } + }, + "0x6878b140f875209c82ab4d5f083b55947299ef6b" : { + "shouldnotexist" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : 1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0" + } + }, + "0x6878b140f875209c82ab4d5f083b55947299ef6b" : { + "code" : "0x6001600155" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) }", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "54000", "55000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata2Filler.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata2Filler.json new file mode 100644 index 000000000..1f32e73ed --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata2Filler.json @@ -0,0 +1,90 @@ +{ + "Create2OOGafterInitCodeReturndata2" : { + "_info" :{ + "comment" : "Call RETURNDATASIZE and RETURNDATACOPY after CREATE2 deploy a contract. correct returndata copy." + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : 0, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "2", + "0x02" : "0" + } + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : 1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0", + "0x02" : "0x6460016001556000526005601bf3" + } + }, + "6878b140f875209c82ab4d5f083b55947299ef6b" : { + "code" : "0x6001600155" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) [[ 1 ]] (RETURNDATASIZE) (RETURNDATACOPY 0 0 0) [[ 2 ]] (MLOAD 0) }", + "storage": { + "0x01" : "0x01", + "0x01" : "0x02" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "54000", "95000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata3Filler.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata3Filler.json new file mode 100644 index 000000000..22b2b8a30 --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndata3Filler.json @@ -0,0 +1,76 @@ +{ + "Create2OOGafterInitCodeReturndata3" : { + "_info" : { + "comment" : "Calls a contract that runs CREATE2 which deploy a code. then OOG happens upon deployment of the actual code. check the RETURN data buffer in initial contract" + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0x01" + } + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "code" : "{ (CALLCODE (GAS) 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 0 0 32) (RETURNDATACOPY 0 0 32) [[ 1 ]] (MLOAD 0) }", + "storage": { + "0x01" : "0x01" + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) }", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "55000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataFiller.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataFiller.json new file mode 100644 index 000000000..b3c74a10f --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataFiller.json @@ -0,0 +1,71 @@ +{ + "Create2OOGafterInitCodeReturndata" : { + "_info" :{ + "comment" : "Call RETURNDATASIZE and RETURNDATACOPY (BufferOverrun) after CREATE2 deploy a contract" + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "1", + "0x02" : "1" + } + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) [[ 1 ]] (RETURNDATASIZE) (RETURNDATACOPY 0 0 32) [[ 2 ]] (MLOAD 0) }", + "storage": { + "0x01" : "1", + "0x02" : "1" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "54000", "95000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataSizeFiller.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataSizeFiller.json new file mode 100644 index 000000000..a84ee329a --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeReturndataSizeFiller.json @@ -0,0 +1,67 @@ +{ + "Create2OOGafterInitCodeReturndataSize" : { + "_info" : { + "comment" : "Calls a contract that runs CREATE2 which deploy a code. then OOG happens upon deployment of the actual code. check the RETURNDATASIZE after create. fails with OOG if RETURNDATASIZE != 0" + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : 0, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1" + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "{ (MSTORE 0 0x60016001556001600255) (RETURN 22 10) }", + "//code" : "{ (SSTORE 1 1) (SSTORE 2 1) } ", + "code" : "{ (MSTORE 0 0x6960016001556001600255600052600a6016f3) (CREATE2 0 13 19 0) (EXP 2 (RETURNDATASIZE)) }", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "55054" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "1" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevert2Filler.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevert2Filler.json new file mode 100644 index 000000000..4b7ba7a62 --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevert2Filler.json @@ -0,0 +1,76 @@ +{ + "Create2OOGafterInitCodeRevert2" : { + "_info" : { + "comment" : "Calls a contract that runs CREATE2 which deploy a code. then after deployment and exiting from CREATE a REVERT is called. check the REVERT data in this case equal to RETURN value of CREATE2. CREATE2 fails due to the deployment cost." + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0x6460016001556000526005601bf3" + } + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "code" : "{ (CALL 33000 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 0 0 32) [[ 1 ]] (MLOAD 0) }", + "storage": { + "0x01" : "0x01" + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) (REVERT 0 32) }", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "75000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevertFiller.json b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevertFiller.json new file mode 100644 index 000000000..87fc3697b --- /dev/null +++ b/src/GeneralStateTestsFiller/stCreate2/Create2OOGafterInitCodeRevertFiller.json @@ -0,0 +1,76 @@ +{ + "Create2OOGafterInitCodeRevert" : { + "_info" : { + "comment" : "Calls a contract that runs CREATE2 which deploy a code. then after deployment and exiting from CREATE a REVERT is called. check the REVERT data in this case equal to RETURN value of CREATE" + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=Constantinople"], + "result" : { + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x01" : "0x6460016001556000526005601bf3" + } + }, + "0xf1ecf98489fa9ed60a664fc4998db699cfa39d40" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "code" : "{ (CALL (GAS) 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 0 0 32) [[ 1 ]] (MLOAD 0) }", + "storage": { + "0x01" : "0x01" + } + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0", + "nonce" : "0", + "//code" : "(SSTORE 1 1) RETURN", + "code" : "{ (MSTORE 0 0x6460016001556000526005601bf3) (CREATE2 0 18 14 0) (REVERT 0 32) }", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "75000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stCreate2/create2InitCodesFiller.json b/src/GeneralStateTestsFiller/stCreate2/create2InitCodesFiller.json index fb8031b85..5325911cc 100644 --- a/src/GeneralStateTestsFiller/stCreate2/create2InitCodesFiller.json +++ b/src/GeneralStateTestsFiller/stCreate2/create2InitCodesFiller.json @@ -42,7 +42,8 @@ "network" : [">=Constantinople"], "result" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { - "shouldnotexist" : "1" + "balance" : "1", + "nonce" : "2" }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "nonce" : "1" |