aboutsummaryrefslogtreecommitdiffstats
path: root/src/GeneralStateTestsFiller
diff options
context:
space:
mode:
authorDimitry <dimitry@ethereum.org>2018-10-25 06:36:11 +0800
committerDimitry <dimitry@ethereum.org>2018-10-25 06:36:11 +0800
commit3437c744fac38f4ee9bc0ed6cabeb1058c097f2f (patch)
tree8c6123c2e498569f002864c21bfb641df55b373a /src/GeneralStateTestsFiller
parent5b4cc6c9d5b4004be8369852e5f9cfe4e81200df (diff)
downloadtangerine-tests-3437c744fac38f4ee9bc0ed6cabeb1058c097f2f.tar.gz
tangerine-tests-3437c744fac38f4ee9bc0ed6cabeb1058c097f2f.tar.zst
tangerine-tests-3437c744fac38f4ee9bc0ed6cabeb1058c097f2f.zip
sstore collision overwrite sstore
external call overwrite sstore
Diffstat (limited to 'src/GeneralStateTestsFiller')
-rw-r--r--src/GeneralStateTestsFiller/stSStoreTest/InitCollisionFiller.json162
-rw-r--r--src/GeneralStateTestsFiller/stSStoreTest/sstore_changeFromExternalCallInInitCodeFiller.json161
2 files changed, 323 insertions, 0 deletions
diff --git a/src/GeneralStateTestsFiller/stSStoreTest/InitCollisionFiller.json b/src/GeneralStateTestsFiller/stSStoreTest/InitCollisionFiller.json
new file mode 100644
index 000000000..e67122f88
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stSStoreTest/InitCollisionFiller.json
@@ -0,0 +1,162 @@
+{
+ "InitCollision" : {
+ "_info" : {
+ "comment" : "account already has storage X. create -> in init code change that account's storage -> 0 -> change it to X again "
+ },
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x020000",
+ "currentGasLimit" : "10000000",
+ "currentNumber" : "1",
+ "currentTimestamp" : "1000",
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "//comment" : "Collision on transaction create",
+ "indexes" : {
+ "data" : [0],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "nonce" : "1",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "fc597da4849c0d854629216d9e297bbca7bb4616" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "Collision on create2",
+ "indexes" : {
+ "data" : [1],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "nonce" : "2",
+ "storage" : {
+ "0x01" : "0x00"
+ }
+ },
+ "fc597da4849c0d854629216d9e297bbca7bb4616" : {
+ "nonce" : "1",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "Collision on create2 and REVERT",
+ "indexes" : {
+ "data" : [2],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "fc597da4849c0d854629216d9e297bbca7bb4616" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "Collision on create2 and OOG",
+ "indexes" : {
+ "data" : [3],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "nonce" : "2",
+ "storage" : {
+ "0x01" : "0x00"
+ }
+ },
+ "fc597da4849c0d854629216d9e297bbca7bb4616" : {
+ "nonce" : "1",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ }
+ }
+ }
+ ],
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000000000000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "//comment" : "transaction create account",
+ "balance" : "",
+ "code" : "",
+ "nonce" : "",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "fc597da4849c0d854629216d9e297bbca7bb4616" : {
+ "//comment" : "Create2 account",
+ "balance" : "",
+ "code" : "",
+ "nonce" : "",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "dea0000000000000000000000000000000000000" : {
+ "balance" : "",
+ "code" : "{ [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 }",
+ "nonce" : "",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ "{ (SSTORE 1 0) (SSTORE 1 1) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (SSTORE 1 0) (SSTORE 1 1) ) 0) 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (SSTORE 1 0) (SSTORE 1 1) ) 0) 0) (REVERT 0 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (SSTORE 1 0) (SSTORE 1 1) ) 0) 0) (CALL 200000 0xdea0000000000000000000000000000000000000 0 0 0 0 0) (STOP) ) }"
+ ],
+ "gasLimit" : [
+ "200000"
+ ],
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : [
+ "0"
+ ]
+ }
+ }
+}
diff --git a/src/GeneralStateTestsFiller/stSStoreTest/sstore_changeFromExternalCallInInitCodeFiller.json b/src/GeneralStateTestsFiller/stSStoreTest/sstore_changeFromExternalCallInInitCodeFiller.json
new file mode 100644
index 000000000..811b63b25
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stSStoreTest/sstore_changeFromExternalCallInInitCodeFiller.json
@@ -0,0 +1,161 @@
+{
+ "sstore_changeFromExternalCallInInitCode" : {
+ "_info" : {
+ "comment" : "account already has storage X. create -> in init code change that account's storage -> 0 -> change it to X again "
+ },
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x020000",
+ "currentGasLimit" : "10000000",
+ "currentNumber" : "1",
+ "currentTimestamp" : "1000",
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "//comment" : "call ",
+ "indexes" : {
+ "data" : [0, 1, 3],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "bea0000000000000000000000000000000000000" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x00" : "0x01",
+ "0x01" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "call + revert",
+ "indexes" : {
+ "data" : [2, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "bea0000000000000000000000000000000000000" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x00" : "0x00",
+ "0x01" : "0x01"
+ }
+ },
+ "6602cfc925be62bf18470598a98f72812a1ebef2" : {
+ "shouldnotexist" : "1"
+ }
+ }
+ },
+ {
+ "//comment" : "callcode",
+ "indexes" : {
+ "data" : [4],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "bea0000000000000000000000000000000000000" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x00" : "0x00",
+ "0x01" : "0x01"
+ }
+ },
+ "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+ "nonce" : "1",
+ "storage" : {
+ "0x00" : "0x01",
+ "0x01" : "0x01"
+ }
+ }
+ }
+ },
+ {
+ "//comment" : "callcode + create2",
+ "indexes" : {
+ "data" : [5, 7],
+ "gas" : 0,
+ "value" : -1
+ },
+ "network" : [">=Constantinople"],
+ "result" : {
+ "bea0000000000000000000000000000000000000" : {
+ "nonce" : "0",
+ "storage" : {
+ "0x00" : "0x00",
+ "0x01" : "0x01"
+ }
+ },
+ "6602cfc925be62bf18470598a98f72812a1ebef2" : {
+ "nonce" : "1",
+ "storage" : {
+ "0x00" : "0x01",
+ "0x01" : "0x01"
+ }
+ }
+ }
+ }
+ ],
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000000000000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "bea0000000000000000000000000000000000000" : {
+ "balance" : "",
+ "code" : "{ (SSTORE 1 0) (SSTORE 1 1) (SSTORE 0 1) }",
+ "nonce" : "",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "dea0000000000000000000000000000000000000" : {
+ "balance" : "",
+ "code" : "{ [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 }",
+ "nonce" : "",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ "{ (CALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (REVERT 0 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (CALL 200000 0xdea0000000000000000000000000000000000000 0 0 0 0 0) (STOP) ) }",
+ "{ (CALLCODE 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALLCODE 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALLCODE 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (REVERT 0 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (CALLCODE 100000 0xbea0000000000000000000000000000000000000 0 0 0 0 0) ) 0) 0) (CALL 200000 0xdea0000000000000000000000000000000000000 0 0 0 0 0) (STOP) ) }",
+ "{ (DELEGATECALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (DELEGATECALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (DELEGATECALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (REVERT 0 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (DELEGATECALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (CALL 200000 0xdea0000000000000000000000000000000000000 0 0 0 0 0) (STOP) ) }",
+ "{ (STATICCALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (STATICCALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (STATICCALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (REVERT 0 0) (STOP) ) }",
+ "{ (seq (CREATE2 0 0 (lll (seq (STATICCALL 100000 0xbea0000000000000000000000000000000000000 0 0 0 0) ) 0) 0) (CALL 200000 0xdea0000000000000000000000000000000000000 0 0 0 0 0) (STOP) ) }"
+ ],
+ "gasLimit" : [
+ "200000"
+ ],
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "",
+ "value" : [
+ "0"
+ ]
+ }
+ }
+}