diff options
-rw-r--r-- | GeneralStateTests/stPreCompiledContracts/modexp.json | 271 | ||||
-rw-r--r-- | src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json | 221 |
2 files changed, 492 insertions, 0 deletions
diff --git a/GeneralStateTests/stPreCompiledContracts/modexp.json b/GeneralStateTests/stPreCompiledContracts/modexp.json new file mode 100644 index 000000000..562a9c443 --- /dev/null +++ b/GeneralStateTests/stPreCompiledContracts/modexp.json @@ -0,0 +1,271 @@ +{ + "modexp" : { + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Metropolis" : [ + { + "hash" : "0x3f6a7d118c23f7c56e1209fabbf80e92477731daf4f834a5bfa1156408310b99", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x0d5bb4114605fbd511192f3195e33f9630009abb78a79f6ee8a5bf515bc0d7b1", + "indexes" : { + "data" : 1, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xe3a7ddada48220c8592f6bd514430285b58b3383623a93710feab1c651651a18", + "indexes" : { + "data" : 2, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xb01284f01a1628a9d43d80050b4fda204c15dff260cb197102f5a2dbad16149e", + "indexes" : { + "data" : 3, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x31e905dc9235f9087d1903de0c6ae5c47e5eb2bc3bf2e3d1648070d5b979a679", + "indexes" : { + "data" : 4, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x99f6c575d5a287579ec454c95dd88f2364ed04642c9f1f2aa9e2c7349e2b3b55", + "indexes" : { + "data" : 5, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xed263b047df301fd5dc55126a1d858a99fa2c7a6cda051e3d6f3794cb8b12861", + "indexes" : { + "data" : 6, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x52cc4eb471c9560489ca51f170a5852b29f66847fcdb4c42ea37255b96ba1973", + "indexes" : { + "data" : 7, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xa945c5f8d68676c99d2cac071869ca38c9c1a23f2dcf9a8b08c663f3e9d97e47", + "indexes" : { + "data" : 8, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x548b75e6b85f994ec0f6dc3e7c5f5b96981c5d9d5559f9528ce55aa27fa59488", + "indexes" : { + "data" : 9, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x2ca8c0c717997cb343a2c40361aee089948bf81f5b54b6a70c0142ce47dbdd3b", + "indexes" : { + "data" : 10, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xad6357cbdf0bec96c717c466205b4e4d1701b8e509ea7a4c309e6d19767e3d2c", + "indexes" : { + "data" : 11, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x2ca8c0c717997cb343a2c40361aee089948bf81f5b54b6a70c0142ce47dbdd3b", + "indexes" : { + "data" : 12, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x548b75e6b85f994ec0f6dc3e7c5f5b96981c5d9d5559f9528ce55aa27fa59488", + "indexes" : { + "data" : 13, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xe931892583db8a3be87fdc79c961f0ac3c8e3dcce8ac423dd7c5f1b8198d2f29", + "indexes" : { + "data" : 14, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x548b75e6b85f994ec0f6dc3e7c5f5b96981c5d9d5559f9528ce55aa27fa59488", + "indexes" : { + "data" : 15, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xb38b07f4f1d4401d64e4796e79aebaa339faba8ff438ee1fd37e7058e3079a0e", + "indexes" : { + "data" : 16, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x700712ea25c4d123021b690c8b5457404ff1c7263663a523dc83b6c523c348a3", + "indexes" : { + "data" : 17, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x2ca8c0c717997cb343a2c40361aee089948bf81f5b54b6a70c0142ce47dbdd3b", + "indexes" : { + "data" : 18, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x983bc042119afb8ab9ca087eab378e8f7ac7fe0010c1e8f4b17907141ce67c22", + "indexes" : { + "data" : 19, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xdc9371c778ad15b02e9575e305fde0645b15642d0dd8878bc41da9fb88252722", + "indexes" : { + "data" : 20, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x2645e04375986d954b5a519729a0185493e8c742ade1a47c209518f39bf7b34a", + "indexes" : { + "data" : 21, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xdc9371c778ad15b02e9575e305fde0645b15642d0dd8878bc41da9fb88252722", + "indexes" : { + "data" : 22, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0x1b6eb5326be2812301439769d4c1ee96cd1f7caada80dfa4cedfe8631c28770f", + "indexes" : { + "data" : 23, + "gas" : 0, + "value" : 0 + } + }, + { + "hash" : "0xbeb3a72a05bec1ad4c3c7f0d5c761676093c5859aa2052b30d5f89a09c56c418", + "indexes" : { + "data" : 24, + "gas" : 0, + "value" : 0 + } + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x36600060003760206103e8366000600060055af26001556103e851600255", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002003fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003ffff800000000000000000000000000000000000000000000000000000000000000007", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003ffff80", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020038000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000080", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000", + "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000101", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000304", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020004", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020300", + "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010304", + "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010204", + "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000203", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000202030006", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020306", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002020300", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000202030000", + "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020203", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002023003", + "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020230", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +}
\ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json b/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json new file mode 100644 index 000000000..7db520093 --- /dev/null +++ b/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json @@ -0,0 +1,221 @@ +{ + "modexp" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "10000000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "EIP150", "EIP158"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x00" + } + } + } + }, + { + "indexes" : { + "data" : [0,6,7], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x01" + } + } + } + }, + { + "indexes" : { + "data" : [1,5,8,9,10,12,13,15,18,19,20,21,22,23,24], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x00" + } + } + } + }, + { + "indexes" : { + "data" : [2], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x00", + "0x02" : "0x00" + } + } + } + }, + { + "indexes" : { + "data" : [3,4], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x3b01b01ac41f2d6e917c6d6a221ce793802469026d9ab7578fa2e79e4da6aaab" + } + } + } + }, + { + "indexes" : { + "data" : [11, 14], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x0100000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "indexes" : { + "data" : [16], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x02000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "indexes" : { + "data" : [17], + "gas" : -1, + "value" : -1 + }, + "network" : ["Metropolis"], + "result" : { + "1000000000000000000000000000000000000000" : { + "storage" : { + "0x01" : "0x01", + "0x02" : "0x0200000000000000000000000000000000000000000000000000000000000000" + } + } + } + } + ], + "pre" : { + "1000000000000000000000000000000000000000" : { + "balance" : "", + "code" : "{ (CALLDATACOPY 0 0 (CALLDATASIZE)) [[1]] (CALLCODE (GAS) 5 0 0 (CALLDATASIZE) 1000 32) [[2]](MLOAD 1000) }", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "(BASE**EXPONENT) % MODULUS", + "0 - example: 3**(2**256 - 2**32 - 978) % (2**256 - 2**32 - 977).", + "1 - Would be parsed as a base of 0, exponent of 2**256 - 2**32 - 978 and modulus of 2**256 - 2**32 - 978, and so would return 0. Notice how if the length_of_BASE is 0, then it does not interpret any data as the base, instead immediately interpreting the next 32 bytes as length_of_EXPONENT.", + "2 - Would parse a base length of 0, a modulus length of 32, and an exponent length of 2**256 - 1, where the base is empty, the modulus is 2**256 - 2 and the exponent is (2**256 - 3) * 256**(2**256 - 33) (yes, that's a really big number). It would then immediately fail, as it's not possible to provide enough gas to make that computation.", + "3 - Would parse as a base of 3, an exponent of 65535, and a modulus of 2**255, and it would ignore the remaining 0x07 byte.", + "4 - Would also parse as a base of 3, an exponent of 65535 and a modulus of 2**255, as it attempts to grab 32 bytes for the modulus starting from 0x80, but then there is no further data so it right pads it with 31 zeroes.", + "5 - Missing values", + "6 - Empty value", + "7 - 0**0 % 0x80", + "8 - 0**0 % 0", + "9 - modlength zero", + "10 - 0**03 % 04", + "11 - 02**00 % 04", + "12 - 02**03 % 00", + "13 - **03 % 04", + "14 - 02** % 04", + "15 - 02**03 % ", + "16 - 02**03 % 06", + "17 - 02**03 % 0006", + "18,19,20 - Non-zero length mod, but passed calldata has not enough total length", + "21,21,22,23 - Non-zero length exp & mod, but passed data has only base and part of exp / only base", + "24 - Non-zero length base & exp & mod and no values in input data - interpreted as all zeroes" + ], + "data" : [ + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002003fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", +"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", +"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd" , +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003ffff800000000000000000000000000000000000000000000000000000000000000007", +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003ffff80", +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002003", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020038000000000000000000000000000000000000000000000000000000000000000", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000080", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000", +"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000101", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000304", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020004", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020300", +"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010304", +"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010204", +"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000203", +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000202030006", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001020306", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002020300", +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000202030000", +"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020203", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002023003", +"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020230", +"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202", +"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002" + ], + "gasLimit" : [ + "100000000" + ], + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "1000000000000000000000000000000000000000", + "value" : [ + "0" + ] + } + } +} |