From 45fdeabf2648482fa155358ead296faa4a0c94e3 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Mon, 26 Jun 2017 15:06:17 +0200 Subject: Add a test about staticcall not inheriting the callvalue from the parent call (caused by call instruction) --- .../static_call_value_inherit_from_call.json | 115 +++++++++++++++++++++ .../static_call_value_inherit_from_callFiller.json | 76 ++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 GeneralStateTests/stStaticCall/static_call_value_inherit_from_call.json create mode 100644 src/GeneralStateTestsFiller/stStaticCall/static_call_value_inherit_from_callFiller.json diff --git a/GeneralStateTests/stStaticCall/static_call_value_inherit_from_call.json b/GeneralStateTests/stStaticCall/static_call_value_inherit_from_call.json new file mode 100644 index 000000000..d5e1c9379 --- /dev/null +++ b/GeneralStateTests/stStaticCall/static_call_value_inherit_from_call.json @@ -0,0 +1,115 @@ +{ + "static_call_value_inherit_from_call" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.5bca1594.Linux.g++", + "source" : "/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inherit_from_callFiller.json" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "EIP150" : [ + { + "hash" : "0x68a0e8cef995f94a37114ca57ad3b172c6de346f3cb333a806ebb7a0cd2b6005", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + } + ], + "EIP158" : [ + { + "hash" : "0x68a0e8cef995f94a37114ca57ad3b172c6de346f3cb333a806ebb7a0cd2b6005", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + } + ], + "Frontier" : [ + { + "hash" : "0x7fe3f4754897e3ffa189561ff6d94e43c6dc2fbaffa299037c73740099d9100f", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + } + ], + "Homestead" : [ + { + "hash" : "0x7fe3f4754897e3ffa189561ff6d94e43c6dc2fbaffa299037c73740099d9100f", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + } + ], + "Metropolis" : [ + { + "hash" : "0xa029c69b1ece1e1d9b91446b4029a16f25e89aca3c78e66a39d16cf8ee71ad66", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + } + ] + }, + "pre" : { + "0x094f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x01", + "code" : "0x602060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61c350fa600055600051600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x01" + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0xe8d4a51000", + "code" : "", + "nonce" : "0x00", + "storage" : { + } + }, + "0xc8b90f8d999d9d9988209481999a9889098a89a0" : { + "balance" : "0x00", + "code" : "0x6000600060006000600a73094f5374fce5edbc8e2a8697c15331677e6ebf0b620186a0f1", + "nonce" : "0x00", + "storage" : { + } + }, + "0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x01", + "code" : "0x3460005260206000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "0x0704e0" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0xc8b90f8d999d9d9988209481999a9889098a89a0", + "value" : [ + "0x0a" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inherit_from_callFiller.json b/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inherit_from_callFiller.json new file mode 100644 index 000000000..43183da30 --- /dev/null +++ b/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inherit_from_callFiller.json @@ -0,0 +1,76 @@ +{ + "static_call_value_inherit_from_call" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "094f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "storage" : { + "0x0" : "0x1", + "0x1" : "0x0" + } + } + } + } + ], + "pre" : + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "094f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1", + "code" : "{ [[0]] (STATICCALL 50000 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 0 32) [[1]] (MLOAD 0) }", + "nonce" : "0", + "storage" : { + "0x1": "1" + } + }, + "c8b90f8d999d9d9988209481999a9889098a89a0" : { + "balance" : "0", + "code" : "{ (CALL 100000 0x094f5374fce5edbc8e2a8697c15331677e6ebf0b 10 0 0 0 0) }", + "nonce" : "0", + "storage" : {} + }, + "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1", + "code" : "{ (MSTORE 0 (CALLVALUE)) (RETURN 0 32) }", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "460000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c8b90f8d999d9d9988209481999a9889098a89a0", + "value" : [ + "10" + ] + } + } +} -- cgit