From f02eaa8cd6d2b81b081b1f0cadb6a64f90db9e0b Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 2 Mar 2019 20:06:33 +0530 Subject: [PATCH 01/97] Fix the Add randomTests, SystemOpsTests and IOandFlowTests --- mythril/laser/ethereum/instructions.py | 12 +++- ...BlockNumberDynamicJump0_AfterJumpdest.json | 37 +++++++++++ ...lockNumberDynamicJump0_AfterJumpdest3.json | 37 +++++++++++ ...ockNumberDynamicJump0_foreverOutOfGas.json | 37 +++++++++++ .../BlockNumberDynamicJump0_jumpdest0.json | 52 +++++++++++++++ .../BlockNumberDynamicJump0_jumpdest2.json | 52 +++++++++++++++ ...ockNumberDynamicJump0_withoutJumpdest.json | 37 +++++++++++ .../BlockNumberDynamicJump1.json | 37 +++++++++++ ...mberDynamicJumpInsidePushWithJumpDest.json | 37 +++++++++++ ...rDynamicJumpInsidePushWithoutJumpDest.json | 37 +++++++++++ .../BlockNumberDynamicJumpi0.json | 37 +++++++++++ .../BlockNumberDynamicJumpi1.json | 52 +++++++++++++++ .../BlockNumberDynamicJumpi1_jumpdest.json | 37 +++++++++++ .../BlockNumberDynamicJumpiAfterStop.json | 52 +++++++++++++++ ...lockNumberDynamicJumpiOutsideBoundary.json | 37 +++++++++++ ...erDynamicJumpifInsidePushWithJumpDest.json | 37 +++++++++++ ...ynamicJumpifInsidePushWithoutJumpDest.json | 37 +++++++++++ .../DyanmicJump0_outOfBoundary.json | 38 +++++++++++ .../DynamicJump0_AfterJumpdest.json | 37 +++++++++++ .../DynamicJump0_AfterJumpdest3.json | 37 +++++++++++ .../DynamicJump0_foreverOutOfGas.json | 37 +++++++++++ .../DynamicJump0_jumpdest0.json | 52 +++++++++++++++ .../DynamicJump0_jumpdest2.json | 52 +++++++++++++++ .../DynamicJump0_withoutJumpdest.json | 37 +++++++++++ .../vmIOandFlowOperations/DynamicJump1.json | 37 +++++++++++ .../DynamicJumpAfterStop.json | 52 +++++++++++++++ .../DynamicJumpInsidePushWithJumpDest.json | 37 +++++++++++ .../DynamicJumpInsidePushWithoutJumpDest.json | 37 +++++++++++ .../DynamicJumpJD_DependsOnJumps0.json | 37 +++++++++++ .../DynamicJumpJD_DependsOnJumps1.json | 52 +++++++++++++++ .../DynamicJumpPathologicalTest0.json | 52 +++++++++++++++ .../DynamicJumpPathologicalTest1.json | 37 +++++++++++ .../DynamicJumpPathologicalTest2.json | 37 +++++++++++ .../DynamicJumpPathologicalTest3.json | 37 +++++++++++ .../DynamicJumpStartWithJumpDest.json | 52 +++++++++++++++ .../DynamicJump_value1.json | 51 +++++++++++++++ .../DynamicJump_value2.json | 51 +++++++++++++++ .../DynamicJump_value3.json | 51 +++++++++++++++ .../DynamicJump_valueUnderflow.json | 37 +++++++++++ .../vmIOandFlowOperations/DynamicJumpi0.json | 37 +++++++++++ .../vmIOandFlowOperations/DynamicJumpi1.json | 52 +++++++++++++++ .../DynamicJumpi1_jumpdest.json | 37 +++++++++++ .../DynamicJumpiAfterStop.json | 52 +++++++++++++++ .../DynamicJumpiOutsideBoundary.json | 37 +++++++++++ .../DynamicJumpifInsidePushWithJumpDest.json | 37 +++++++++++ ...ynamicJumpifInsidePushWithoutJumpDest.json | 37 +++++++++++ ...fromStorageDynamicJump0_AfterJumpdest.json | 38 +++++++++++ ...romStorageDynamicJump0_AfterJumpdest3.json | 38 +++++++++++ ...omStorageDynamicJump0_foreverOutOfGas.json | 38 +++++++++++ .../JDfromStorageDynamicJump0_jumpdest0.json | 54 +++++++++++++++ .../JDfromStorageDynamicJump0_jumpdest2.json | 54 +++++++++++++++ ...omStorageDynamicJump0_withoutJumpdest.json | 38 +++++++++++ .../JDfromStorageDynamicJump1.json | 38 +++++++++++ ...rageDynamicJumpInsidePushWithJumpDest.json | 38 +++++++++++ ...eDynamicJumpInsidePushWithoutJumpDest.json | 38 +++++++++++ .../JDfromStorageDynamicJumpi0.json | 38 +++++++++++ .../JDfromStorageDynamicJumpi1.json | 54 +++++++++++++++ .../JDfromStorageDynamicJumpi1_jumpdest.json | 38 +++++++++++ .../JDfromStorageDynamicJumpiAfterStop.json | 54 +++++++++++++++ ...romStorageDynamicJumpiOutsideBoundary.json | 38 +++++++++++ ...geDynamicJumpifInsidePushWithJumpDest.json | 38 +++++++++++ ...ynamicJumpifInsidePushWithoutJumpDest.json | 38 +++++++++++ .../bad_indirect_jump1.json | 37 +++++++++++ .../bad_indirect_jump2.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/byte1.json | 51 +++++++++++++++ .../calldatacopyMemExp.json | 37 +++++++++++ .../vmIOandFlowOperations/codecopyMemExp.json | 37 +++++++++++ .../vmIOandFlowOperations/deadCode_1.json | 51 +++++++++++++++ .../dupAt51becameMload.json | 52 +++++++++++++++ .../vmIOandFlowOperations/for_loop1.json | 51 +++++++++++++++ .../vmIOandFlowOperations/for_loop2.json | 51 +++++++++++++++ .../VMTests/vmIOandFlowOperations/gas0.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/gas1.json | 52 +++++++++++++++ .../vmIOandFlowOperations/gasOverFlow.json | 37 +++++++++++ .../vmIOandFlowOperations/indirect_jump1.json | 51 +++++++++++++++ .../vmIOandFlowOperations/indirect_jump2.json | 51 +++++++++++++++ .../vmIOandFlowOperations/indirect_jump3.json | 51 +++++++++++++++ .../vmIOandFlowOperations/indirect_jump4.json | 51 +++++++++++++++ .../jump0_AfterJumpdest.json | 37 +++++++++++ .../jump0_AfterJumpdest3.json | 37 +++++++++++ .../jump0_foreverOutOfGas.json | 37 +++++++++++ .../jump0_jumpdest0.json | 52 +++++++++++++++ .../jump0_jumpdest2.json | 52 +++++++++++++++ .../jump0_outOfBoundary.json | 37 +++++++++++ .../jump0_withoutJumpdest.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/jump1.json | 37 +++++++++++ .../vmIOandFlowOperations/jumpAfterStop.json | 52 +++++++++++++++ .../jumpDynamicJumpSameDest.json | 51 +++++++++++++++ .../vmIOandFlowOperations/jumpHigh.json | 37 +++++++++++ .../jumpInsidePushWithJumpDest.json | 37 +++++++++++ .../jumpInsidePushWithoutJumpDest.json | 37 +++++++++++ .../vmIOandFlowOperations/jumpOntoJump.json | 37 +++++++++++ .../jumpTo1InstructionafterJump.json | 37 +++++++++++ ...ionafterJump_jumpdestFirstInstruction.json | 37 +++++++++++ ...umpTo1InstructionafterJump_noJumpDest.json | 37 +++++++++++ .../jumpToUint64maxPlus1.json | 37 +++++++++++ .../jumpToUintmaxPlus1.json | 37 +++++++++++ .../jumpdestBigList.json | 51 +++++++++++++++ .../VMTests/vmIOandFlowOperations/jumpi0.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/jumpi1.json | 52 +++++++++++++++ .../jumpi1_jumpdest.json | 37 +++++++++++ .../vmIOandFlowOperations/jumpiAfterStop.json | 52 +++++++++++++++ .../jumpiOutsideBoundary.json | 37 +++++++++++ .../jumpiToUint64maxPlus1.json | 37 +++++++++++ .../jumpiToUintmaxPlus1.json | 37 +++++++++++ .../jumpi_at_the_end.json | 51 +++++++++++++++ .../jumpifInsidePushWithJumpDest.json | 37 +++++++++++ .../jumpifInsidePushWithoutJumpDest.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/kv1.json | 52 +++++++++++++++ .../vmIOandFlowOperations/log1MemExp.json | 37 +++++++++++ .../loop_stacklimit_1020.json | 51 +++++++++++++++ .../loop_stacklimit_1021.json | 37 +++++++++++ .../vmIOandFlowOperations/memory1.json | 51 +++++++++++++++ .../vmIOandFlowOperations/mloadError0.json | 51 +++++++++++++++ .../vmIOandFlowOperations/mloadError1.json | 51 +++++++++++++++ .../vmIOandFlowOperations/mloadMemExp.json | 37 +++++++++++ .../mloadOutOfGasError2.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/msize0.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/msize1.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/msize2.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/msize3.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore0.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore1.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore8MemExp.json | 37 +++++++++++ .../mstore8WordToBigError.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore8_0.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore8_1.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstoreMemExp.json | 37 +++++++++++ .../mstoreWordToBigError.json | 52 +++++++++++++++ .../vmIOandFlowOperations/mstore_mload0.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/pc0.json | 51 +++++++++++++++ .../VMTests/vmIOandFlowOperations/pc1.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/pop0.json | 52 +++++++++++++++ .../VMTests/vmIOandFlowOperations/pop1.json | 37 +++++++++++ .../vmIOandFlowOperations/return1.json | 37 +++++++++++ .../vmIOandFlowOperations/return2.json | 51 +++++++++++++++ .../vmIOandFlowOperations/sha3MemExp.json | 37 +++++++++++ .../vmIOandFlowOperations/sstore_load_0.json | 54 +++++++++++++++ .../vmIOandFlowOperations/sstore_load_1.json | 53 +++++++++++++++ .../vmIOandFlowOperations/sstore_load_2.json | 37 +++++++++++ .../sstore_underflow.json | 37 +++++++++++ .../vmIOandFlowOperations/stack_loop.json | 37 +++++++++++ .../vmIOandFlowOperations/stackjump1.json | 51 +++++++++++++++ .../swapAt52becameMstore.json | 37 +++++++++++ .../VMTests/vmIOandFlowOperations/when.json | 51 +++++++++++++++ .../vmRandomTest/201503102320PYTHON.json | 37 +++++++++++ .../vmRandomTest/201503110206PYTHON.json | 37 +++++++++++ .../vmRandomTest/201503110219PYTHON.json | 37 +++++++++++ .../201503110346PYTHON_PUSH24.json | 51 +++++++++++++++ .../vmRandomTest/201503111844PYTHON.json | 51 +++++++++++++++ .../vmRandomTest/201503112218PYTHON.json | 37 +++++++++++ .../TestNameRegistrator.json | 52 +++++++++++++++ .../VMTests/vmSystemOperations/return0.json | 52 +++++++++++++++ .../VMTests/vmSystemOperations/return1.json | 52 +++++++++++++++ .../VMTests/vmSystemOperations/return2.json | 52 +++++++++++++++ .../VMTests/vmSystemOperations/suicide0.json | 58 +++++++++++++++++ .../suicideNotExistingAccount.json | 65 +++++++++++++++++++ .../suicideSendEtherToMe.json | 58 +++++++++++++++++ tests/laser/evm_testsuite/evm_test.py | 21 +++++- 159 files changed, 6927 insertions(+), 5 deletions(-) create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_withoutJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1_jumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiOutsideBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DyanmicJump0_outOfBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_withoutJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpStartWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_valueUnderflow.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1_jumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiOutsideBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGas.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_withoutJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1_jumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiOutsideBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/byte1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/calldatacopyMemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/codecopyMemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/deadCode_1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/dupAt51becameMload.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gasOverFlow.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump4.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_outOfBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_withoutJumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpDynamicJumpSameDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpHigh.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpOntoJump.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_jumpdestFirstInstruction.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUint64maxPlus1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUintmaxPlus1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpdestBigList.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1_jumpdest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiAfterStop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiOutsideBoundary.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUint64maxPlus1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUintmaxPlus1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi_at_the_end.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDest.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/kv1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/log1MemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1020.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/memory1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadMemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadOutOfGasError2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize3.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8MemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8WordToBigError.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreMemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreWordToBigError.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore_mload0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sha3MemExp.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_underflow.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stack_loop.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stackjump1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/swapAt52becameMstore.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/when.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503102320PYTHON.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110206PYTHON.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110219PYTHON.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110346PYTHON_PUSH24.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503111844PYTHON.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmRandomTest/201503112218PYTHON.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/TestNameRegistrator.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/return0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/return1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/return2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicide0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideNotExistingAccount.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideSendEtherToMe.json diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 79ab0749..33692346 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -130,6 +130,8 @@ class StateTransition(object): min_gas, max_gas = cast(Tuple[int, int], OPCODE_GAS[opcode]) global_state.mstate.min_gas_used += min_gas global_state.mstate.max_gas_used += max_gas + self.check_gas_usage_limit(global_state) + return global_state def __call__(self, func: Callable) -> Callable: @@ -1296,7 +1298,7 @@ class Instruction: try: value_to_write = ( - util.get_concrete_int(value) ^ 0xFF + util.get_concrete_int(value) % 256 ) # type: Union[int, BitVec] except TypeError: # BitVec value_to_write = Extract(7, 0, value) @@ -1368,6 +1370,7 @@ class Instruction: """ try: data = global_state.environment.active_account.storage[index] + print(data) except KeyError: data = global_state.new_bitvec("storage_" + str(index), 256) global_state.environment.active_account.storage[index] = data @@ -1612,7 +1615,10 @@ class Instruction: :param global_state: :return: """ - global_state.mstate.stack.append(global_state.mstate.pc - 1) + index = global_state.mstate.pc + program_counter = global_state.environment.code.instruction_list[index]["address"] + global_state.mstate.stack.append(program_counter) + return [global_state] @StateTransition() @@ -1622,7 +1628,7 @@ class Instruction: :param global_state: :return: """ - global_state.mstate.stack.append(global_state.new_bitvec("msize", 256)) + global_state.mstate.stack.append(global_state.mstate.memory_size) return [global_state] @StateTransition() diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest.json new file mode 100644 index 00000000..2539443a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJump0_AfterJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdestFiller.json", + "sourceHash" : "edd08521b4a9bc311f2ba99d15c867d9a98da1e9665d9b173ff85621e170e896" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600843015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600843015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest3.json new file mode 100644 index 00000000..13ff0fe4 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest3.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJump0_AfterJumpdest3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_AfterJumpdest3Filler.json", + "sourceHash" : "1e86dccd54bd74436a1bbfe11302b675761fc6138ebd1461231acd29ee97b0f0" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600b60085043015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600b60085043015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json new file mode 100644 index 00000000..a209cb69 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJump0_foreverOutOfGas" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGasFiller.json", + "sourceHash" : "0900beba73811b8aafaefadcff3a7cd9954ccb5e4986b9cf03ca44881efd4e9c" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b600060000156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b600060000156", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest0.json new file mode 100644 index 00000000..161e0f33 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest0.json @@ -0,0 +1,52 @@ +{ + "BlockNumberDynamicJump0_jumpdest0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest0Filler.json", + "sourceHash" : "80bfa0a5db107e6f083dccdd3091e35add39a4eaac4a8757de8a3e4008c5d646" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600743015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013869", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600743015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600743015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest2.json new file mode 100644 index 00000000..56700e28 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest2.json @@ -0,0 +1,52 @@ +{ + "BlockNumberDynamicJump0_jumpdest2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_jumpdest2Filler.json", + "sourceHash" : "e86a87e0b5cde7d47f1e5dc295600ecc60b7344b3fb4ad64609d6b87fae642f8" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600a60085043015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013864", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a60085043015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a60085043015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_withoutJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_withoutJumpdest.json new file mode 100644 index 00000000..3f9f828e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_withoutJumpdest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJump0_withoutJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_withoutJumpdestFiller.json", + "sourceHash" : "6f1fc4a9e5dff3e5d3071c576aba5b2ee1f30d7dcace92e6c6d230cfd415efd7" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360074301566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360074301566001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump1.json new file mode 100644 index 00000000..4109f530 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump1.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump1Filler.json", + "sourceHash" : "88e43b5985cc4dfbcbc8476c570157e6e7bc0ee0cb3609e9e9f3dd9aa2a3a528" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x620fffff620fffff01430156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x620fffff620fffff01430156", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithJumpDest.json new file mode 100644 index 00000000..13c6b0c7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithJumpDestFiller.json", + "sourceHash" : "ca0f21a5f52a8d4f2d6e1eed650f68d5f8f40e567cf17984aacc228adfa578ab" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6004430156655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6004430156655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..fc904df5 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "183a4ce2d0f208630db92539aaf4e38fc3025b44a2842e19e39e956465449fe5" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600543015661eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600543015661eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi0.json new file mode 100644 index 00000000..d0b67dd9 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi0.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpi0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpi0Filler.json", + "sourceHash" : "620bba922f5a1732f512d726a26e71b09d3837018a66a9aacb581b212a4f4b13" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600160094301576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600160094301576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1.json new file mode 100644 index 00000000..5c404de0 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1.json @@ -0,0 +1,52 @@ +{ + "BlockNumberDynamicJumpi1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpi1Filler.json", + "sourceHash" : "91d6fe3848fbdafff10b7bd503d560f2c614d6b53ed16b51821d3026f4a3a544" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600060094301576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013862", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600060094301576001600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600060094301576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1_jumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1_jumpdest.json new file mode 100644 index 00000000..f6eca581 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi1_jumpdest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpi1_jumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpi1_jumpdestFiller.json", + "sourceHash" : "420810639c740487f7b8d18b29f28dcfb7d762b1aa4aa9b9f8b91928da66a539" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236001600a43015760015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236001600a43015760015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiAfterStop.json new file mode 100644 index 00000000..8c080a3a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiAfterStop.json @@ -0,0 +1,52 @@ +{ + "BlockNumberDynamicJumpiAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpiAfterStopFiller.json", + "sourceHash" : "7331cec587701bf695329ad94c7e62963827209faffac3b24eb59341ccb1a925" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600160084301570060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013864", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600160084301570060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600160084301570060015b6002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiOutsideBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiOutsideBoundary.json new file mode 100644 index 00000000..102f95d0 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpiOutsideBoundary.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpiOutsideBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpiOutsideBoundaryFiller.json", + "sourceHash" : "db80ec0400be086e2a316a91ee7a5f87db06ff6a5b0ad27a50ba692049a54b1c" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04301576002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04301576002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithJumpDest.json new file mode 100644 index 00000000..aa28e7f2 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpifInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithJumpDestFiller.json", + "sourceHash" : "4b52bc3a45a966d0032eb01b3fdb8a225af48fa4f5a017b5dff3d4d88d710337" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016006430157655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016006430157655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..f41afd94 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "BlockNumberDynamicJumpifInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpifInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "3fccd0c56ebfd40dea69fec03d009967a80ddf93e9a68af81efd2d1645e27fcb" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600743015761eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600743015761eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DyanmicJump0_outOfBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DyanmicJump0_outOfBoundary.json new file mode 100644 index 00000000..023fa033 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DyanmicJump0_outOfBoundary.json @@ -0,0 +1,38 @@ +{ + "DyanmicJump0_outOfBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DyanmicJump0_outOfBoundaryFiller.json", + "sourceHash" : "a2ae635e97f7381a5af1ea432d210faf19f4f84e8e0e6874bd48005674bfea92" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600760005401566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600760005401566001600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest.json new file mode 100644 index 00000000..df8609cf --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest.json @@ -0,0 +1,37 @@ +{ + "DynamicJump0_AfterJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_AfterJumpdestFiller.json", + "sourceHash" : "605f607251cd4a7c73bd7c814edcada6a9008fcd2896af2caf371beb31db196b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360086003015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360086003015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3.json new file mode 100644 index 00000000..71f34d96 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3.json @@ -0,0 +1,37 @@ +{ + "DynamicJump0_AfterJumpdest3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3Filler.json", + "sourceHash" : "b7367314ce66b1a937c05550ac901971b5850d2a0ef03acf1feb4d6c9f38925d" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600b6008506003015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600b6008506003015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json new file mode 100644 index 00000000..dea2379c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json @@ -0,0 +1,37 @@ +{ + "DynamicJump0_foreverOutOfGas" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_foreverOutOfGasFiller.json", + "sourceHash" : "68b687a344b0f44d7459e095f05f6b302ee3f5d15b3c3e7765d5642fb1f46689" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b600060000156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b600060000156", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest0.json new file mode 100644 index 00000000..3a11d95c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest0.json @@ -0,0 +1,52 @@ +{ + "DynamicJump0_jumpdest0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_jumpdest0Filler.json", + "sourceHash" : "3ab9d036e3e345909b19022f4c3b80d081d214eb5c79b8e94e0f2c660ab01ec7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360076003015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360076003015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360076003015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest2.json new file mode 100644 index 00000000..48d81262 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_jumpdest2.json @@ -0,0 +1,52 @@ +{ + "DynamicJump0_jumpdest2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_jumpdest2Filler.json", + "sourceHash" : "a7e9d9f046151930ef4b51b8dacce5304ce74c3f5ead80f1e52f783b1a704378" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600a6008506003015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013863", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a6008506003015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a6008506003015660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_withoutJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_withoutJumpdest.json new file mode 100644 index 00000000..2a727296 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_withoutJumpdest.json @@ -0,0 +1,37 @@ +{ + "DynamicJump0_withoutJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_withoutJumpdestFiller.json", + "sourceHash" : "84c524e0cafc2ddcebdef720e46a23d10061f4a35bb06bfe7bdfe444990593a6" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236007600301566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236007600301566001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump1.json new file mode 100644 index 00000000..905b3d77 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump1.json @@ -0,0 +1,37 @@ +{ + "DynamicJump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump1Filler.json", + "sourceHash" : "2369bac56afc1e0946f608c52027fbc88faf3844cdc2fa46954a0916221b8432" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x620fffff620fffff0160030156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x620fffff620fffff0160030156", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpAfterStop.json new file mode 100644 index 00000000..127a2b9c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpAfterStop.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpAfterStopFiller.json", + "sourceHash" : "5ba8a9cb65319cdc8e574e0eb59695b55158e6d723945bac3b96573a576a86a8" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6008600101560060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6008600101560060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6008600101560060015b6002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDest.json new file mode 100644 index 00000000..0975ad3d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDestFiller.json", + "sourceHash" : "3f3586292e12e696029f38f833fe8c7cea86a0e7cda83c0cbe783aa2c3b22b0c" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600460030156655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600460030156655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..cfe0d21c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "4e320bace2f65884d59f95dbbba6e4f9aea39e243bffd309be9bb6c5a3c1bedb" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60056003015661eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60056003015661eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0.json new file mode 100644 index 00000000..ebe71f5a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpJD_DependsOnJumps0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0Filler.json", + "sourceHash" : "e96143bec9697fb0d565026f5fcc5ed70833bf89eb8c63aa87e0155b4e61d8f4" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6009436006575b566001", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6009436006575b566001", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps1.json new file mode 100644 index 00000000..7768209d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps1.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpJD_DependsOnJumps1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps1Filler.json", + "sourceHash" : "853f3f35881b9db63508e68d34cf87a1a3697fdc969821c0659462242d859c2b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600a436006575b5660015b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01385e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a436006575b5660015b6001600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a436006575b5660015b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest0.json new file mode 100644 index 00000000..975b1619 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest0.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpPathologicalTest0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest0Filler.json", + "sourceHash" : "6862ac2a8fad0b3c043493fcd9c9a7e8a549c9f3ef34019ac0d7bcfd096a8040" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x04", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x435660615b4343025660615b60615b5b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01385d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x435660615b4343025660615b60615b5b5b6001600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x435660615b4343025660615b60615b5b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest1.json new file mode 100644 index 00000000..9c60176a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest1.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpPathologicalTest1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest1Filler.json", + "sourceHash" : "dfbad553b0e28f37f6a5d72740e2ae6bf17ce1b19c62caf2cc2a99c0d1d84e05" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x04", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x435660615b4343025660615b60615b605b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x435660615b4343025660615b60615b605b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest2.json new file mode 100644 index 00000000..96783591 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest2.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpPathologicalTest2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest2Filler.json", + "sourceHash" : "957bc609a0322452da86a59c96e7eea17c5463dcd7bad6ed97b57c6460a90b80" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x04", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x435631615b60615b60615b606001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x435631615b60615b60615b606001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest3.json new file mode 100644 index 00000000..3e3317ef --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest3.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpPathologicalTest3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest3Filler.json", + "sourceHash" : "a906b3dcb41da1cdacb67bdf49111ecd2bdaab0e3584dbd3993ef0f0555766f6" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x07", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x435631615b60615b60615b606001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x435631615b60615b60615b606001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpStartWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpStartWithJumpDest.json new file mode 100644 index 00000000..72b3d6be --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpStartWithJumpDest.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpStartWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpStartWithJumpDestFiller.json", + "sourceHash" : "4fb19acd65703dce630cb655f52e98d2de72d8a790d53b895d0e7bce603d4166" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b586000555960115758600052596000575b58600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x011126", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b586000555960115758600052596000575b58600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x12" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b586000555960115758600052596000575b58600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value1.json new file mode 100644 index 00000000..003998fb --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value1.json @@ -0,0 +1,51 @@ +{ + "DynamicJump_value1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump_value1Filler.json", + "sourceHash" : "20503c4d21019e3d9d87b95365a0d0417fb7e163265f938d6e3f685377a2c5da" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x08" + }, + "gas" : "0x01867a", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000001", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value2.json new file mode 100644 index 00000000..fafb704f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value2.json @@ -0,0 +1,51 @@ +{ + "DynamicJump_value2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump_value2Filler.json", + "sourceHash" : "00631169ba52dbbd3d7ac8529dd960c6b297226c0f177ee3e0ef8bd202b4b1ff" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x12" + }, + "gas" : "0x01867c", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000002", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value3.json new file mode 100644 index 00000000..cbdcc414 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_value3.json @@ -0,0 +1,51 @@ +{ + "DynamicJump_value3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump_value3Filler.json", + "sourceHash" : "a1477eeb656e1f4d09c07f020a088cc099f6661fce88f137754b1d45550d7218" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x1b" + }, + "gas" : "0x01867e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000003", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_valueUnderflow.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_valueUnderflow.json new file mode 100644 index 00000000..99ea9ce4 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump_valueUnderflow.json @@ -0,0 +1,37 @@ +{ + "DynamicJump_valueUnderflow" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump_valueUnderflowFiller.json", + "sourceHash" : "37f012edfeaa13e4819617af0e8dc2fd71d738a2463b1f61bfd86de0ef980f1b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b505050600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x1b" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016002600334565b5050600052596000f35b50600052596000f35b505050600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi0.json new file mode 100644 index 00000000..123d0e6a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi0.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpi0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpi0Filler.json", + "sourceHash" : "394cae3e06d120cc1a5df5e14cfae3598d62e1fefa06dce4055c6ff59c367b63" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360016009600301576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360016009600301576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1.json new file mode 100644 index 00000000..70e8c31b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpi1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpi1Filler.json", + "sourceHash" : "31d323d1c24dd2c2ea5a4e18fd0765bfa1be189add7e395b2679bf5a98e492ab" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360006009600301576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013861", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360006009600301576001600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360006009600301576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1_jumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1_jumpdest.json new file mode 100644 index 00000000..82c56f06 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1_jumpdest.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpi1_jumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpi1_jumpdestFiller.json", + "sourceHash" : "fb4060a7f68c0f3ad9643dcfc93fa90ea0fe6123e65499ae65f400e22db20bcc" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236001600a6003015760015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236001600a6003015760015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiAfterStop.json new file mode 100644 index 00000000..1e9d80bf --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiAfterStop.json @@ -0,0 +1,52 @@ +{ + "DynamicJumpiAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpiAfterStopFiller.json", + "sourceHash" : "d61d45e9d5ea3e13d2a8a33965c9c620207156e0b4baf2dfed9a0288c7e8053b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016008600301570060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013863", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016008600301570060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016008600301570060015b6002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiOutsideBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiOutsideBoundary.json new file mode 100644 index 00000000..40a1e452 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpiOutsideBoundary.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpiOutsideBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpiOutsideBoundaryFiller.json", + "sourceHash" : "d550aa41047204857f27b7a80a1309520f3e59b41a87ef3e40492032706e5a88" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0600301576002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0600301576002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithJumpDest.json new file mode 100644 index 00000000..810ea273 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpifInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpifInsidePushWithJumpDestFiller.json", + "sourceHash" : "05f764377385769e93afe47dbc0293921c211b4e68afce30f18cba4bb5955420" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600660030157655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600660030157655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..5882ad02 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "DynamicJumpifInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "cadedb13e141e3b7bf1f0763cc831dace3ff150fc623e81fb00e798168d01188" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600160076003015761eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600160076003015761eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest.json new file mode 100644 index 00000000..1d587dbe --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJump0_AfterJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdestFiller.json", + "sourceHash" : "06126bb58e44948750e412ea81a3140fcc72b63acec0090939706f3ceb403ae8" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236008600054015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236008600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest3.json new file mode 100644 index 00000000..045cdac5 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest3.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJump0_AfterJumpdest3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_AfterJumpdest3Filler.json", + "sourceHash" : "52880726a50d86ffdaea78e4a5d3293643688543eea049172fbf51e564f28f5b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600b600850600054015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600b600850600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGas.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGas.json new file mode 100644 index 00000000..a487881c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGas.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJump0_foreverOutOfGas" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGasFiller.json", + "sourceHash" : "a3046ce1b7f78c109aa36c29db004850ad5b3b4129d9085849b7af04b719826c" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b600060000156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b600060000156", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest0.json new file mode 100644 index 00000000..bb410e5f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest0.json @@ -0,0 +1,54 @@ +{ + "JDfromStorageDynamicJump0_jumpdest0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest0Filler.json", + "sourceHash" : "2f836ba88951147677580e5de7d8d40b0ca72938894aa351096945d7962c8f62" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236007600054015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013836", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236007600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04", + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236007600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest2.json new file mode 100644 index 00000000..5f8a9dea --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest2.json @@ -0,0 +1,54 @@ +{ + "JDfromStorageDynamicJump0_jumpdest2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_jumpdest2Filler.json", + "sourceHash" : "efe088c5366793bcb3339225486608b15750524274baf8d5f9f592c0d5e327f2" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600a600850600054015660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013831", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a600850600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04", + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a600850600054015660015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_withoutJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_withoutJumpdest.json new file mode 100644 index 00000000..7fcf7de8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_withoutJumpdest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJump0_withoutJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump0_withoutJumpdestFiller.json", + "sourceHash" : "696ced07844f15bee009a7c294048b5bf531923787279c19bf1c3150a46bf0ff" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600760005401566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600760005401566001600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump1.json new file mode 100644 index 00000000..1d1f0313 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump1.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJump1Filler.json", + "sourceHash" : "bf061c0eb83d11c310f7ec309e56c3629f715727b41cc0e0772991060404cfc9" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x620fffff620fffff016000540156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x620fffff620fffff016000540156", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithJumpDest.json new file mode 100644 index 00000000..7c86c9d6 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithJumpDest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithJumpDestFiller.json", + "sourceHash" : "561a67bc9db1011fb26151b03adcc53b2f4f55e03292c1e98e3361250c87d38a" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60046000540156655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60046000540156655b6001600155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..a9dbbc36 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "53a491adcc7da05748ad36809954552784007b884cd960e05ebb07a2ddd0452b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6005600054015661eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6005600054015661eeff", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi0.json new file mode 100644 index 00000000..6f32f339 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi0.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpi0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpi0Filler.json", + "sourceHash" : "14e786db1b2df2c2a40be1a80c61baec311572eb481a3afd1b31fb95a3ad937d" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236001600960005401576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236001600960005401576001600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1.json new file mode 100644 index 00000000..e20bedfd --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1.json @@ -0,0 +1,54 @@ +{ + "JDfromStorageDynamicJumpi1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpi1Filler.json", + "sourceHash" : "f90389bdfe2c1600f16db3b5ff8289b55a9f3d2c56dd18403c4e636440a98a9d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236000600960005401576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01382f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236000600960005401576001600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04", + "0x02" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236000600960005401576001600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1_jumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1_jumpdest.json new file mode 100644 index 00000000..e7eec6f7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpi1_jumpdest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpi1_jumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpi1_jumpdestFiller.json", + "sourceHash" : "cc7eadaee4927a2753204e40d7028ae1ed3e1ef4c9a2e8a79460a3e07f5bcafe" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236001600a600054015760015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236001600a600054015760015b600255", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfterStop.json new file mode 100644 index 00000000..7c7b889a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfterStop.json @@ -0,0 +1,54 @@ +{ + "JDfromStorageDynamicJumpiAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfterStopFiller.json", + "sourceHash" : "80d903064c1050cf1a2e527b8938e610e77822d55c83cf4a07e18586baa0bec1" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600860005401570060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013831", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600860005401570060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04", + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600860005401570060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiOutsideBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiOutsideBoundary.json new file mode 100644 index 00000000..0b13b790 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiOutsideBoundary.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpiOutsideBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpiOutsideBoundaryFiller.json", + "sourceHash" : "3c7f35eb2fe3c2ed05679b25f89e81e50fa959c8a665cf4545552f75a3b7140b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff060005401576002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff060005401576002600355", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithJumpDest.json new file mode 100644 index 00000000..1571718b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithJumpDest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpifInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithJumpDestFiller.json", + "sourceHash" : "f15ca2a706c969bb0f9f4b7101efd666eebae5520f893a586a7a529b0dc7d4d8" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600160066000540157655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600160066000540157655b6001600155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..63875783 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json @@ -0,0 +1,38 @@ +{ + "JDfromStorageDynamicJumpifInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/JDfromStorageDynamicJumpifInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "561fed985eda1bbc4448ad363f6fa69a1d1b503d9d7e0017bcd49aaaf916f333" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x02", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016007600054015761eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016007600054015761eeff", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump1.json new file mode 100644 index 00000000..85da085e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump1.json @@ -0,0 +1,37 @@ +{ + "bad_indirect_jump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/bad_indirect_jump1Filler.json", + "sourceHash" : "15744a7158d6982822dc8a0c272c329f8dfdf93810e8f2f3f468a56db9bd2d90" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x601b602502565b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x601b602502565b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump2.json new file mode 100644 index 00000000..2618fdbb --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump2.json @@ -0,0 +1,37 @@ +{ + "bad_indirect_jump2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/bad_indirect_jump2Filler.json", + "sourceHash" : "6dd2730ab6f27b43eead1633f104f5d60d6a98fa7c81d5a8ba0d2f6434706813" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016003600302576000600056", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016003600302576000600056", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/byte1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/byte1.json new file mode 100644 index 00000000..cfa52995 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/byte1.json @@ -0,0 +1,51 @@ +{ + "byte1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/byte1Filler.json", + "sourceHash" : "4bbf3058007fbacf83926bd908a1f886cb4403aa10a95030f2da18e1ad68707b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7f112233445566778899001122334455667788990011223344556677889900aabb60001a7f112233445566778899001122334455667788990011223344556677889900aabb60011a7f112233445566778899001122334455667788990011223344556677889900aabb60021a7f112233445566778899001122334455667788990011223344556677889900aabb60031a7f112233445566778899001122334455667788990011223344556677889900aabb60041a7f112233445566778899001122334455667788990011223344556677889900aabb60051a7f112233445566778899001122334455667788990011223344556677889900aabb60061a7f112233445566778899001122334455667788990011223344556677889900aabb60071a7f112233445566778899001122334455667788990011223344556677889900aabb60081a7f112233445566778899001122334455667788990011223344556677889900aabb60091a7f112233445566778899001122334455667788990011223344556677889900aabb600a1a7f112233445566778899001122334455667788990011223344556677889900aabb600b1a7f112233445566778899001122334455667788990011223344556677889900aabb600c1a7f112233445566778899001122334455667788990011223344556677889900aabb600d1a7f112233445566778899001122334455667788990011223344556677889900aabb600e1a7f112233445566778899001122334455667788990011223344556677889900aabb600f1a7f112233445566778899001122334455667788990011223344556677889900aabb60101a7f112233445566778899001122334455667788990011223344556677889900aabb60111a7f112233445566778899001122334455667788990011223344556677889900aabb60121a7f112233445566778899001122334455667788990011223344556677889900aabb60131a7f112233445566778899001122334455667788990011223344556677889900aabb60141a7f112233445566778899001122334455667788990011223344556677889900aabb60151a7f112233445566778899001122334455667788990011223344556677889900aabb60161a7f112233445566778899001122334455667788990011223344556677889900aabb60171a7f112233445566778899001122334455667788990011223344556677889900aabb60181a7f112233445566778899001122334455667788990011223344556677889900aabb60191a7f112233445566778899001122334455667788990011223344556677889900aabb601a1a7f112233445566778899001122334455667788990011223344556677889900aabb601b1a7f112233445566778899001122334455667788990011223344556677889900aabb601c1a7f112233445566778899001122334455667788990011223344556677889900aabb601d1a7f112233445566778899001122334455667788990011223344556677889900aabb601e1a7f112233445566778899001122334455667788990011223344556677889900aabb601f1a7f112233445566778899001122334455667788990011223344556677889900aabb60201a7f112233445566778899001122334455667788990011223344556677889900aabb6107de1a6000600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x0171e0", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7f112233445566778899001122334455667788990011223344556677889900aabb60001a7f112233445566778899001122334455667788990011223344556677889900aabb60011a7f112233445566778899001122334455667788990011223344556677889900aabb60021a7f112233445566778899001122334455667788990011223344556677889900aabb60031a7f112233445566778899001122334455667788990011223344556677889900aabb60041a7f112233445566778899001122334455667788990011223344556677889900aabb60051a7f112233445566778899001122334455667788990011223344556677889900aabb60061a7f112233445566778899001122334455667788990011223344556677889900aabb60071a7f112233445566778899001122334455667788990011223344556677889900aabb60081a7f112233445566778899001122334455667788990011223344556677889900aabb60091a7f112233445566778899001122334455667788990011223344556677889900aabb600a1a7f112233445566778899001122334455667788990011223344556677889900aabb600b1a7f112233445566778899001122334455667788990011223344556677889900aabb600c1a7f112233445566778899001122334455667788990011223344556677889900aabb600d1a7f112233445566778899001122334455667788990011223344556677889900aabb600e1a7f112233445566778899001122334455667788990011223344556677889900aabb600f1a7f112233445566778899001122334455667788990011223344556677889900aabb60101a7f112233445566778899001122334455667788990011223344556677889900aabb60111a7f112233445566778899001122334455667788990011223344556677889900aabb60121a7f112233445566778899001122334455667788990011223344556677889900aabb60131a7f112233445566778899001122334455667788990011223344556677889900aabb60141a7f112233445566778899001122334455667788990011223344556677889900aabb60151a7f112233445566778899001122334455667788990011223344556677889900aabb60161a7f112233445566778899001122334455667788990011223344556677889900aabb60171a7f112233445566778899001122334455667788990011223344556677889900aabb60181a7f112233445566778899001122334455667788990011223344556677889900aabb60191a7f112233445566778899001122334455667788990011223344556677889900aabb601a1a7f112233445566778899001122334455667788990011223344556677889900aabb601b1a7f112233445566778899001122334455667788990011223344556677889900aabb601c1a7f112233445566778899001122334455667788990011223344556677889900aabb601d1a7f112233445566778899001122334455667788990011223344556677889900aabb601e1a7f112233445566778899001122334455667788990011223344556677889900aabb601f1a7f112233445566778899001122334455667788990011223344556677889900aabb60201a7f112233445566778899001122334455667788990011223344556677889900aabb6107de1a6000600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7f112233445566778899001122334455667788990011223344556677889900aabb60001a7f112233445566778899001122334455667788990011223344556677889900aabb60011a7f112233445566778899001122334455667788990011223344556677889900aabb60021a7f112233445566778899001122334455667788990011223344556677889900aabb60031a7f112233445566778899001122334455667788990011223344556677889900aabb60041a7f112233445566778899001122334455667788990011223344556677889900aabb60051a7f112233445566778899001122334455667788990011223344556677889900aabb60061a7f112233445566778899001122334455667788990011223344556677889900aabb60071a7f112233445566778899001122334455667788990011223344556677889900aabb60081a7f112233445566778899001122334455667788990011223344556677889900aabb60091a7f112233445566778899001122334455667788990011223344556677889900aabb600a1a7f112233445566778899001122334455667788990011223344556677889900aabb600b1a7f112233445566778899001122334455667788990011223344556677889900aabb600c1a7f112233445566778899001122334455667788990011223344556677889900aabb600d1a7f112233445566778899001122334455667788990011223344556677889900aabb600e1a7f112233445566778899001122334455667788990011223344556677889900aabb600f1a7f112233445566778899001122334455667788990011223344556677889900aabb60101a7f112233445566778899001122334455667788990011223344556677889900aabb60111a7f112233445566778899001122334455667788990011223344556677889900aabb60121a7f112233445566778899001122334455667788990011223344556677889900aabb60131a7f112233445566778899001122334455667788990011223344556677889900aabb60141a7f112233445566778899001122334455667788990011223344556677889900aabb60151a7f112233445566778899001122334455667788990011223344556677889900aabb60161a7f112233445566778899001122334455667788990011223344556677889900aabb60171a7f112233445566778899001122334455667788990011223344556677889900aabb60181a7f112233445566778899001122334455667788990011223344556677889900aabb60191a7f112233445566778899001122334455667788990011223344556677889900aabb601a1a7f112233445566778899001122334455667788990011223344556677889900aabb601b1a7f112233445566778899001122334455667788990011223344556677889900aabb601c1a7f112233445566778899001122334455667788990011223344556677889900aabb601d1a7f112233445566778899001122334455667788990011223344556677889900aabb601e1a7f112233445566778899001122334455667788990011223344556677889900aabb601f1a7f112233445566778899001122334455667788990011223344556677889900aabb60201a7f112233445566778899001122334455667788990011223344556677889900aabb6107de1a6000600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/calldatacopyMemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/calldatacopyMemExp.json new file mode 100644 index 00000000..b93a6f4d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/calldatacopyMemExp.json @@ -0,0 +1,37 @@ +{ + "calldatacopyMemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/calldatacopyMemExpFiller.json", + "sourceHash" : "fcf33988ecf7e66eae80382111d1128eb302e201be169ca20b306eac49231142" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60ff630fffffff630fffffff37", + "data" : "0x", + "gas" : "0x01f4153d80", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60ff630fffffff630fffffff37", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/codecopyMemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/codecopyMemExp.json new file mode 100644 index 00000000..67f31147 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/codecopyMemExp.json @@ -0,0 +1,37 @@ +{ + "codecopyMemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/codecopyMemExpFiller.json", + "sourceHash" : "baf738ce30cb457d16aa2f71f866ce00ddb998371757f2c6a30a5d1ca3a9e135" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60ff630fffffff630fffffff39", + "data" : "0x", + "gas" : "0x01f4153d80", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60ff630fffffff630fffffff39", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/deadCode_1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/deadCode_1.json new file mode 100644 index 00000000..808ff7a8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/deadCode_1.json @@ -0,0 +1,51 @@ +{ + "deadCode_1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/deadCode_1Filler.json", + "sourceHash" : "110e1eaddae6dda0225d4f4b430da33494473d9ec10d765e7a5324d3e1ab26c8" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600053596000f300000000000000005b00", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01868f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0100000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600053596000f300000000000000005b00", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600053596000f300000000000000005b00", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/dupAt51becameMload.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/dupAt51becameMload.json new file mode 100644 index 00000000..8d32a56d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/dupAt51becameMload.json @@ -0,0 +1,52 @@ +{ + "dupAt51becameMload" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/dupAt51becameMloadFiller.json", + "sourceHash" : "28d2da26fb721ff16c42b1d398e7410f85560c3373bcc0a424ee1d025bf25ba6" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600260035155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013871", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600260035155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600260035155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop1.json new file mode 100644 index 00000000..f6601559 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop1.json @@ -0,0 +1,51 @@ +{ + "for_loop1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/for_loop1Filler.json", + "sourceHash" : "5e12e078316618a30275a5c133a960d17d242cc3726855a805c112193d39a59e" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600a6080525b6000608051111560265760a0516080510160a0526001608051036080526005565b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x018351", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a6080525b6000608051111560265760a0516080510160a0526001608051036080526005565b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a6080525b6000608051111560265760a0516080510160a0526001608051036080526005565b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop2.json new file mode 100644 index 00000000..dbd6907a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/for_loop2.json @@ -0,0 +1,51 @@ +{ + "for_loop2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/for_loop2Filler.json", + "sourceHash" : "2764d5106d8f416d7f03ab65334b580f66eff1a74fa4c3fc4b2488dbb621d3c1" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006080525b600a608051101560265760a0516080510160a0526001608051016080526005565b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x018351", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006080525b600a608051101560265760a0516080510160a0526001608051016080526005565b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006080525b600a608051101560265760a0516080510160a0526001608051016080526005565b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas0.json new file mode 100644 index 00000000..f8f914a8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas0.json @@ -0,0 +1,52 @@ +{ + "gas0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/gas0Filler.json", + "sourceHash" : "344499133ac967decfa379dd507e6df8c81e13b014db2676d943cdd2ed3c09c6" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x64ffffffffff60005261eeee605a525a600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01385d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee605a525a600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x018680" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee605a525a600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas1.json new file mode 100644 index 00000000..cb828c9e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gas1.json @@ -0,0 +1,52 @@ +{ + "gas1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/gas1Filler.json", + "sourceHash" : "158673d626e8f5b04cbad00e6bcf8bce2a081b61bf98ca0ad11b78e52921444a" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5a600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01387b", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5a600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01869e" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5a600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gasOverFlow.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gasOverFlow.json new file mode 100644 index 00000000..bcfb11d3 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/gasOverFlow.json @@ -0,0 +1,37 @@ +{ + "gasOverFlow" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/gasOverFlowFiller.json", + "sourceHash" : "01dd61c063b45f54e62e912f6711a3c04bcaba16f40890da37774adedcf5d201" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60035b600190038060025768010000000000000016565b63badf000d60115500", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60035b600190038060025768010000000000000016565b63badf000d60115500", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump1.json new file mode 100644 index 00000000..31c1aebf --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump1.json @@ -0,0 +1,51 @@ +{ + "indirect_jump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/indirect_jump1Filler.json", + "sourceHash" : "33d6b4fa4d999fa02f0b584e925eef1e0b1f55bfe6bd8ba3bd0339ab20739a34" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600460030156005b6001600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01867d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000001", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600460030156005b6001600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600460030156005b6001600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump2.json new file mode 100644 index 00000000..2b604616 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump2.json @@ -0,0 +1,51 @@ +{ + "indirect_jump2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/indirect_jump2Filler.json", + "sourceHash" : "74d76db6a1761e44af7dea37c2ed941aac2add09cff11950033033cbe6f83248" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600860060156005b6001600052005b6002600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01867d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000002", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600860060156005b6001600052005b6002600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600860060156005b6001600052005b6002600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump3.json new file mode 100644 index 00000000..a8bba4d1 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump3.json @@ -0,0 +1,51 @@ +{ + "indirect_jump3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/indirect_jump3Filler.json", + "sourceHash" : "1ca405a29132ed02b16a4e4f1d869eb73904f23759d971c3a7e287260fa13f7b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600460050157005b6001600052596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x018678", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000001", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600460050157005b6001600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600460050157005b6001600052596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump4.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump4.json new file mode 100644 index 00000000..88012cb2 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/indirect_jump4.json @@ -0,0 +1,51 @@ +{ + "indirect_jump4" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/indirect_jump4Filler.json", + "sourceHash" : "bec771ce98d114d7dacd0f1f33426b85e6092d65bfd73945ea07831737a0d310" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006007600501576001600052005b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01867e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006007600501576001600052005b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006007600501576001600052005b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest.json new file mode 100644 index 00000000..9cf74c89 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest.json @@ -0,0 +1,37 @@ +{ + "jump0_AfterJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_AfterJumpdestFiller.json", + "sourceHash" : "8e933f0185d188f6eeb002d4ac8dace70a34a196e4c59932957eaac4cef27849" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360085660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360085660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest3.json new file mode 100644 index 00000000..b7e9376a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest3.json @@ -0,0 +1,37 @@ +{ + "jump0_AfterJumpdest3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_AfterJumpdest3Filler.json", + "sourceHash" : "dc15eff9141416358f3f9960ef23b930d70b7cb8d3e13d7d5b6832954605d062" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600b6008505660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600b6008505660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json new file mode 100644 index 00000000..54402a26 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json @@ -0,0 +1,37 @@ +{ + "jump0_foreverOutOfGas" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_foreverOutOfGasFiller.json", + "sourceHash" : "06656a40346ccda59a2d1852d9bb59447d34fb9eb80706e378c5a067e337a080" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b600056", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5b600056", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest0.json new file mode 100644 index 00000000..b17ec731 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest0.json @@ -0,0 +1,52 @@ +{ + "jump0_jumpdest0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_jumpdest0Filler.json", + "sourceHash" : "4bf0cfbeda98acdd577972c6a7abcd20f60ab1b48328ce3f804e3cefa7c77bdb" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360075660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01386e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360075660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360075660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest2.json new file mode 100644 index 00000000..3c482fd5 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_jumpdest2.json @@ -0,0 +1,52 @@ +{ + "jump0_jumpdest2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_jumpdest2Filler.json", + "sourceHash" : "3aba479e0b0de29b2fac29ac62deb3e37d9fff0a79ed3a1953a7afa7e19b17da" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6023600a6008505660015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013869", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a6008505660015b600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6023600a6008505660015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_outOfBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_outOfBoundary.json new file mode 100644 index 00000000..aa19f171 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_outOfBoundary.json @@ -0,0 +1,37 @@ +{ + "jump0_outOfBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_outOfBoundaryFiller.json", + "sourceHash" : "9442ba4b2e4625b3ba5d7a3c43a5c1bcbb0f71fb8977d9cb291a58f956e5d014" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236007566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236007566001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_withoutJumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_withoutJumpdest.json new file mode 100644 index 00000000..29b82335 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_withoutJumpdest.json @@ -0,0 +1,37 @@ +{ + "jump0_withoutJumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_withoutJumpdestFiller.json", + "sourceHash" : "4023b9b32fabb7baeb154e319422cc24e852c858eb124713508a241df86f3969" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236007566001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236007566001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump1.json new file mode 100644 index 00000000..1d5fd1c2 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump1.json @@ -0,0 +1,37 @@ +{ + "jump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump1Filler.json", + "sourceHash" : "c86900065dc3ca2743c247f2c7f305795833184ab64acf0c6911a899533ab628" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x620fffff620fffff0156", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x620fffff620fffff0156", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpAfterStop.json new file mode 100644 index 00000000..ce4cc7e4 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpAfterStop.json @@ -0,0 +1,52 @@ +{ + "jumpAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpAfterStopFiller.json", + "sourceHash" : "1527b83fd9a930436902b171302c40812a33a035bf148e5c40f362e811b1ad54" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6006560060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01386e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6006560060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6006560060015b6002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpDynamicJumpSameDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpDynamicJumpSameDest.json new file mode 100644 index 00000000..b7352e40 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpDynamicJumpSameDest.json @@ -0,0 +1,51 @@ +{ + "jumpDynamicJumpSameDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpDynamicJumpSameDestFiller.json", + "sourceHash" : "c1d46387eefa48a995ad56844ced0803c7e2441369d569c7669933b1ebecc2c8" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6002600401565b600360005260206000f3600656", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01867c", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000003", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6002600401565b600360005260206000f3600656", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6002600401565b600360005260206000f3600656", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpHigh.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpHigh.json new file mode 100644 index 00000000..d8c7e942 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpHigh.json @@ -0,0 +1,37 @@ +{ + "jumpHigh" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpHighFiller.json", + "sourceHash" : "a7725bef6c1ff691ae5ad3b73c3b44a6d16f9c9b1c0e57671d7ff59fe9ac9800" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x630fffffff565b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x630fffffff565b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithJumpDest.json new file mode 100644 index 00000000..f873da68 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "jumpInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpInsidePushWithJumpDestFiller.json", + "sourceHash" : "d200f4e72a16a6960609912d97797b467afb3a98c1eef6f9eed2006c4111a7f3" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600456655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600456655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..e262064e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "jumpInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "451d199b9c77c3a3297bb20ba2a01c238e984283e3690b22c9614121c878d8ec" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60055661eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60055661eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpOntoJump.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpOntoJump.json new file mode 100644 index 00000000..fa835041 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpOntoJump.json @@ -0,0 +1,37 @@ +{ + "jumpOntoJump" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpOntoJumpFiller.json", + "sourceHash" : "b7af74ccb70e4242810a2f47181f0c95ee1b9558385cff3a33896f29c7775d7e" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x565b600056", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x565b600056", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump.json new file mode 100644 index 00000000..91933e1c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump.json @@ -0,0 +1,37 @@ +{ + "jumpTo1InstructionafterJump" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpTo1InstructionafterJumpFiller.json", + "sourceHash" : "88eb8cc46a28df3e813fc9d859aaa7c10bd7246272ed7af7c7e119e18e7c6592" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6003565b6001600055", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6003565b6001600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_jumpdestFirstInstruction.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_jumpdestFirstInstruction.json new file mode 100644 index 00000000..99aec172 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_jumpdestFirstInstruction.json @@ -0,0 +1,37 @@ +{ + "jumpTo1InstructionafterJump_jumpdestFirstInstruction" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpTo1InstructionafterJump_jumpdestFirstInstructionFiller.json", + "sourceHash" : "1e05b7560aba357248c8fdddd62e9b8dfb943cc2c3bb9569c5d44c2322899ff4" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5b6003565b6001600055", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x5b6003565b6001600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDest.json new file mode 100644 index 00000000..125f422c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDest.json @@ -0,0 +1,37 @@ +{ + "jumpTo1InstructionafterJump_noJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDestFiller.json", + "sourceHash" : "91502d2804896fda92630c93005fc5c0e26591bac75b7fff576409271f81cdb6" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6003566001600055", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6003566001600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUint64maxPlus1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUint64maxPlus1.json new file mode 100644 index 00000000..3e736a8f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUint64maxPlus1.json @@ -0,0 +1,37 @@ +{ + "jumpToUint64maxPlus1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpToUint64maxPlus1Filler.json", + "sourceHash" : "17b7f86769171233d32af7b23fc33ba8e71f03a64f0625aadfe65a696dff36a6" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6801000000000000000b565b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6801000000000000000b565b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUintmaxPlus1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUintmaxPlus1.json new file mode 100644 index 00000000..1d8b054e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUintmaxPlus1.json @@ -0,0 +1,37 @@ +{ + "jumpToUintmaxPlus1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpToUintmaxPlus1Filler.json", + "sourceHash" : "6897e3a469257a7905bf719e9ae36ac49f830eab122209a9c2e89c879cdaa2d7" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x640100000007565b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x640100000007565b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpdestBigList.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpdestBigList.json new file mode 100644 index 00000000..76342690 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpdestBigList.json @@ -0,0 +1,51 @@ +{ + "jumpdestBigList" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpdestBigListFiller.json", + "sourceHash" : "6e4f2dfe68bb0ae1bdce8e6385b098b9984176b12f76273d1a1f7e34f46d85db" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6009565b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b", + "data" : "0x", + "gas" : "0x05f5e100", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x05f5e0a1", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6009565b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6009565b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi0.json new file mode 100644 index 00000000..60ebc100 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi0.json @@ -0,0 +1,37 @@ +{ + "jumpi0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi0Filler.json", + "sourceHash" : "86fb0cc0becb3234b287df55e90da9a860eff30714976e3395b25ee2e2b47c48" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360016009576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360016009576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1.json new file mode 100644 index 00000000..05d82562 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1.json @@ -0,0 +1,52 @@ +{ + "jumpi1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi1Filler.json", + "sourceHash" : "27f04b183d459deb05bc15b1281b0e300307950da1968f669bd8cbec2b200044" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x602360006009576001600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013867", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360006009576001600255", + "nonce" : "0x00", + "storage" : { + "0x02" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x602360006009576001600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1_jumpdest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1_jumpdest.json new file mode 100644 index 00000000..b3d7e40d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1_jumpdest.json @@ -0,0 +1,37 @@ +{ + "jumpi1_jumpdest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi1_jumpdestFiller.json", + "sourceHash" : "ad83573b03f45ffbef8bfcea78a8cb61b1c793b36475000cf9222dea41696717" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60236001600a5760015b600255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60236001600a5760015b600255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiAfterStop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiAfterStop.json new file mode 100644 index 00000000..2527229f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiAfterStop.json @@ -0,0 +1,52 @@ +{ + "jumpiAfterStop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiAfterStopFiller.json", + "sourceHash" : "ec2d355d1d27a71fadd654c9a7b8a7b90bc68dce10416448f803d452ef1d474d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016008570060015b6002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013869", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016008570060015b6002600355", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016008570060015b6002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiOutsideBoundary.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiOutsideBoundary.json new file mode 100644 index 00000000..2cc9c069 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiOutsideBoundary.json @@ -0,0 +1,37 @@ +{ + "jumpiOutsideBoundary" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiOutsideBoundaryFiller.json", + "sourceHash" : "7d536d76f1c00c063b374bdcd155229427e5fe4867ae5ac41d42516c88ebff0d" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff576002600355", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff576002600355", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUint64maxPlus1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUint64maxPlus1.json new file mode 100644 index 00000000..2362c3ad --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUint64maxPlus1.json @@ -0,0 +1,37 @@ +{ + "jumpiToUint64maxPlus1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiToUint64maxPlus1Filler.json", + "sourceHash" : "43b7965f24cac2b1b88fb4781bccd2cbcdcc1569812c2c9e28ebded71ebd172e" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016801000000000000000d575b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016801000000000000000d575b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUintmaxPlus1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUintmaxPlus1.json new file mode 100644 index 00000000..08e3343e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUintmaxPlus1.json @@ -0,0 +1,37 @@ +{ + "jumpiToUintmaxPlus1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiToUintmaxPlus1Filler.json", + "sourceHash" : "58d51b8cb46082033f726f1bca929fb1713048436d52029e31f5bfcaaaded691" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001640100000009575b5b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001640100000009575b5b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi_at_the_end.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi_at_the_end.json new file mode 100644 index 00000000..a39d7d0a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi_at_the_end.json @@ -0,0 +1,51 @@ +{ + "jumpi_at_the_end" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi_at_the_endFiller.json", + "sourceHash" : "db58f5762f6dccaf9a4daa5053fe18bc36fc597c379acbbb8dc7d41897e0fd1b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600a6000525b6000516001900380600052600557", + "data" : "0x", + "gas" : "0x03e8", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x0260", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a6000525b6000516001900380600052600557", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a6000525b6000516001900380600052600557", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithJumpDest.json new file mode 100644 index 00000000..6c7497d9 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithJumpDest.json @@ -0,0 +1,37 @@ +{ + "jumpifInsidePushWithJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpifInsidePushWithJumpDestFiller.json", + "sourceHash" : "790a546e29160af651f091890cd367d79d28b345f43847fa5d19b6a0dab087e9" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600657655b6001600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600657655b6001600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDest.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDest.json new file mode 100644 index 00000000..b689b4b2 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDest.json @@ -0,0 +1,37 @@ +{ + "jumpifInsidePushWithoutJumpDest" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDestFiller.json", + "sourceHash" : "c69048c65f19388408ec0027e2c9372b393d057d91c9e0eff2ea96f8bb59f66b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600160075761eeff", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600160075761eeff", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/kv1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/kv1.json new file mode 100644 index 00000000..27d04eee --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/kv1.json @@ -0,0 +1,52 @@ +{ + "kv1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/kv1Filler.json", + "sourceHash" : "e9c18f1395a9a5e541d26c02b68f69e413953c380102c17d783cc18b5092bbf2" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x33604555602d80600f6000396000f3604554331415602c575b366080511015602b576020608051013560805135556040608051016080526009565b5b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01385d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x604554331415602c575b366080511015602b576020608051013560805135556040608051016080526009565b5b", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x33604555602d80600f6000396000f3604554331415602c575b366080511015602b576020608051013560805135556040608051016080526009565b5b", + "nonce" : "0x00", + "storage" : { + "0x45" : "0xcd1722f3947def4cf144679da39c4c32bdc35681" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x33604555602d80600f6000396000f3604554331415602c575b366080511015602b576020608051013560805135556040608051016080526009565b5b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/log1MemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/log1MemExp.json new file mode 100644 index 00000000..ce82cb55 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/log1MemExp.json @@ -0,0 +1,37 @@ +{ + "log1MemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/log1MemExpFiller.json", + "sourceHash" : "241dbcb0d33d25f1db0b51b65c38c4e3ef2f5b52c799264979423508e3fcf934" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60ff630fffffffa1", + "data" : "0x", + "gas" : "0x01f4153d80", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60ff630fffffffa1", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1020.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1020.json new file mode 100644 index 00000000..225c6d0e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1020.json @@ -0,0 +1,51 @@ +{ + "loop_stacklimit_1020" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/loop_stacklimit_1020Filler.json", + "sourceHash" : "e3a67d3fc9f35b9e0db39be074d9160030b23790e568d0387f9d8f7e4190e40a" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6000345b60019003906001018180600357600052600152600059f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x03fc" + }, + "gas" : "0xef1c", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000345b60019003906001018180600357600052600152600059f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000345b60019003906001018180600357600052600152600059f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json new file mode 100644 index 00000000..2eaa7501 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json @@ -0,0 +1,37 @@ +{ + "loop_stacklimit_1021" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/loop_stacklimit_1021Filler.json", + "sourceHash" : "c1bb4f6ff68cafca82606ffe4fbed88358dc3b19be5e69714e96478d8571c0fc" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6000345b60019003906001018180600357600052600152600059f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x03fd" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000345b60019003906001018180600357600052600152600059f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/memory1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/memory1.json new file mode 100644 index 00000000..67bd976a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/memory1.json @@ -0,0 +1,51 @@ +{ + "memory1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/memory1Filler.json", + "sourceHash" : "4962a1d10a8792cd1ad8a08ac500002adec8cc965fd1fb4d1c45cb3e558a9de6" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600260005360036001536000516001510160025260406000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01866d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x02030503000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600260005360036001536000516001510160025260406000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600260005360036001536000516001510160025260406000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError0.json new file mode 100644 index 00000000..59aa727a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError0.json @@ -0,0 +1,51 @@ +{ + "mloadError0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadError0Filler.json", + "sourceHash" : "27a14368a9e5b964986445d0436e67f685ab0171ea0359b9a112fdc07d98bf53" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600051600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01730c", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError1.json new file mode 100644 index 00000000..8d9def1a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadError1.json @@ -0,0 +1,51 @@ +{ + "mloadError1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadError1Filler.json", + "sourceHash" : "f5841cfbab0e35ad5727493bc7b6e0cd075735640637e817001de707085c2608" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6017600152600051600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x017300", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6017600152600051600155", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6017600152600051600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadMemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadMemExp.json new file mode 100644 index 00000000..d3ed190f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadMemExp.json @@ -0,0 +1,37 @@ +{ + "mloadMemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadMemExpFiller.json", + "sourceHash" : "b12ca5b81a2d597d774f63fd3e6301a3808c7090e1b5ee00ea980c846ddadf32" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x630fffffff51", + "data" : "0x", + "gas" : "0x800570", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x630fffffff51", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadOutOfGasError2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadOutOfGasError2.json new file mode 100644 index 00000000..a1be9f40 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadOutOfGasError2.json @@ -0,0 +1,37 @@ +{ + "mloadOutOfGasError2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadOutOfGasError2Filler.json", + "sourceHash" : "8df8c3070849692634e4e7af44885da9c5d41df0717fd6d337aa7d5bfed56d52" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6272482551600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6272482551600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize0.json new file mode 100644 index 00000000..c36b925e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize0.json @@ -0,0 +1,52 @@ +{ + "msize0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/msize0Filler.json", + "sourceHash" : "41daa7a08f4c4f0380b60446927c8a3d3f077fdd63de63ab8736353cf7c92d86" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60005259600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01386f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005259600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x20" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005259600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize1.json new file mode 100644 index 00000000..6fbbfbb8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize1.json @@ -0,0 +1,52 @@ +{ + "msize1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/msize1Filler.json", + "sourceHash" : "1bc7a7187b3aa498df95faec7fa0258d950df3afb6205db0f9e2997ffb7ec512" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x64ffffffffff60005259600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01386f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005259600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x20" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005259600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize2.json new file mode 100644 index 00000000..b390c6d3 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize2.json @@ -0,0 +1,52 @@ +{ + "msize2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/msize2Filler.json", + "sourceHash" : "7a68500c2697ce7d4e5140214c087b3f152770295239abebdae1f81695167994" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x64ffffffffff60005261eeee60205259600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013863", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee60205259600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x40" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee60205259600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize3.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize3.json new file mode 100644 index 00000000..010ef69e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/msize3.json @@ -0,0 +1,52 @@ +{ + "msize3" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/msize3Filler.json", + "sourceHash" : "e5a676b6ba865c05ea6cf933a2805cb286a664d1bee6544604cc96fdd79f1be4" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x64ffffffffff60005261eeee605a5259600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01385d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee605a5259600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x80" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x64ffffffffff60005261eeee605a5259600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore0.json new file mode 100644 index 00000000..913d3d44 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore0.json @@ -0,0 +1,52 @@ +{ + "mstore0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore0Filler.json", + "sourceHash" : "78e3311be5943f4a7995e11b3fe7e41fa432fae150d687201c617c70ae40f6d7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore1.json new file mode 100644 index 00000000..b322f2ab --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore1.json @@ -0,0 +1,52 @@ +{ + "mstore1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore1Filler.json", + "sourceHash" : "424433d76d1f8d1622fa9796c232dbd9f31ddc1231efae876f6494ee7d1ccab2" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600201600152600151600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013862", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600201600152600151600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x01" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600201600152600151600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8MemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8MemExp.json new file mode 100644 index 00000000..785e247c --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8MemExp.json @@ -0,0 +1,37 @@ +{ + "mstore8MemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore8MemExpFiller.json", + "sourceHash" : "df32f3b06a7e748f5fdd93a878f7687f4f28864f8a5956d8e3a4fff7463b47f0" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60f1630fffffff53", + "data" : "0x", + "gas" : "0x800570", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60f1630fffffff53", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8WordToBigError.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8WordToBigError.json new file mode 100644 index 00000000..69c83039 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8WordToBigError.json @@ -0,0 +1,52 @@ +{ + "mstore8WordToBigError" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore8WordToBigErrorFiller.json", + "sourceHash" : "e7f6dfe7bcd73d4ee7ec71238711bd20d21eafc11b4b5e6c54ed69b2daf3c8bd" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0xff00000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_0.json new file mode 100644 index 00000000..722b4b38 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_0.json @@ -0,0 +1,52 @@ +{ + "mstore8_0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore8_0Filler.json", + "sourceHash" : "0a5e67d6603b41a69f94c4d3dcc06da69c17c841ba0cdc8e15a5203e89d217a7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0xff00000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600153600151600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_1.json new file mode 100644 index 00000000..a4505525 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8_1.json @@ -0,0 +1,52 @@ +{ + "mstore8_1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore8_1Filler.json", + "sourceHash" : "85ba59a62f13c9f29b37207e79bf61c2bfb361b6b703ac5ec0f82801edd6cdec" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60015360ee600253600051600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013862", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60015360ee600253600051600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0xffee0000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60015360ee600253600051600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreMemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreMemExp.json new file mode 100644 index 00000000..f79ee08d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreMemExp.json @@ -0,0 +1,37 @@ +{ + "mstoreMemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstoreMemExpFiller.json", + "sourceHash" : "eb43769a562c8a34bcb776fd312cc723bf2e8f4e64c75d7d3e36451760d9fd44" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60f1630fffffff52", + "data" : "0x", + "gas" : "0x01f4153d80", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60f1630fffffff52", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreWordToBigError.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreWordToBigError.json new file mode 100644 index 00000000..8409845b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreWordToBigError.json @@ -0,0 +1,52 @@ +{ + "mstoreWordToBigError" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstoreWordToBigErrorFiller.json", + "sourceHash" : "25c31b75a7912e1384ff3347dc511c5d1b384e6f40cfb0dffaa65176abcc1613" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013868", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600152600151600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore_mload0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore_mload0.json new file mode 100644 index 00000000..d3f3871d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore_mload0.json @@ -0,0 +1,52 @@ +{ + "mstore_mload0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore_mload0Filler.json", + "sourceHash" : "f3bd75c796896dcdbf77a7b2af45f3299ebe20db7e30d22031edc990bffb0416" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6017600052600051600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01386b", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6017600052600051600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x17" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6017600052600051600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc0.json new file mode 100644 index 00000000..20b578ca --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc0.json @@ -0,0 +1,51 @@ +{ + "pc0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/pc0Filler.json", + "sourceHash" : "824c240179768ed6999ca7357c185b25d2368e5526cde066fa103caa26fe8dea" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x58600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x017313", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x58600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x58600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc1.json new file mode 100644 index 00000000..21c3580d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pc1.json @@ -0,0 +1,52 @@ +{ + "pc1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/pc1Filler.json", + "sourceHash" : "5e897dc9ac93e7c8c0502f846914c81cacb26796ab75d517dd862fc1f193256c" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60005558600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x0124ed", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005558600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x05" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005558600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop0.json new file mode 100644 index 00000000..9fc77914 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop0.json @@ -0,0 +1,52 @@ +{ + "pop0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/pop0Filler.json", + "sourceHash" : "46af5c256e1cdc6525f63332c78c39e0583ad9afe06e29a1a2cad8efcc801fd4" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6002600360045055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013875", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6002600360045055", + "nonce" : "0x00", + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6002600360045055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop1.json new file mode 100644 index 00000000..40f9bb43 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop1.json @@ -0,0 +1,37 @@ +{ + "pop1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/pop1Filler.json", + "sourceHash" : "f87d71b88a272f122f6ea9dbd4680f8b4bf659a1b2bae4634398e6ecdcc9f487" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x5060026003600455", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x5060026003600455", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return1.json new file mode 100644 index 00000000..99038e11 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return1.json @@ -0,0 +1,37 @@ +{ + "return1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/return1Filler.json", + "sourceHash" : "fe0798e0775da11e784482b44b51322ad70f4deaa8ce8643841257d3abee2e1f" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001620f4240f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001620f4240f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return2.json new file mode 100644 index 00000000..627a8746 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return2.json @@ -0,0 +1,51 @@ +{ + "return2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/return2Filler.json", + "sourceHash" : "dbf688e0c2f5f4907b91cf9d71f3dc94ccbdcd3153ece4d2017e0367c0f0ef66" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001608052600060805111601b57600160005260206000f3602b565b602760005260206000f360026080525b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01865f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000027", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001608052600060805111601b57600160005260206000f3602b565b602760005260206000f360026080525b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001608052600060805111601b57600160005260206000f3602b565b602760005260206000f360026080525b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sha3MemExp.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sha3MemExp.json new file mode 100644 index 00000000..b6961869 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sha3MemExp.json @@ -0,0 +1,37 @@ +{ + "sha3MemExp" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/sha3MemExpFiller.json", + "sourceHash" : "6672d6b321654fc8397f1a89903d0fb859013f50a4483c33e7b14b08ba490886" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x01f4153d80", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff630fffffff20", + "data" : "0x", + "gas" : "0x01f4153d80", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff630fffffff20", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_0.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_0.json new file mode 100644 index 00000000..c44a6a82 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_0.json @@ -0,0 +1,54 @@ +{ + "sstore_load_0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_load_0Filler.json", + "sourceHash" : "371f51e169fa8f7740cef83f469ff5f02034d301d027b0267cd999c9ea5ca633" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60005560ee600a55600054601455", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x9bfc", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005560ee600a55600054601455", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xff", + "0x0a" : "0xee", + "0x14" : "0xff" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005560ee600a55600054601455", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_1.json new file mode 100644 index 00000000..8e0d2d30 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_1.json @@ -0,0 +1,53 @@ +{ + "sstore_load_1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_load_1Filler.json", + "sourceHash" : "28c5c7cfbcf28dd967743a82487d71c5d17eca75a90f019d227970c0ff927155" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60005560ee600a55606454601455", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0xd694", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005560ee600a55606454601455", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xff", + "0x0a" : "0xee" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005560ee600a55606454601455", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_2.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_2.json new file mode 100644 index 00000000..a64cd12f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_2.json @@ -0,0 +1,37 @@ +{ + "sstore_load_2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_load_2Filler.json", + "sourceHash" : "6eeaf23d94ef3fc20edf8997eea5636ef20031039916c445404cfbe6ed8fbd42" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff60005560ee60015560dd600255600154600a55600254601455", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff60005560ee60015560dd600255600154600a55600254601455", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_underflow.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_underflow.json new file mode 100644 index 00000000..ba3e6e28 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_underflow.json @@ -0,0 +1,37 @@ +{ + "sstore_underflow" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_underflowFiller.json", + "sourceHash" : "805b307827e4870e9e3bf9655a71a4ca5c327223280c4c3125522d053732de4b" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600155", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600155", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stack_loop.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stack_loop.json new file mode 100644 index 00000000..48ca5d11 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stack_loop.json @@ -0,0 +1,37 @@ +{ + "stack_loop" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/stack_loopFiller.json", + "sourceHash" : "10cdba5fde4ef3d4d21af05732cf685986623a9055ef0d62dfb00f2a415e9264" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60015b6001810380600257600053600153600253600353600453600553600653600753600853600953596000f3", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60015b6001810380600257600053600153600253600353600453600553600653600753600853600953596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stackjump1.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stackjump1.json new file mode 100644 index 00000000..1d36c705 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/stackjump1.json @@ -0,0 +1,51 @@ +{ + "stackjump1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/stackjump1Filler.json", + "sourceHash" : "21d7234c731f6e2e771b45ce8ba46f258fcfee3c1c1f9060d5246302ef5f151e" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6004600660096014565b600a03600052596000f35b60005201600956", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x018662", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6004600660096014565b600a03600052596000f35b60005201600956", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6004600660096014565b600a03600052596000f35b60005201600956", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/swapAt52becameMstore.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/swapAt52becameMstore.json new file mode 100644 index 00000000..74f61efb --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/swapAt52becameMstore.json @@ -0,0 +1,37 @@ +{ + "swapAt52becameMstore" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/swapAt52becameMstoreFiller.json", + "sourceHash" : "b014aac7021775f56b763921bf12a663ca35c4aa230888cd7908edfa705b1413" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600260035255", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600260035255", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/when.json b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/when.json new file mode 100644 index 00000000..60805343 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/when.json @@ -0,0 +1,51 @@ +{ + "when" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmIOandFlowOperations/whenFiller.json", + "sourceHash" : "18527242394f1a6921ffb94f5938e5c13a8dc892cb123edf424d17c32be5140d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600060011115600e57600d6080525b", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01866e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600060011115600e57600d6080525b", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600060011115600e57600d6080525b", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503102320PYTHON.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503102320PYTHON.json new file mode 100644 index 00000000..b79202fb --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503102320PYTHON.json @@ -0,0 +1,37 @@ +{ + "201503102320PYTHON" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503102320PYTHONFiller.json", + "sourceHash" : "38aa9ba7f7836987852734619b0192d42434bd7106da17663d5fc85d81a1e6cf" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x434342444244454597", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x434342444244454597", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110206PYTHON.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110206PYTHON.json new file mode 100644 index 00000000..2bcf8621 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110206PYTHON.json @@ -0,0 +1,37 @@ +{ + "201503110206PYTHON" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503110206PYTHONFiller.json", + "sourceHash" : "ad34ff6291ab537633ab5e7163537b24617cc4edb2f45eac65bed9d2c009cfc3" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x4045404145454441343987ff3735043055", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x4045404145454441343987ff3735043055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110219PYTHON.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110219PYTHON.json new file mode 100644 index 00000000..cfa04863 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110219PYTHON.json @@ -0,0 +1,37 @@ +{ + "201503110219PYTHON" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503110219PYTHONFiller.json", + "sourceHash" : "93dd23cbf213b07ac96a1fdfc826f41475452fea6da2e4f8d3f5d206e9a1adb9" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x4040459143404144809759886d608f", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x4040459143404144809759886d608f", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110346PYTHON_PUSH24.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110346PYTHON_PUSH24.json new file mode 100644 index 00000000..3283a003 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110346PYTHON_PUSH24.json @@ -0,0 +1,51 @@ +{ + "201503110346PYTHON_PUSH24" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503110346PYTHON_PUSH24Filler.json", + "sourceHash" : "953cb389f468c0d45697c57895679d7675ab43de963ad34a0ee547b8d27d10c8" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7745414245403745f31387900a8d55", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x270d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x7745414245403745f31387900a8d55", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x7745414245403745f31387900a8d55", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503111844PYTHON.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503111844PYTHON.json new file mode 100644 index 00000000..da88a5f7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503111844PYTHON.json @@ -0,0 +1,51 @@ +{ + "201503111844PYTHON" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503111844PYTHONFiller.json", + "sourceHash" : "a8049871a173837bf8fbfab3352baf9bb9e33d0ffa2bd20ba6246a70d9c1b165" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x65424555", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x270d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x65424555", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x65424555", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503112218PYTHON.json b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503112218PYTHON.json new file mode 100644 index 00000000..69c008e9 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmRandomTest/201503112218PYTHON.json @@ -0,0 +1,37 @@ +{ + "201503112218PYTHON" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmRandomTest/201503112218PYTHONFiller.json", + "sourceHash" : "6fc205d30fd7493b6e120e18c91e1e41f6fe334b94abadbac37d2817066ebccb" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x012c", + "currentTimestamp" : "0x02" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x4041", + "data" : "0x", + "gas" : "0x2710", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x4041", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/TestNameRegistrator.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/TestNameRegistrator.json new file mode 100644 index 00000000..058fa0e5 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/TestNameRegistrator.json @@ -0,0 +1,52 @@ +{ + "TestNameRegistrator" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/TestNameRegistratorFiller.json", + "sourceHash" : "7e0e4bcbcbe8bcaf9a8535e65d4c6665db752910953b5eafc63da8f7cdff20b7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6000355415600957005b60203560003555", + "data" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x01382b", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return0.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return0.json new file mode 100644 index 00000000..eb51c4f7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return0.json @@ -0,0 +1,52 @@ +{ + "return0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/return0Filler.json", + "sourceHash" : "1cd2b9480f1f5bdd82e8026b6342008ef84d318c3f9f173eae7d09e50eaf26b3" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "code" : "0x603760005360005160005560016000f3", + "data" : "0xaa", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "value" : "0x17" + }, + "gas" : "0x013865", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x37", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560016000f3", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3700000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560016000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return1.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return1.json new file mode 100644 index 00000000..08051849 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return1.json @@ -0,0 +1,52 @@ +{ + "return1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/return1Filler.json", + "sourceHash" : "5cd716a8e8d460b10e0dc1b3d5b6394f0c388e0e36246bf124478b0cb86a1f76" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "code" : "0x603760005360005160005560026000f3", + "data" : "0xaa", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "value" : "0x17" + }, + "gas" : "0x013865", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x3700", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560026000f3", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3700000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560026000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return2.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return2.json new file mode 100644 index 00000000..d1103b4f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/return2.json @@ -0,0 +1,52 @@ +{ + "return2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/return2Filler.json", + "sourceHash" : "4181cbf262c1dc2cdc186e007ec6c13466bd031b190b07874b1177a00717deeb" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "code" : "0x603760005360005160005560216000f3", + "data" : "0xaa", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "value" : "0x17" + }, + "gas" : "0x013862", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x370000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560216000f3", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3700000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x603760005360005160005560216000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicide0.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicide0.json new file mode 100644 index 00000000..ae80e8f6 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicide0.json @@ -0,0 +1,58 @@ +{ + "suicide0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/suicide0Filler.json", + "sourceHash" : "56c8766e8a1687dfe807b1e8f2d0454267f432c7e3035ff5fa9c27a2d594739d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x33ff", + "data" : "0x", + "gas" : "0x03e8", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0186a0" + }, + "gas" : "0x03e6", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x152d02c7e14af6800017", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x33ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideNotExistingAccount.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideNotExistingAccount.json new file mode 100644 index 00000000..ecf5d3bc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideNotExistingAccount.json @@ -0,0 +1,65 @@ +{ + "suicideNotExistingAccount" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/suicideNotExistingAccountFiller.json", + "sourceHash" : "ba450a40efb62a9fb6e16e3bced0afde8d0b08b9c0f78979f35fc45b9de72816" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x73aa1722f3947def4cf144679da39c4c32bdc35681ff", + "data" : "0x", + "gas" : "0x03e8", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0186a0" + }, + "gas" : "0x03e5", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0xaa1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x73aa1722f3947def4cf144679da39c4c32bdc35681ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideSendEtherToMe.json b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideSendEtherToMe.json new file mode 100644 index 00000000..7a8f19b8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSystemOperations/suicideSendEtherToMe.json @@ -0,0 +1,58 @@ +{ + "suicideSendEtherToMe" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmSystemOperations/suicideSendEtherToMeFiller.json", + "sourceHash" : "0cf005812e9c99dc87bdd8463a9849a0164a9e02b3d09eaab228267d6c8c703e" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x30ff", + "data" : "0x", + "gas" : "0x03e8", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0186a0" + }, + "gas" : "0x03e6", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x30ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x17", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 6227b3ce..7408d7d8 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -15,6 +15,7 @@ from z3 import ExprRef, simplify evm_test_dir = Path(__file__).parent / "VMTests" +""" test_types = [ "vmArithmeticTest", "vmBitwiseLogicOperation", @@ -22,7 +23,20 @@ test_types = [ "vmPushDupSwapTest", "vmTests", "vmSha3Test", + "vmSystemOperations", + "vmRandomTest" ] +""" +test_types = [ + "vmIOandFlowOperations" +] +ignored_test_names = ( + "gasprice", # Gas price is a symbol + "log1MemExp", # Logs not implemented + "loop_stacklimit_1020", # we already have a default depth which is different from EVM + "loop_stacklimit_1021", # Same as above + +) def load_test_data(designations): @@ -80,7 +94,9 @@ def test_vmtest( post_condition: dict, ) -> None: # Arrange - if test_name == "gasprice": + if test_name != "pc1": + return + if test_name in ignored_test_names: return accounts = {} for address, details in pre_condition.items(): @@ -120,7 +136,7 @@ def test_vmtest( assert all(map(lambda g: g[0] <= g[1], gas_min_max)) assert any(gas_ranges) - if any((v in test_name for v in ["error", "oog"])) and post_condition == {}: + if post_condition == {}: # no more work to do if error happens or out of gas assert len(laser_evm.open_states) == 0 else: @@ -140,6 +156,7 @@ def test_vmtest( for index, value in details["storage"].items(): expected = int(value, 16) actual = account.storage[int(index, 16)] + print(actual, expected) if isinstance(actual, Expression): actual = actual.value actual = 1 if actual is True else 0 if actual is False else actual From 475398deb4e940103b756e9ed03e1a2de0a45cb6 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 2 Mar 2019 20:07:20 +0530 Subject: [PATCH 02/97] Refactor the code --- mythril/laser/ethereum/instructions.py | 5 +++-- tests/laser/evm_testsuite/evm_test.py | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 33692346..0b7d1581 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1370,7 +1370,6 @@ class Instruction: """ try: data = global_state.environment.active_account.storage[index] - print(data) except KeyError: data = global_state.new_bitvec("storage_" + str(index), 256) global_state.environment.active_account.storage[index] = data @@ -1616,7 +1615,9 @@ class Instruction: :return: """ index = global_state.mstate.pc - program_counter = global_state.environment.code.instruction_list[index]["address"] + program_counter = global_state.environment.code.instruction_list[index][ + "address" + ] global_state.mstate.stack.append(program_counter) return [global_state] diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 7408d7d8..f52a2fc1 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -27,15 +27,12 @@ test_types = [ "vmRandomTest" ] """ -test_types = [ - "vmIOandFlowOperations" -] +test_types = ["vmIOandFlowOperations"] ignored_test_names = ( - "gasprice", # Gas price is a symbol - "log1MemExp", # Logs not implemented + "gasprice", # Gas price is a symbol + "log1MemExp", # Logs not implemented "loop_stacklimit_1020", # we already have a default depth which is different from EVM "loop_stacklimit_1021", # Same as above - ) From ca4107833a4028f307e1edb5f2e144d4da0b74d7 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 2 Mar 2019 20:30:05 +0530 Subject: [PATCH 03/97] Fix gasprice and return1_ --- mythril/laser/ethereum/instructions.py | 8 ++++++-- tests/laser/evm_testsuite/evm_test.py | 4 ---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 0b7d1581..6a8a8283 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -931,7 +931,7 @@ class Instruction: :param global_state: :return: """ - global_state.mstate.stack.append(global_state.new_bitvec("gasprice", 256)) + global_state.mstate.stack.append(global_state.environment.gasprice) return [global_state] @staticmethod @@ -1682,8 +1682,12 @@ class Instruction: offset, length = state.stack.pop(), state.stack.pop() return_data = [global_state.new_bitvec("return_data", 8)] try: + concrete_offset = util.get_concrete_int(offset) + concrete_length = util.get_concrete_int(length) + state.mem_extend(concrete_offset, concrete_length) + StateTransition.check_gas_usage_limit(global_state) return_data = state.memory[ - util.get_concrete_int(offset) : util.get_concrete_int(offset + length) + concrete_offset : concrete_offset + concrete_length ] except TypeError: log.debug("Return with symbolic length or offset. Not supported") diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index f52a2fc1..97a79d5c 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -29,7 +29,6 @@ test_types = [ """ test_types = ["vmIOandFlowOperations"] ignored_test_names = ( - "gasprice", # Gas price is a symbol "log1MemExp", # Logs not implemented "loop_stacklimit_1020", # we already have a default depth which is different from EVM "loop_stacklimit_1021", # Same as above @@ -91,8 +90,6 @@ def test_vmtest( post_condition: dict, ) -> None: # Arrange - if test_name != "pc1": - return if test_name in ignored_test_names: return accounts = {} @@ -153,7 +150,6 @@ def test_vmtest( for index, value in details["storage"].items(): expected = int(value, 16) actual = account.storage[int(index, 16)] - print(actual, expected) if isinstance(actual, Expression): actual = actual.value actual = 1 if actual is True else 0 if actual is False else actual From 92a9990c349a9ac09a67d6f1d61ba6b52c0bf69d Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 3 Mar 2019 00:07:02 +0530 Subject: [PATCH 04/97] Fix the tests --- mythril/laser/ethereum/instructions.py | 4 +- mythril/laser/ethereum/state/machine_state.py | 9 +++- mythril/laser/ethereum/state/memory.py | 2 + mythril/laser/ethereum/svm.py | 14 +++--- tests/laser/evm_testsuite/evm_test.py | 44 +++++++++++++------ tests/laser/state/mstate_test.py | 5 ++- 6 files changed, 53 insertions(+), 25 deletions(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 6a8a8283..3b8f7fe2 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1325,7 +1325,7 @@ class Instruction: index = util.get_concrete_int(index) return self._sload_helper(global_state, index) - except TypeError: + except TypeError as e: if not keccak_function_manager.is_keccak(index): return self._sload_helper(global_state, str(index)) @@ -1585,7 +1585,7 @@ class Instruction: # Get jump destination index = util.get_instruction_index(disassembly.instruction_list, jump_addr) - if not index: + if index is None: log.debug("Invalid jump destination: " + str(jump_addr)) return states diff --git a/mythril/laser/ethereum/state/machine_state.py b/mythril/laser/ethereum/state/machine_state.py index 0ee781ae..c1e7a585 100644 --- a/mythril/laser/ethereum/state/machine_state.py +++ b/mythril/laser/ethereum/state/machine_state.py @@ -3,7 +3,7 @@ stack.""" from copy import copy from typing import cast, Sized, Union, Any, List, Dict, Optional -from mythril.laser.smt import BitVec, Expression +from mythril.laser.smt import BitVec, Expression, symbol_factory from ethereum import opcodes, utils from mythril.laser.ethereum.evm_exceptions import ( @@ -32,6 +32,8 @@ class MachineStack(list): :param element: element to be appended to the list :function: appends the element to list if the size is less than STACK_LIMIT, else throws an error """ + if isinstance(element, int): + element = symbol_factory.BitVecVal(element, 256) if super(MachineStack, self).__len__() >= self.STACK_LIMIT: raise StackOverflowException( "Reached the EVM stack limit of {}, you can't append more " @@ -123,7 +125,10 @@ class MachineState: """ if self.memory_size > start + size: return 0 - return start + size - self.memory_size + new_size = utils.ceil32(start + size) // 32 + old_size = self.memory_size // 32 + + return (new_size - old_size) * 32 def calculate_memory_gas(self, start: int, size: int): """ diff --git a/mythril/laser/ethereum/state/memory.py b/mythril/laser/ethereum/state/memory.py index 4fac4120..0bb4fa94 100644 --- a/mythril/laser/ethereum/state/memory.py +++ b/mythril/laser/ethereum/state/memory.py @@ -152,6 +152,8 @@ class Memory: self[start + i] = cast(List[Union[int, BitVec]], value)[i] else: + if key > self.__len__(): + return if isinstance(value, int): assert 0 <= value <= 0xFF if isinstance(value, BitVec): diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 56e4b948..b7c05041 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -412,6 +412,8 @@ class LaserEVM: :param opcode: :param new_states: """ + if not self.requires_statespace: + return if opcode == "JUMP": assert len(new_states) <= 1 for state in new_states: @@ -459,13 +461,10 @@ class LaserEVM: old_node = state.node state.node = new_node new_node.constraints = state.mstate.constraints - if self.requires_statespace: - self.nodes[new_node.uid] = new_node - self.edges.append( - Edge( - old_node.uid, new_node.uid, edge_type=edge_type, condition=condition - ) - ) + self.nodes[new_node.uid] = new_node + self.edges.append( + Edge(old_node.uid, new_node.uid, edge_type=edge_type, condition=condition) + ) if edge_type == JumpType.RETURN: new_node.flags |= NodeFlags.CALL_RETURN @@ -477,6 +476,7 @@ class LaserEVM: new_node.flags |= NodeFlags.FUNC_ENTRY except StackUnderflowException: new_node.flags |= NodeFlags.FUNC_ENTRY + address = state.environment.code.instruction_list[state.mstate.pc]["address"] environment = state.environment diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 97a79d5c..9b415826 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -15,7 +15,7 @@ from z3 import ExprRef, simplify evm_test_dir = Path(__file__).parent / "VMTests" -""" + test_types = [ "vmArithmeticTest", "vmBitwiseLogicOperation", @@ -24,14 +24,33 @@ test_types = [ "vmTests", "vmSha3Test", "vmSystemOperations", - "vmRandomTest" + "vmRandomTest", + "vmIOandFlowOperations", +] + +tests_with_gas_support = ["gas0", "gas1"] +tests_with_block_number_support = [ + "BlockNumberDynamicJumpi0", + "BlockNumberDynamicJump0_jumpdest2", + "DynamicJumpPathologicalTest0", + "BlockNumberDynamicJumpifInsidePushWithJumpDest", + "BlockNumberDynamicJumpiAfterStop", + "BlockNumberDynamicJumpifInsidePushWithoutJumpDest", + "BlockNumberDynamicJump0_jumpdest0", + "BlockNumberDynamicJumpi1_jumpdest", + "BlockNumberDynamicJumpiOutsideBoundary", + "DynamicJumpJD_DependsOnJumps1", ] -""" -test_types = ["vmIOandFlowOperations"] +tests_with_log_support = ["log1MemExp"] +tests_not_relevent = ["loop_stacklimit_1020", "loop_stacklimit_1021"] +tests_to_resolve = ["jumpTo1InstructionafterJump", "sstore_load_2"] ignored_test_names = ( - "log1MemExp", # Logs not implemented - "loop_stacklimit_1020", # we already have a default depth which is different from EVM - "loop_stacklimit_1021", # Same as above + tests_with_gas_support + + tests_with_log_support + + tests_with_block_number_support + + tests_with_block_number_support + + tests_not_relevent + + tests_to_resolve ) @@ -89,6 +108,7 @@ def test_vmtest( gas_used: int, post_condition: dict, ) -> None: + # Arrange if test_name in ignored_test_names: return @@ -98,10 +118,11 @@ def test_vmtest( account.code = Disassembly(details["code"][2:]) account.balance = int(details["balance"], 16) account.nonce = int(details["nonce"], 16) - + for key, value in details["storage"].items(): + account.storage[int(key, 16)] = int(value, 16) accounts[address] = account - laser_evm = LaserEVM(accounts) + laser_evm = LaserEVM(accounts, requires_statespace=False) # Act laser_evm.time = datetime.now() @@ -136,10 +157,6 @@ def test_vmtest( else: assert len(laser_evm.open_states) == 1 world_state = laser_evm.open_states[0] - model = get_model( - next(iter(laser_evm.nodes.values())).states[0].mstate.constraints, - enforce_execution_time=False, - ) for address, details in post_condition.items(): account = world_state[address] @@ -150,6 +167,7 @@ def test_vmtest( for index, value in details["storage"].items(): expected = int(value, 16) actual = account.storage[int(index, 16)] + if isinstance(actual, Expression): actual = actual.value actual = 1 if actual is True else 0 if actual is False else actual diff --git a/tests/laser/state/mstate_test.py b/tests/laser/state/mstate_test.py index 86795589..c21b3159 100644 --- a/tests/laser/state/mstate_test.py +++ b/tests/laser/state/mstate_test.py @@ -1,4 +1,5 @@ import pytest +from ethereum import utils from mythril.laser.smt import simplify, symbol_factory from mythril.laser.ethereum.state.machine_state import MachineState @@ -22,7 +23,9 @@ def test_memory_extension(initial_size, start, extension_size): # Assert assert machine_state.memory_size == len(machine_state.memory) - assert machine_state.memory_size == max(initial_size, start + extension_size) + assert machine_state.memory_size == max( + initial_size, (utils.ceil32(start + extension_size) // 32) * 32 + ) stack_pop_too_many_test_data = [(0, 1), (0, 2), (5, 1), (5, 10)] From 1da86af5d8414dc3901939afbbcc1fb6f9a0a22d Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 4 Mar 2019 19:41:47 +0530 Subject: [PATCH 05/97] Remove exception assignment --- mythril/laser/ethereum/instructions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 3b8f7fe2..26e07979 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1325,7 +1325,7 @@ class Instruction: index = util.get_concrete_int(index) return self._sload_helper(global_state, index) - except TypeError as e: + except TypeError: if not keccak_function_manager.is_keccak(index): return self._sload_helper(global_state, str(index)) From c907d3613f29ff11c83f93a8c095ab5c8d6f5901 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Tue, 5 Mar 2019 18:56:01 +0530 Subject: [PATCH 06/97] Fix edge case for the memory access --- mythril/laser/ethereum/state/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/state/memory.py b/mythril/laser/ethereum/state/memory.py index 0bb4fa94..085a7ec8 100644 --- a/mythril/laser/ethereum/state/memory.py +++ b/mythril/laser/ethereum/state/memory.py @@ -152,7 +152,7 @@ class Memory: self[start + i] = cast(List[Union[int, BitVec]], value)[i] else: - if key > self.__len__(): + if key >= self.__len__(): return if isinstance(value, int): assert 0 <= value <= 0xFF From c2b9bd7cb09e1118d1a931c698b17c7a2c8dcefb Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 7 Mar 2019 11:40:39 +0530 Subject: [PATCH 07/97] Move a test to TODO --- mythril/laser/ethereum/svm.py | 13 +++++++------ tests/laser/evm_testsuite/evm_test.py | 8 ++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index b7c05041..a4866eee 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -412,8 +412,6 @@ class LaserEVM: :param opcode: :param new_states: """ - if not self.requires_statespace: - return if opcode == "JUMP": assert len(new_states) <= 1 for state in new_states: @@ -461,10 +459,13 @@ class LaserEVM: old_node = state.node state.node = new_node new_node.constraints = state.mstate.constraints - self.nodes[new_node.uid] = new_node - self.edges.append( - Edge(old_node.uid, new_node.uid, edge_type=edge_type, condition=condition) - ) + if self.requires_statespace: + self.nodes[new_node.uid] = new_node + self.edges.append( + Edge( + old_node.uid, new_node.uid, edge_type=edge_type, condition=condition + ) + ) if edge_type == JumpType.RETURN: new_node.flags |= NodeFlags.CALL_RETURN diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 9b415826..24bbcba2 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -31,6 +31,7 @@ test_types = [ tests_with_gas_support = ["gas0", "gas1"] tests_with_block_number_support = [ "BlockNumberDynamicJumpi0", + "BlockNumberDynamicJumpi1", "BlockNumberDynamicJump0_jumpdest2", "DynamicJumpPathologicalTest0", "BlockNumberDynamicJumpifInsidePushWithJumpDest", @@ -42,8 +43,11 @@ tests_with_block_number_support = [ "DynamicJumpJD_DependsOnJumps1", ] tests_with_log_support = ["log1MemExp"] -tests_not_relevent = ["loop_stacklimit_1020", "loop_stacklimit_1021"] -tests_to_resolve = ["jumpTo1InstructionafterJump", "sstore_load_2"] +tests_not_relevent = [ + "loop_stacklimit_1020", # We won't be looping till 1020 as we have a max_depth + "loop_stacklimit_1021", +] +tests_to_resolve = ["jumpTo1InstructionafterJump", "sstore_load_2", "jumpi_at_the_end"] ignored_test_names = ( tests_with_gas_support + tests_with_log_support From fda18b3e77b3980d7aa89de27e9edb938207ebbc Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 2 May 2019 12:19:17 +0200 Subject: [PATCH 08/97] Change timeout logic --- mythril/interfaces/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index adb0e8f2..0fbbab7e 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -216,7 +216,7 @@ def create_parser(parser: argparse.ArgumentParser) -> None: options.add_argument( "--execution-timeout", type=int, - default=600, + default=86400, help="The amount of seconds to spend on symbolic execution", ) options.add_argument( From f79342ef04cd4bd44ebcdb4634b174e71c3522c6 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 6 May 2019 16:21:35 -0700 Subject: [PATCH 09/97] Global execution timeout --- mythril/laser/ethereum/svm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 0fcb8d77..d58a0a81 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -173,8 +173,9 @@ class LaserEVM: :param address: Address of the contract :return: """ + self.time = datetime.now() + for i in range(self.transaction_count): - self.time = datetime.now() log.info( "Starting message call transaction, iteration: {}, {} initial states".format( i, len(self.open_states) @@ -207,7 +208,7 @@ class LaserEVM: if ( self.execution_timeout and self.time - + timedelta(seconds=self.execution_timeout / self.transaction_count) + + timedelta(seconds=self.execution_timeout) <= datetime.now() and not create ): From c19f54e17d46611e4dd55e33112b10b720d3f6d3 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 6 May 2019 16:32:52 -0700 Subject: [PATCH 10/97] Black %#;.@&%^& --- mythril/laser/ethereum/svm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index d58a0a81..f37728fc 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -207,8 +207,7 @@ class LaserEVM: if ( self.execution_timeout - and self.time - + timedelta(seconds=self.execution_timeout) + and self.time + timedelta(seconds=self.execution_timeout) <= datetime.now() and not create ): From 409d2171ca8ca95274a528add9e5436559e88c6b Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 8 May 2019 16:31:11 -0700 Subject: [PATCH 11/97] Refactor predictable vars module --- .../modules/dependence_on_predictable_vars.py | 169 ++---------------- 1 file changed, 18 insertions(+), 151 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 7a931997..37fe33d2 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -1,22 +1,17 @@ """This module contains the detection code for predictable variable dependence.""" import logging -import re -from mythril.analysis import solver -from mythril.analysis.call_helpers import get_call_from_state from mythril.analysis.modules.base import DetectionModule -from mythril.analysis.ops import Call, VarType from mythril.analysis.report import Issue from mythril.analysis.swc_data import TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS -from mythril.exceptions import UnsatError from mythril.laser.ethereum.state.global_state import GlobalState log = logging.getLogger(__name__) class PredictableDependenceModule(DetectionModule): - """This module detects whether Ether is sent using predictable + """This module detects whether control flow decisions are made using predictable parameters.""" def __init__(self) -> None: @@ -25,12 +20,11 @@ class PredictableDependenceModule(DetectionModule): name="Dependence of Predictable Variables", swc_id="{} {}".format(TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS), description=( - "Check for CALLs that send >0 Ether as a result of computation " - "based on predictable variables such as block.coinbase, " - "block.gaslimit, block.timestamp, block.number" + "Check whether control flow decisions are influenced by block.coinbase," + "block.gaslimit, block.timestamp or block.number." ), entrypoint="callback", - pre_hooks=["CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"], + pre_hooks=["JUMPI"], ) def execute(self, state: GlobalState) -> list: @@ -39,7 +33,7 @@ class PredictableDependenceModule(DetectionModule): :param state: :return: """ - log.debug("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") + log.info("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") self._issues.extend(_analyze_states(state)) return self.issues @@ -54,171 +48,44 @@ def _analyze_states(state: GlobalState) -> list: :return: """ issues = [] - call = get_call_from_state(state) - if call is None: - return [] - if "callvalue" in str(call.value): - log.debug("[DEPENDENCE_ON_PREDICTABLE_VARS] Skipping refund function") - return [] - # We're only interested in calls that send Ether - if call.value.type == VarType.CONCRETE and call.value.val == 0: - return [] - - address = call.state.get_current_instruction()["address"] - - description = ( - "The contract sends Ether depending on the values of the following variables:\n" - ) - - # First check: look for predictable state variables in state & call recipient constraints + # Look for predictable state variables in jump condition vars = ["coinbase", "gaslimit", "timestamp", "number"] found = [] + description = "A control flow decision is made based on " + for var in vars: - for constraint in call.state.mstate.constraints[:] + [call.to]: - if var in str(constraint): - found.append(var) + if var in str(state.mstate.stack[-2]): + found.append(var) if len(found): for item in found: - description += "- block.{}\n".format(item) - if solve(call): + description += "block.{}. ".format(item) swc_id = TIMESTAMP_DEPENDENCE if item == "timestamp" else WEAK_RANDOMNESS description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " - "are predictable and/or can be manipulated by a malicious miner. " - "Don't use them for random number generation or to make critical decisions." + "are predictable and can be manipulated by a malicious miner. " + "Don't use them for random number generation or to make critical control flow decisions." ) issue = Issue( contract=state.environment.active_account.contract_name, function_name=state.environment.active_function_name, - address=address, + address=state.get_current_instruction()['address'], swc_id=swc_id, - bytecode=call.state.environment.code.bytecode, + bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", severity="Low", - description_head="Sending of Ether depends on a predictable variable.", + description_head="A control flow decision is made based on a predictable variable.", description_tail=description, gas_used=( - call.state.mstate.min_gas_used, - call.state.mstate.max_gas_used, + state.mstate.min_gas_used, + state.mstate.max_gas_used, ), ) issues.append(issue) - # Second check: blockhash - - for constraint in call.state.mstate.constraints[:] + [call.to]: - if "blockhash" in str(constraint): - if "number" in str(constraint): - m = re.search(r"blockhash\w+(\s-\s(\d+))*", str(constraint)) - if m and solve(call): - - found_item = m.group(1) - - if found_item: # block.blockhash(block.number - N) - description = ( - "The predictable expression 'block.blockhash(block.number - " - + m.group(2) - + ")' is used to determine Ether recipient" - ) - if int(m.group(2)) > 255: - description += ( - ", this expression will always be equal to zero." - ) - elif "storage" in str( - constraint - ): # block.blockhash(block.number - storage_0) - description = ( - "The predictable expression 'block.blockhash(block.number - " - + "some_storage_var)' is used to determine Ether recipient" - ) - else: # block.blockhash(block.number) - description = ( - "The predictable expression 'block.blockhash(block.number)'" - + " is used to determine Ether recipient" - ) - description += ", this expression will always be equal to zero." - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=address, - bytecode=call.state.environment.code.bytecode, - title="Dependence on Predictable Variable", - severity="Low", - description_head="Sending of Ether depends on the blockhash.", - description_tail=description, - swc_id=WEAK_RANDOMNESS, - gas_used=( - call.state.mstate.min_gas_used, - call.state.mstate.max_gas_used, - ), - ) - issues.append(issue) - break - else: - - r = re.search(r"storage_([a-z0-9_&^]+)", str(constraint)) - if r: # block.blockhash(storage_0) - - """We actually can do better here by adding a constraint - blockhash_block_storage_0 == 0 and checking model - satisfiability. - - When this is done, severity can be raised from - 'Informational' to 'Warning'. Checking that storage - at given index can be tainted is not necessary, - since it usually contains block.number of the - 'commit' transaction in commit-reveal workflow. - """ - - index = r.group(1) - if index and solve(call): - description = ( - "A block hash is calculated using the block.blockhash(uint blockNumber) method. " - "The block number is obtained from storage index {}".format( - index - ) - ) - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=address, - bytecode=call.state.environment.code.bytecode, - title="Dependence on Predictable Variable", - severity="Low", - description_head="Sending of Ether depends on the blockhash.", - description_tail=description, - swc_id=WEAK_RANDOMNESS, - gas_used=( - call.state.mstate.min_gas_used, - call.state.mstate.max_gas_used, - ), - ) - issues.append(issue) - break return issues - - -def solve(call: Call) -> bool: - """ - - :param call: - :return: - """ - try: - model = solver.get_model(call.state.mstate.constraints) - log.debug("[DEPENDENCE_ON_PREDICTABLE_VARS] MODEL: " + str(model)) - pretty_model = solver.pretty_print_model(model) - - log.debug("[DEPENDENCE_ON_PREDICTABLE_VARS] main model: \n%s" % pretty_model) - return True - - except UnsatError: - log.debug("[DEPENDENCE_ON_PREDICTABLE_VARS] no model found") - return False From 444cee64942f0fb7a37b8a883168db26783f32ed Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 8 May 2019 16:31:39 -0700 Subject: [PATCH 12/97] Black --- mythril/analysis/modules/dependence_on_predictable_vars.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 37fe33d2..dd0092a8 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -74,17 +74,14 @@ def _analyze_states(state: GlobalState) -> list: issue = Issue( contract=state.environment.active_account.contract_name, function_name=state.environment.active_function_name, - address=state.get_current_instruction()['address'], + address=state.get_current_instruction()["address"], swc_id=swc_id, bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", severity="Low", description_head="A control flow decision is made based on a predictable variable.", description_tail=description, - gas_used=( - state.mstate.min_gas_used, - state.mstate.max_gas_used, - ), + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), ) issues.append(issue) From e6254b9edb942854843d1c1c17c38bcd473d8a90 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 8 May 2019 16:38:42 -0700 Subject: [PATCH 13/97] Revert log.info -> log.debug --- mythril/analysis/modules/dependence_on_predictable_vars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index dd0092a8..8615b000 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -33,7 +33,7 @@ class PredictableDependenceModule(DetectionModule): :param state: :return: """ - log.info("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") + log.debug("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") self._issues.extend(_analyze_states(state)) return self.issues From 3e4e4a25174f039294ee838457d71acdcff323cc Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Thu, 9 May 2019 22:09:28 +0200 Subject: [PATCH 14/97] FIX: Restricts `eth-account` package version to be <=0.3.0 Because `eth-account@0.4.0` depends on `eth_abi>=2.0.0b7`, which conflicts with `eth_abi==1.3.0` required by `mythril-classic`. As I am looking for a rapid fix, I am restricting `eth-account<=0.3.0` rather than trying to allow higher versions of `eth_abi`. Thus, leaving to `mythril-classic` team to inverstigate possibility of update to latest `eth-account` and `eth_abi`, and fix any related issues. --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c22d72d0..11cdeff3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ configparser>=3.5.0 coverage py_ecc==1.4.2 eth_abi==1.3.0 -eth-account>=0.1.0a2 +eth-account>=0.1.0a2,<=0.3.0 ethereum>=2.3.2 ethereum-input-decoder>=0.2.2 eth-hash>=0.1.0 diff --git a/setup.py b/setup.py index 67d7f39a..4605b5d3 100755 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ setup( "plyvel", "eth_abi==1.3.0", "eth-utils>=1.0.1", - "eth-account>=0.1.0a2", + "eth-account>=0.1.0a2,<=0.3.0", "eth-hash>=0.1.0", "eth-keyfile>=0.5.1", "eth-keys>=0.2.0b3", From 1fe3a8876fe5740af9c3ef7361d1c5ddeaff5fdf Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Thu, 9 May 2019 22:09:28 +0200 Subject: [PATCH 15/97] FIX: Restricts `eth-account` package version to be <=0.3.0 Because `eth-account@0.4.0` depends on `eth_abi>=2.0.0b7`, which conflicts with `eth_abi==1.3.0` required by `mythril-classic`. As I am looking for a rapid fix, I am restricting `eth-account<=0.3.0` rather than trying to allow higher versions of `eth_abi`. Thus, leaving to `mythril-classic` team to inverstigate possibility of update to latest `eth-account` and `eth_abi`, and fix any related issues. --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c22d72d0..11cdeff3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ configparser>=3.5.0 coverage py_ecc==1.4.2 eth_abi==1.3.0 -eth-account>=0.1.0a2 +eth-account>=0.1.0a2,<=0.3.0 ethereum>=2.3.2 ethereum-input-decoder>=0.2.2 eth-hash>=0.1.0 diff --git a/setup.py b/setup.py index 67d7f39a..4605b5d3 100755 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ setup( "plyvel", "eth_abi==1.3.0", "eth-utils>=1.0.1", - "eth-account>=0.1.0a2", + "eth-account>=0.1.0a2,<=0.3.0", "eth-hash>=0.1.0", "eth-keyfile>=0.5.1", "eth-keys>=0.2.0b3", From 5ec39fdce5aee3b94a1859c6338ee3a9d3b51870 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 10 May 2019 21:12:22 +0200 Subject: [PATCH 16/97] Revert "Change timeout logic" This reverts commit fda18b3e77b3980d7aa89de27e9edb938207ebbc. --- mythril/interfaces/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 0fbbab7e..adb0e8f2 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -216,7 +216,7 @@ def create_parser(parser: argparse.ArgumentParser) -> None: options.add_argument( "--execution-timeout", type=int, - default=86400, + default=600, help="The amount of seconds to spend on symbolic execution", ) options.add_argument( From a3f951d9c704d1659227b79ecf098df679aad88d Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Fri, 10 May 2019 16:38:00 -0400 Subject: [PATCH 17/97] [WIP] refactor to use annotations --- .../modules/dependence_on_predictable_vars.py | 86 +++++++++++-------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 8615b000..9ce230cc 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -9,6 +9,15 @@ from mythril.laser.ethereum.state.global_state import GlobalState log = logging.getLogger(__name__) +predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] + + +class PredictableValueAnnotation: + """ Symbol Annotation used if a variable is initialized from a predictable environment variable""" + + def __init__(self, opcode) -> None: + self.opcode = opcode + class PredictableDependenceModule(DetectionModule): """This module detects whether control flow decisions are made using predictable @@ -25,6 +34,7 @@ class PredictableDependenceModule(DetectionModule): ), entrypoint="callback", pre_hooks=["JUMPI"], + post_hooks=predictable_ops ) def execute(self, state: GlobalState) -> list: @@ -33,12 +43,11 @@ class PredictableDependenceModule(DetectionModule): :param state: :return: """ - log.debug("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") - self._issues.extend(_analyze_states(state)) - return self.issues + log.info("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") -detector = PredictableDependenceModule() + self._issues.extend(_analyze_states(state)) + return self.issues def _analyze_states(state: GlobalState) -> list: @@ -51,38 +60,41 @@ def _analyze_states(state: GlobalState) -> list: # Look for predictable state variables in jump condition - vars = ["coinbase", "gaslimit", "timestamp", "number"] - found = [] - - description = "A control flow decision is made based on " - - for var in vars: - if var in str(state.mstate.stack[-2]): - found.append(var) - - if len(found): - for item in found: - description += "block.{}. ".format(item) - swc_id = TIMESTAMP_DEPENDENCE if item == "timestamp" else WEAK_RANDOMNESS - - description += ( - "Note that the values of variables like coinbase, gaslimit, block number and timestamp " - "are predictable and can be manipulated by a malicious miner. " - "Don't use them for random number generation or to make critical control flow decisions." - ) - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=state.get_current_instruction()["address"], - swc_id=swc_id, - bytecode=state.environment.code.bytecode, - title="Dependence on predictable environment variable", - severity="Low", - description_head="A control flow decision is made based on a predictable variable.", - description_tail=description, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - issues.append(issue) + if state.get_current_instruction()["opcode"] == "JUMPI": + for annotation in state.mstate.stack[-2].annotations: + if isinstance(annotation, PredictableValueAnnotation): + description = "A control flow decision is made based on block.{}. ".format(annotation.opcode) + + description += ( + "Note that the values of variables like coinbase, gaslimit, block number and timestamp " + "are predictable and can be manipulated by a malicious miner. " + "Don't use them for random number generation or to make critical control flow decisions." + ) + + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=state.get_current_instruction()["address"], + swc_id=TIMESTAMP_DEPENDENCE, + bytecode=state.environment.code.bytecode, + title="Dependence on predictable environment variable", + severity="Low", + description_head="A control flow decision is made based on a predictable variable.", + description_tail=description, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + issues.append(issue) + else: + # we're in post hook + + instructions = state.environment.code.instruction_list + opcode = instructions[state.mstate.pc - 1]["opcode"] + + logging.info("annotating " + str(opcode)) + annotation = PredictableValueAnnotation(opcode) + state.mstate.stack[-1].annotate(annotation) return issues + + +detector = PredictableDependenceModule() From 84849b734b78dc09626c19d14a2776e0f5af49fc Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Fri, 10 May 2019 16:39:07 -0400 Subject: [PATCH 18/97] Remove loggimng --- mythril/analysis/modules/dependence_on_predictable_vars.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 9ce230cc..b041f0fc 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -90,7 +90,6 @@ def _analyze_states(state: GlobalState) -> list: instructions = state.environment.code.instruction_list opcode = instructions[state.mstate.pc - 1]["opcode"] - logging.info("annotating " + str(opcode)) annotation = PredictableValueAnnotation(opcode) state.mstate.stack[-1].annotate(annotation) From c7e401c6bc36db4ddc37a324675806abf16c3335 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Fri, 10 May 2019 16:40:05 -0400 Subject: [PATCH 19/97] Ohoo black --- mythril/analysis/modules/dependence_on_predictable_vars.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index b041f0fc..3ebea3e5 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -34,7 +34,7 @@ class PredictableDependenceModule(DetectionModule): ), entrypoint="callback", pre_hooks=["JUMPI"], - post_hooks=predictable_ops + post_hooks=predictable_ops, ) def execute(self, state: GlobalState) -> list: @@ -63,7 +63,9 @@ def _analyze_states(state: GlobalState) -> list: if state.get_current_instruction()["opcode"] == "JUMPI": for annotation in state.mstate.stack[-2].annotations: if isinstance(annotation, PredictableValueAnnotation): - description = "A control flow decision is made based on block.{}. ".format(annotation.opcode) + description = "A control flow decision is made based on block.{}. ".format( + annotation.opcode + ) description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " From 584064d150d681d7a545f0d234a99dbfa2cc9da2 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 11 May 2019 16:03:40 +0530 Subject: [PATCH 20/97] Set low priority to other internal compiler generated code (#975) * Set low priority to other internal compiler generated code * Remove unused variable * Use the ast to get contract source code * Add docstrings * Remove code filtering for truffle * Update mythril/solidity/soliditycontract.py Co-Authored-By: JoranHonig --- mythril/ethereum/util.py | 2 +- mythril/solidity/soliditycontract.py | 54 ++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/mythril/ethereum/util.py b/mythril/ethereum/util.py index ac80863b..2b6c7771 100644 --- a/mythril/ethereum/util.py +++ b/mythril/ethereum/util.py @@ -33,7 +33,7 @@ def get_solc_json(file, solc_binary="solc", solc_args=None): :return: """ - cmd = [solc_binary, "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime"] + cmd = [solc_binary, "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime,ast"] if solc_args: cmd.extend(solc_args.split()) diff --git a/mythril/solidity/soliditycontract.py b/mythril/solidity/soliditycontract.py index 6f83ead7..05760554 100644 --- a/mythril/solidity/soliditycontract.py +++ b/mythril/solidity/soliditycontract.py @@ -1,5 +1,7 @@ """This module contains representation classes for Solidity files, contracts and source mappings.""" +from typing import Dict, Set + import mythril.laser.ethereum.util as helper from mythril.ethereum.evmcontract import EVMContract from mythril.ethereum.util import get_solc_json @@ -20,9 +22,16 @@ class SourceMapping: class SolidityFile: """Representation of a file containing Solidity code.""" - def __init__(self, filename, data): + def __init__(self, filename: str, data: str, full_contract_source: Set[str]): + """ + Metadata class containing data regarding a specific solidity file + :param filename: The filename of the solidity file + :param data: The code of the solidity file + :param full_contract_source: The set of contract source mappings of all the contracts in the file + """ self.filename = filename self.data = data + self.full_contract_source = full_contract_source class SourceCodeInfo: @@ -69,7 +78,12 @@ class SolidityContract(EVMContract): for filename in data["sourceList"]: with open(filename, "r", encoding="utf-8") as file: code = file.read() - self.solidity_files.append(SolidityFile(filename, code)) + full_contract_sources = self.get_full_contract_sources( + data["sources"][filename]["AST"] + ) + self.solidity_files.append( + SolidityFile(filename, code, full_contract_sources) + ) has_contract = False @@ -117,6 +131,19 @@ class SolidityContract(EVMContract): super().__init__(code, creation_code, name=name) + @staticmethod + def get_full_contract_sources(ast: Dict) -> Set[str]: + """ + Takes a solc AST and gets the src mappings for all the contracts defined in the top level of the ast + :param ast: AST of the contract + :return: The source map + """ + source_map = set() + for child in ast["children"]: + if "contractKind" in child["attributes"]: + source_map.add(child["src"]) + return source_map + def get_source_info(self, address, constructor=False): """ @@ -140,6 +167,26 @@ class SolidityContract(EVMContract): lineno = mappings[index].lineno return SourceCodeInfo(filename, lineno, code, mappings[index].solc_mapping) + def _is_autogenerated_code(self, offset: int, length: int, file_index: int) -> bool: + """ + Checks whether the code is autogenerated or not + :param offset: offset of the code + :param length: length of the code + :param file_index: file the code corresponds to + :return: True if the code is internally generated, else false + """ + # Handle internal compiler files + if file_index == -1: + return True + # Handle the common code src map for the entire code. + if ( + "{}:{}:{}".format(offset, length, file_index) + in self.solidity_files[file_index].full_contract_source + ): + return True + + return False + def _get_solc_mappings(self, srcmap, constructor=False): """ @@ -161,7 +208,8 @@ class SolidityContract(EVMContract): if len(mapping) > 2 and len(mapping[2]) > 0: idx = int(mapping[2]) - if idx == -1: + + if self._is_autogenerated_code(offset, length, idx): lineno = None else: lineno = ( From 58dad6c23fc95d15e04747e3512c36d600f49974 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 11 May 2019 16:17:55 +0530 Subject: [PATCH 21/97] Change the variable name of full_contract_source --- mythril/solidity/soliditycontract.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mythril/solidity/soliditycontract.py b/mythril/solidity/soliditycontract.py index 05760554..f8594701 100644 --- a/mythril/solidity/soliditycontract.py +++ b/mythril/solidity/soliditycontract.py @@ -22,16 +22,16 @@ class SourceMapping: class SolidityFile: """Representation of a file containing Solidity code.""" - def __init__(self, filename: str, data: str, full_contract_source: Set[str]): + def __init__(self, filename: str, data: str, full_contract_src_maps: Set[str]): """ Metadata class containing data regarding a specific solidity file :param filename: The filename of the solidity file :param data: The code of the solidity file - :param full_contract_source: The set of contract source mappings of all the contracts in the file + :param full_contract_src_maps: The set of contract source mappings of all the contracts in the file """ self.filename = filename self.data = data - self.full_contract_source = full_contract_source + self.full_contract_src_maps = full_contract_src_maps class SourceCodeInfo: @@ -78,11 +78,11 @@ class SolidityContract(EVMContract): for filename in data["sourceList"]: with open(filename, "r", encoding="utf-8") as file: code = file.read() - full_contract_sources = self.get_full_contract_sources( + full_contract_src_maps = self.get_full_contract_src_maps( data["sources"][filename]["AST"] ) self.solidity_files.append( - SolidityFile(filename, code, full_contract_sources) + SolidityFile(filename, code, full_contract_src_maps) ) has_contract = False @@ -132,17 +132,17 @@ class SolidityContract(EVMContract): super().__init__(code, creation_code, name=name) @staticmethod - def get_full_contract_sources(ast: Dict) -> Set[str]: + def get_full_contract_src_maps(ast: Dict) -> Set[str]: """ Takes a solc AST and gets the src mappings for all the contracts defined in the top level of the ast :param ast: AST of the contract - :return: The source map + :return: The source maps """ - source_map = set() + source_maps = set() for child in ast["children"]: if "contractKind" in child["attributes"]: - source_map.add(child["src"]) - return source_map + source_maps.add(child["src"]) + return source_maps def get_source_info(self, address, constructor=False): """ @@ -181,7 +181,7 @@ class SolidityContract(EVMContract): # Handle the common code src map for the entire code. if ( "{}:{}:{}".format(offset, length, file_index) - in self.solidity_files[file_index].full_contract_source + in self.solidity_files[file_index].full_contract_src_maps ): return True From 31fd66acf52749d4543200c84b8a388c9ea75c59 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Mon, 13 May 2019 10:58:14 +0200 Subject: [PATCH 22/97] ignore external calls to precompile contracts --- mythril/analysis/modules/external_calls.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index 554cbb93..10f1eaa4 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -5,7 +5,7 @@ from mythril.analysis import solver from mythril.analysis.swc_data import REENTRANCY from mythril.analysis.modules.base import DetectionModule from mythril.analysis.report import Issue -from mythril.laser.smt import UGT, symbol_factory +from mythril.laser.smt import UGT, symbol_factory, Or, BitVec from mythril.laser.ethereum.state.global_state import GlobalState from mythril.exceptions import UnsatError from copy import copy @@ -71,6 +71,8 @@ def _analyze_state(state): ) except UnsatError: + if _is_precompile_call(state): + return [] log.debug( "[EXTERNAL_CALLS] Callee address cannot be modified. Reporting informational issue." @@ -104,6 +106,22 @@ def _analyze_state(state): return [issue] +def _is_precompile_call(global_state: GlobalState): + to = global_state.mstate.stack[-2] # type: BitVec + try: + constraints = copy(global_state.mstate.constraints) + constraints += [ + Or( + to < symbol_factory.BitVecVal(1, 256), + to > symbol_factory.BitVecVal(16, 256), + ) + ] + solver.get_model(constraints) + return False + except UnsatError: + return True + + class ExternalCalls(DetectionModule): """This module searches for low level calls (e.g. call.value()) that forward all gas to the callee.""" From 9175a1975fd84519534589e88f0827c73e188b42 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 13 May 2019 22:26:37 +0200 Subject: [PATCH 23/97] First implementation of blockhash handling --- .../modules/dependence_on_predictable_vars.py | 34 +++++++++++++++++-- mythril/laser/ethereum/instructions.py | 2 +- mythril/laser/ethereum/state/environment.py | 1 + 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 3ebea3e5..26f414a5 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -4,14 +4,23 @@ import logging from mythril.analysis.modules.base import DetectionModule from mythril.analysis.report import Issue +from mythril.exceptions import UnsatError +from mythril.analysis import solver +from mythril.laser.smt import ULT from mythril.analysis.swc_data import TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS from mythril.laser.ethereum.state.global_state import GlobalState +from mythril.laser.ethereum.state.annotation import StateAnnotation +import traceback log = logging.getLogger(__name__) predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] +def is_prehook(): + return "pre_hook" in traceback.format_stack()[-2] + + class PredictableValueAnnotation: """ Symbol Annotation used if a variable is initialized from a predictable environment variable""" @@ -19,6 +28,12 @@ class PredictableValueAnnotation: self.opcode = opcode +class TaintBlockHashAnnotation(StateAnnotation): + + def __init__(self) -> None: + pass + + class PredictableDependenceModule(DetectionModule): """This module detects whether control flow decisions are made using predictable parameters.""" @@ -33,8 +48,8 @@ class PredictableDependenceModule(DetectionModule): "block.gaslimit, block.timestamp or block.number." ), entrypoint="callback", - pre_hooks=["JUMPI"], - post_hooks=predictable_ops, + pre_hooks=["BLOCKHASH", "JUMPI"], + post_hooks=["BLOCKHASH"] + predictable_ops, ) def execute(self, state: GlobalState) -> list: @@ -86,6 +101,21 @@ def _analyze_states(state: GlobalState) -> list: gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), ) issues.append(issue) + elif state.get_current_instruction()["opcode"] == "BLOCKHASH": + if is_prehook(): + + param = state.mstate.stack[-1] + + try: + solver.get_model(ULT(param, state.environment.block_number)) + state.annotate(TaintBlockHashAnnotation) + + except UnsatError: + pass + else: + for annotation in state.annotations: + if isinstance(annotation, TaintBlockHashAnnotation): + state.mstate.stack[-1].annotate(PredictableValueAnnotation("BLOCKHASH")) else: # we're in post hook diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index b6bb61cd..1aba8420 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1243,7 +1243,7 @@ class Instruction: :param global_state: :return: """ - global_state.mstate.stack.append(global_state.new_bitvec("block_number", 256)) + global_state.mstate.stack.append(global_state.environment.block_number) return [global_state] @StateTransition() diff --git a/mythril/laser/ethereum/state/environment.py b/mythril/laser/ethereum/state/environment.py index 69830007..a8c257fd 100644 --- a/mythril/laser/ethereum/state/environment.py +++ b/mythril/laser/ethereum/state/environment.py @@ -40,6 +40,7 @@ class Environment: self.active_function_name = "" self.address = symbol_factory.BitVecVal(int(active_account.address, 16), 256) + self.block_number = symbol_factory.BitVecSym("block_number", 256) # Ib self.code = active_account.code if code is None else code From cad6f5ae35828c36b9969c9b27436dcc2a2c0793 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 13 May 2019 23:39:38 +0200 Subject: [PATCH 24/97] Add differentiation between blockhash of previous and current/future block numbers --- .../modules/dependence_on_predictable_vars.py | 60 ++++++++++++------- mythril/laser/ethereum/instructions.py | 6 +- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 26f414a5..c2dd61a0 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -6,7 +6,7 @@ from mythril.analysis.modules.base import DetectionModule from mythril.analysis.report import Issue from mythril.exceptions import UnsatError from mythril.analysis import solver -from mythril.laser.smt import ULT +from mythril.laser.smt import ULT, symbol_factory from mythril.analysis.swc_data import TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS from mythril.laser.ethereum.state.global_state import GlobalState from mythril.laser.ethereum.state.annotation import StateAnnotation @@ -18,7 +18,7 @@ predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] def is_prehook(): - return "pre_hook" in traceback.format_stack()[-2] + return "pre_hook" in traceback.format_stack()[-4] class PredictableValueAnnotation: @@ -28,7 +28,7 @@ class PredictableValueAnnotation: self.opcode = opcode -class TaintBlockHashAnnotation(StateAnnotation): +class OldBlockNumberUsedAnnotation(StateAnnotation): def __init__(self) -> None: pass @@ -59,7 +59,7 @@ class PredictableDependenceModule(DetectionModule): :return: """ - log.info("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") + log.debug("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") self._issues.extend(_analyze_states(state)) return self.issues @@ -78,14 +78,12 @@ def _analyze_states(state: GlobalState) -> list: if state.get_current_instruction()["opcode"] == "JUMPI": for annotation in state.mstate.stack[-2].annotations: if isinstance(annotation, PredictableValueAnnotation): - description = "A control flow decision is made based on block.{}. ".format( - annotation.opcode - ) - + description = "The " + annotation.opcode + " is used in an if-statement. " description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " - "are predictable and can be manipulated by a malicious miner. " - "Don't use them for random number generation or to make critical control flow decisions." + "are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers " + "know hashes of earlier blocks. Don't use any of those environment variables for random number " + "generation or to make critical control flow decisions." ) issue = Issue( @@ -96,34 +94,54 @@ def _analyze_states(state: GlobalState) -> list: bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", severity="Low", - description_head="A control flow decision is made based on a predictable variable.", + description_head="Control flow decision is made based on a predictable variable.", description_tail=description, gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), ) issues.append(issue) + + # Now the magic starts! + elif state.get_current_instruction()["opcode"] == "BLOCKHASH": if is_prehook(): param = state.mstate.stack[-1] try: - solver.get_model(ULT(param, state.environment.block_number)) - state.annotate(TaintBlockHashAnnotation) + constraint =[ULT(param, state.environment.block_number), + ULT(state.environment.block_number, symbol_factory.BitVecVal(2 ** 255, 256))] + + # Why the second constraint? Because otherwise, Z3 returns a solution where param overflows. + + solver.get_model(constraint) + state.annotate(OldBlockNumberUsedAnnotation) except UnsatError: pass - else: - for annotation in state.annotations: - if isinstance(annotation, TaintBlockHashAnnotation): - state.mstate.stack[-1].annotate(PredictableValueAnnotation("BLOCKHASH")) + else: # we're in post hook - instructions = state.environment.code.instruction_list - opcode = instructions[state.mstate.pc - 1]["opcode"] + if state.environment.code.instruction_list[state.mstate.pc - 1]["opcode"] == "BLOCKHASH": + # if we're in the post hook of a BLOCKHASH op, check if an old block number was used to create it. + + for annotation in state.annotations: + + ''' + FIXME: for some reason, isinstance(annotation, OldBlockNumberUsedAnnotation) always returns false. + I added a string comparison as a workaround. + ''' + + if isinstance(annotation, OldBlockNumberUsedAnnotation) or "OldBlockNumber" in str(annotation): + state.mstate.stack[-1].annotate(PredictableValueAnnotation("block hash of a previous block")) + else: + # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is called. + + instructions = state.environment.code.instruction_list + opcode = instructions[state.mstate.pc - 1]["opcode"] - annotation = PredictableValueAnnotation(opcode) - state.mstate.stack[-1].annotate(annotation) + annotation = PredictableValueAnnotation("block." + opcode.lower() + "environment variable") + state.mstate.stack[-1].annotate(annotation) return issues diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 1aba8420..4ada9216 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -913,7 +913,7 @@ class Instruction: if isinstance(op0, Expression): op0 = simplify(op0) state.stack.append( - symbol_factory.BitVecSym("KECCAC_mem[" + str(op0) + "]", 256) + symbol_factory.BitVecSym("KECCAC_mem[" + str(op0) + "]", 256, op0.annotations) ) gas_tuple = cast(Tuple, OPCODE_GAS["SHA3"]) state.min_gas_used += gas_tuple[0] @@ -941,7 +941,7 @@ class Instruction: if data.symbolic: argument_str = str(state.memory[index]).replace(" ", "_") result = symbol_factory.BitVecFuncSym( - "KECCAC[{}]".format(argument_str), "keccak256", 256, input_=data + "KECCAC[{}]".format(argument_str), "keccak256", 256, input_=data, annotations=op0.annotations ) log.debug("Created BitVecFunc hash.") @@ -949,7 +949,7 @@ class Instruction: else: keccak = utils.sha3(data.value.to_bytes(length, byteorder="big")) result = symbol_factory.BitVecFuncVal( - util.concrete_int_from_bytes(keccak, 0), "keccak256", 256, input_=data + util.concrete_int_from_bytes(keccak, 0), "keccak256", 256, input_=data, annotations=op0.annotations ) log.debug("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) From 3d35f905e4990a5c97dfba3f31b32c6b2e2098dc Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 13 May 2019 23:41:36 +0200 Subject: [PATCH 25/97] Traditionally, add black formatting --- .../modules/dependence_on_predictable_vars.py | 37 +++++++++++++------ mythril/laser/ethereum/instructions.py | 16 ++++++-- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index c2dd61a0..dd1e189f 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -29,7 +29,6 @@ class PredictableValueAnnotation: class OldBlockNumberUsedAnnotation(StateAnnotation): - def __init__(self) -> None: pass @@ -78,7 +77,9 @@ def _analyze_states(state: GlobalState) -> list: if state.get_current_instruction()["opcode"] == "JUMPI": for annotation in state.mstate.stack[-2].annotations: if isinstance(annotation, PredictableValueAnnotation): - description = "The " + annotation.opcode + " is used in an if-statement. " + description = ( + "The " + annotation.opcode + " is used in an if-statement. " + ) description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " "are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers " @@ -108,8 +109,13 @@ def _analyze_states(state: GlobalState) -> list: param = state.mstate.stack[-1] try: - constraint =[ULT(param, state.environment.block_number), - ULT(state.environment.block_number, symbol_factory.BitVecVal(2 ** 255, 256))] + constraint = [ + ULT(param, state.environment.block_number), + ULT( + state.environment.block_number, + symbol_factory.BitVecVal(2 ** 255, 256), + ), + ] # Why the second constraint? Because otherwise, Z3 returns a solution where param overflows. @@ -122,25 +128,34 @@ def _analyze_states(state: GlobalState) -> list: else: # we're in post hook - if state.environment.code.instruction_list[state.mstate.pc - 1]["opcode"] == "BLOCKHASH": + if ( + state.environment.code.instruction_list[state.mstate.pc - 1]["opcode"] + == "BLOCKHASH" + ): # if we're in the post hook of a BLOCKHASH op, check if an old block number was used to create it. for annotation in state.annotations: - ''' + """ FIXME: for some reason, isinstance(annotation, OldBlockNumberUsedAnnotation) always returns false. I added a string comparison as a workaround. - ''' - - if isinstance(annotation, OldBlockNumberUsedAnnotation) or "OldBlockNumber" in str(annotation): - state.mstate.stack[-1].annotate(PredictableValueAnnotation("block hash of a previous block")) + """ + + if isinstance( + annotation, OldBlockNumberUsedAnnotation + ) or "OldBlockNumber" in str(annotation): + state.mstate.stack[-1].annotate( + PredictableValueAnnotation("block hash of a previous block") + ) else: # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is called. instructions = state.environment.code.instruction_list opcode = instructions[state.mstate.pc - 1]["opcode"] - annotation = PredictableValueAnnotation("block." + opcode.lower() + "environment variable") + annotation = PredictableValueAnnotation( + "block." + opcode.lower() + "environment variable" + ) state.mstate.stack[-1].annotate(annotation) return issues diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 4ada9216..c8090400 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -913,7 +913,9 @@ class Instruction: if isinstance(op0, Expression): op0 = simplify(op0) state.stack.append( - symbol_factory.BitVecSym("KECCAC_mem[" + str(op0) + "]", 256, op0.annotations) + symbol_factory.BitVecSym( + "KECCAC_mem[" + str(op0) + "]", 256, op0.annotations + ) ) gas_tuple = cast(Tuple, OPCODE_GAS["SHA3"]) state.min_gas_used += gas_tuple[0] @@ -941,7 +943,11 @@ class Instruction: if data.symbolic: argument_str = str(state.memory[index]).replace(" ", "_") result = symbol_factory.BitVecFuncSym( - "KECCAC[{}]".format(argument_str), "keccak256", 256, input_=data, annotations=op0.annotations + "KECCAC[{}]".format(argument_str), + "keccak256", + 256, + input_=data, + annotations=op0.annotations, ) log.debug("Created BitVecFunc hash.") @@ -949,7 +955,11 @@ class Instruction: else: keccak = utils.sha3(data.value.to_bytes(length, byteorder="big")) result = symbol_factory.BitVecFuncVal( - util.concrete_int_from_bytes(keccak, 0), "keccak256", 256, input_=data, annotations=op0.annotations + util.concrete_int_from_bytes(keccak, 0), + "keccak256", + 256, + input_=data, + annotations=op0.annotations, ) log.debug("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) From dc1963c316af782928ad2678410e0c7499a74976 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 13 May 2019 23:51:49 +0200 Subject: [PATCH 26/97] Improve report formatting --- mythril/analysis/modules/dependence_on_predictable_vars.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index dd1e189f..09da72e7 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -78,7 +78,7 @@ def _analyze_states(state: GlobalState) -> list: for annotation in state.mstate.stack[-2].annotations: if isinstance(annotation, PredictableValueAnnotation): description = ( - "The " + annotation.opcode + " is used in an if-statement. " + "The " + annotation.opcode + " is used in a conditional statement. " ) description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " @@ -95,7 +95,7 @@ def _analyze_states(state: GlobalState) -> list: bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", severity="Low", - description_head="Control flow decision is made based on a predictable variable.", + description_head="A control flow decision is made based on a predictable variable.", description_tail=description, gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), ) @@ -154,7 +154,7 @@ def _analyze_states(state: GlobalState) -> list: opcode = instructions[state.mstate.pc - 1]["opcode"] annotation = PredictableValueAnnotation( - "block." + opcode.lower() + "environment variable" + "block." + opcode.lower() + " environment variable" ) state.mstate.stack[-1].annotate(annotation) From 1b891fafaec18738cee4de4590ea3d177494f4f1 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 00:12:26 +0200 Subject: [PATCH 27/97] Fix wrong instantiation of OldBlockNumberUsedAnnotation --- mythril/analysis/modules/dependence_on_predictable_vars.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 09da72e7..7d9b2d5e 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -120,7 +120,7 @@ def _analyze_states(state: GlobalState) -> list: # Why the second constraint? Because otherwise, Z3 returns a solution where param overflows. solver.get_model(constraint) - state.annotate(OldBlockNumberUsedAnnotation) + state.annotate(OldBlockNumberUsedAnnotation()) except UnsatError: pass @@ -141,9 +141,7 @@ def _analyze_states(state: GlobalState) -> list: I added a string comparison as a workaround. """ - if isinstance( - annotation, OldBlockNumberUsedAnnotation - ) or "OldBlockNumber" in str(annotation): + if isinstance(annotation, OldBlockNumberUsedAnnotation): state.mstate.stack[-1].annotate( PredictableValueAnnotation("block hash of a previous block") ) From 7716a2a414538d8060f873b9f3ad5fba616f4d07 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Tue, 14 May 2019 03:08:40 +0200 Subject: [PATCH 28/97] Temporary disables full Edelweiss test + up to 5 retries of the quick one --- .circleci/config.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 54e4c512..46a67785 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,12 +108,14 @@ jobs: command: sleep 15s - run: name: Quick Edelweiss test - command: /home/run-edelweiss-test.sh CircleCI/latest.quick.csv - - run: - name: Full Edelweiss test - environment: - MYTHX_API_FULL_MODE: true - command: /home/run-edelweiss-test.sh CircleCI/latest.full.csv + command: /home/run-edelweiss-test.sh CircleCI/latest.quick.csv 5 + + # TODO: Temporary disabled + # - run: + # name: Full Edelweiss test + # environment: + # MYTHX_API_FULL_MODE: true + # command: /home/run-edelweiss-test.sh CircleCI/latest.full.csv pypi_release: <<: *defaults From 982cb8ee746d88977faeda92d92ace0e6147a0d7 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 05:15:19 +0200 Subject: [PATCH 29/97] Narrow down findings to instances of CALL and SUICIDE reached via predictable control flow decision --- .../modules/dependence_on_predictable_vars.py | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 7d9b2d5e..532682de 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -15,6 +15,7 @@ import traceback log = logging.getLogger(__name__) predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] +critical_ops = ["CALL", "SUICIDE"] def is_prehook(): @@ -22,13 +23,23 @@ def is_prehook(): class PredictableValueAnnotation: - """ Symbol Annotation used if a variable is initialized from a predictable environment variable""" + """Symbol annotation used if a variable is initialized from a predictable environment variable.""" - def __init__(self, opcode) -> None: - self.opcode = opcode + def __init__(self, operation) -> None: + self.operation = operation + + +class PredictablePathAnnotation(StateAnnotation): + """State annotation used when a path is chosen based on a predictable variable.""" + + def __init__(self, operation, location) -> None: + self.operation = operation + self.location = location class OldBlockNumberUsedAnnotation(StateAnnotation): + """State annotation set in blockhash prehook if the input value is lower than the current block number.""" + def __init__(self) -> None: pass @@ -43,11 +54,11 @@ class PredictableDependenceModule(DetectionModule): name="Dependence of Predictable Variables", swc_id="{} {}".format(TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS), description=( - "Check whether control flow decisions are influenced by block.coinbase," + "Check whether important control flow decisions are influenced by block.coinbase," "block.gaslimit, block.timestamp or block.number." ), entrypoint="callback", - pre_hooks=["BLOCKHASH", "JUMPI"], + pre_hooks=["BLOCKHASH", "JUMPI"] + critical_ops, post_hooks=["BLOCKHASH"] + predictable_ops, ) @@ -70,15 +81,20 @@ def _analyze_states(state: GlobalState) -> list: :param state: :return: """ - issues = [] # Look for predictable state variables in jump condition - if state.get_current_instruction()["opcode"] == "JUMPI": - for annotation in state.mstate.stack[-2].annotations: - if isinstance(annotation, PredictableValueAnnotation): + issues = [] + opcode = state.get_current_instruction()["opcode"] + + if opcode in critical_ops: + for annotation in state.annotations: + + if isinstance(annotation, PredictablePathAnnotation): description = ( - "The " + annotation.opcode + " is used in a conditional statement. " + "The " + + annotation.operation + + " is used in to determine an important control flow decision. " ) description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " @@ -101,6 +117,15 @@ def _analyze_states(state: GlobalState) -> list: ) issues.append(issue) + elif opcode == "JUMPI": + for annotation in state.mstate.stack[-2].annotations: + if isinstance(annotation, PredictableValueAnnotation): + state.annotate( + PredictablePathAnnotation( + annotation.operation, state.get_current_instruction()["address"] + ) + ) + # Now the magic starts! elif state.get_current_instruction()["opcode"] == "BLOCKHASH": @@ -117,7 +142,7 @@ def _analyze_states(state: GlobalState) -> list: ), ] - # Why the second constraint? Because otherwise, Z3 returns a solution where param overflows. + # Why the second constraint? Because without it Z3 returns a solution where param overflows. solver.get_model(constraint) state.annotate(OldBlockNumberUsedAnnotation()) @@ -136,11 +161,6 @@ def _analyze_states(state: GlobalState) -> list: for annotation in state.annotations: - """ - FIXME: for some reason, isinstance(annotation, OldBlockNumberUsedAnnotation) always returns false. - I added a string comparison as a workaround. - """ - if isinstance(annotation, OldBlockNumberUsedAnnotation): state.mstate.stack[-1].annotate( PredictableValueAnnotation("block hash of a previous block") From c35b6b35bdc02c26ad401f809d8d3645d74efdb9 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 05:40:02 +0200 Subject: [PATCH 30/97] Correctly propagate annotations in sha3 (from indexed memory) --- .../analysis/modules/dependence_on_predictable_vars.py | 1 + mythril/laser/ethereum/instructions.py | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 532682de..49b3a73c 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -118,6 +118,7 @@ def _analyze_states(state: GlobalState) -> list: issues.append(issue) elif opcode == "JUMPI": + for annotation in state.mstate.stack[-2].annotations: if isinstance(annotation, PredictableValueAnnotation): state.annotate( diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index c8090400..dcea0d20 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -913,9 +913,7 @@ class Instruction: if isinstance(op0, Expression): op0 = simplify(op0) state.stack.append( - symbol_factory.BitVecSym( - "KECCAC_mem[" + str(op0) + "]", 256, op0.annotations - ) + symbol_factory.BitVecSym("KECCAC_mem[" + str(op0) + "]", 256) ) gas_tuple = cast(Tuple, OPCODE_GAS["SHA3"]) state.min_gas_used += gas_tuple[0] @@ -947,7 +945,7 @@ class Instruction: "keccak256", 256, input_=data, - annotations=op0.annotations, + annotations=state.memory[index].annotations, ) log.debug("Created BitVecFunc hash.") @@ -959,9 +957,9 @@ class Instruction: "keccak256", 256, input_=data, - annotations=op0.annotations, + annotations=state.memory[index].annotations, ) - log.debug("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) + log.info("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) state.stack.append(result) return [global_state] From f2eae2f092c9f4a39018973fbb5a89e52b79b9d6 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 05:52:21 +0200 Subject: [PATCH 31/97] Minor changes --- mythril/analysis/modules/dependence_on_predictable_vars.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 49b3a73c..789a5ac7 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -88,6 +88,8 @@ def _analyze_states(state: GlobalState) -> list: opcode = state.get_current_instruction()["opcode"] if opcode in critical_ops: + logging.info(str(state.annotations)) + for annotation in state.annotations: if isinstance(annotation, PredictablePathAnnotation): @@ -167,7 +169,7 @@ def _analyze_states(state: GlobalState) -> list: PredictableValueAnnotation("block hash of a previous block") ) else: - # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is called. + # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is executed. instructions = state.environment.code.instruction_list opcode = instructions[state.mstate.pc - 1]["opcode"] From b14efd30b1be8d1f09b82aaf4909e019444ff066 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 05:59:47 +0200 Subject: [PATCH 32/97] Remove debugging (and take a break) --- 1 | 286 ++++++++++++++++++ .../modules/dependence_on_predictable_vars.py | 1 - 2 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 00000000..07770b5e --- /dev/null +++ b/1 @@ -0,0 +1,286 @@ +mythril.support.signatures [INFO]: Using signature database at /Users/bernhardmueller/.mythril/signatures.db +mythril.analysis.security [INFO]: Found 0 detection modules +mythril.laser.ethereum.svm [INFO]: LASER EVM initialized with dynamic loader: +mythril.laser.ethereum.plugins.plugin_loader [INFO]: Loading plugin: +mythril.laser.ethereum.plugins.plugin_loader [INFO]: Loading plugin: +mythril.analysis.security [INFO]: Found 11 detection modules +mythril.analysis.security [INFO]: Found 11 detection modules +mythril.laser.ethereum.svm [DEBUG]: Starting LASER execution +mythril.laser.ethereum.svm [INFO]: Starting contract creation transaction +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE +mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH8 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating NUMBER +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB +mythril.laser.ethereum.instructions [DEBUG]: Evaluating BLOCKHASH +mythril.laser.ethereum.instructions [DEBUG]: Evaluating TIMESTAMP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD +mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] +mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP4 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE +mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[96]: 115792089237316195423570985008687907853269984665640564039457584007913129639935 - +0 & +115792089237316195423570985008687907853269984665640564039457584007913129639935 - +0 & +1_blockhash_block_block_number - 1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP3 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE +mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[128]: 1_timestamp +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP3 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD +mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] +mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SHA3 +mythril.laser.ethereum.instructions [DEBUG]: Created BitVecFunc hash. +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EXP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SLOAD +mythril.laser.ethereum.instructions [DEBUG]: Storage access at index 0 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MUL +mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP4 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MUL +mythril.laser.ethereum.instructions [DEBUG]: Evaluating OR +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SSTORE +mythril.laser.ethereum.instructions [DEBUG]: Write to storage[0] +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CODECOPY +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating RETURN +mythril.laser.ethereum.svm [INFO]: Finished contract creation, found 1 open states +mythril.laser.ethereum.svm [INFO]: Starting message call transaction, iteration: 0, 1 initial states +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE +mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATASIZE +mythril.laser.ethereum.instructions [DEBUG]: Evaluating LT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATALOAD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH29 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.svm [DEBUG]: - Entering function MAIN:unknown +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.svm [DEBUG]: - Entering function MAIN:unknown +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATALOAD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADDRESS +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH20 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH8 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating BALANCE +mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD +mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] +mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP3 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SLOAD +mythril.laser.ethereum.instructions [DEBUG]: Storage access at index 0 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EXP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE +mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[96]: If(If(If(If(2_balance_at_1461501637330902918203684832716283019655932542975 & +51421440056055728346017419001665401074216449311 == + 0, + 0, + 1) == + 0, + 1, + 0) == + 0, + 1, + 0) == + 0, + 1, + 0) +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND +mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD +mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] +mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ +mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI +mythril.laser.ethereum.instructions [DEBUG]: Pruned unreachable states. +mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating RETURN +mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP +mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST +mythril.laser.ethereum.instructions [DEBUG]: Evaluating STOP +mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Number of new instructions covered in tx 0: 131 +mythril.laser.ethereum.svm [INFO]: Starting message call transaction, iteration: 1, 0 initial states +mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Number of new instructions covered in tx 1: 0 +mythril.laser.ethereum.svm [INFO]: Finished symbolic execution +mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Achieved 31.85% coverage for code: 6060604052670de0b6b3a76400003414151561001a57600080fd5b600143034042604051808360001916600019168152602001828152602001925050506040518091039020600190046000806101000a81548160ff021916908360ff160217905550610164806100706000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ba4c16b14610051578063b2fa1c9e1461006c575b600080fd5b61006a600480803560ff16906020019091905050610099565b005b341561007757600080fd5b61007f610117565b604051808215151515815260200191505060405180910390f35b670de0b6b3a7640000341415156100af57600080fd5b6000809054906101000a900460ff1660ff168160ff161415610114573373ffffffffffffffffffffffffffffffffffffffff166108fc671bc16d674ec800009081150290604051600060405180830381858888f19350505050151561011357600080fd5b5b50565b6000803073ffffffffffffffffffffffffffffffffffffffff1631149050905600a165627a7a72305820e70964dd89df0e5b2cf45faf9eecd590a00131d465ed3f65857d843d01c130270029 +mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Achieved 77.98% coverage for code: 60606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ba4c16b14610051578063b2fa1c9e1461006c575b600080fd5b61006a600480803560ff16906020019091905050610099565b005b341561007757600080fd5b61007f610117565b604051808215151515815260200191505060405180910390f35b670de0b6b3a7640000341415156100af57600080fd5b6000809054906101000a900460ff1660ff168160ff161415610114573373ffffffffffffffffffffffffffffffffffffffff166108fc671bc16d674ec800009081150290604051600060405180830381858888f19350505050151561011357600080fd5b5b50565b6000803073ffffffffffffffffffffffffffffffffffffffff1631149050905600a165627a7a72305820e70964dd89df0e5b2cf45faf9eecd590a00131d465ed3f65857d843d01c130270029 +mythril.analysis.security [INFO]: Starting analysis +mythril.analysis.security [INFO]: Found 0 detection modules +mythril.analysis.security [INFO]: Found 11 detection modules +mythril.analysis.security [DEBUG]: Retrieving results for DELEGATECALL Usage in Fallback Function +mythril.analysis.security [DEBUG]: Retrieving results for Dependence of Predictable Variables +mythril.analysis.security [DEBUG]: Retrieving results for Deprecated Operations +mythril.analysis.security [DEBUG]: Retrieving results for Ether Thief +mythril.analysis.security [DEBUG]: Retrieving results for Reachable Exceptions +mythril.analysis.security [DEBUG]: Retrieving results for External calls +mythril.analysis.security [DEBUG]: Retrieving results for Integer Overflow and Underflow +mythril.analysis.security [DEBUG]: Retrieving results for Multiple Sends +mythril.analysis.security [DEBUG]: Retrieving results for State Change After External calls +mythril.analysis.security [DEBUG]: Retrieving results for Unprotected Selfdestruct +mythril.analysis.security [DEBUG]: Retrieving results for Unchecked Return Value +mythril.analysis.security [INFO]: Found 11 detection modules +mythril.mythril.mythril_analyzer [INFO]: Solver statistics: +Query count: 35 +Solver time: 0.3555266857147217 diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 789a5ac7..3ad31ecf 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -88,7 +88,6 @@ def _analyze_states(state: GlobalState) -> list: opcode = state.get_current_instruction()["opcode"] if opcode in critical_ops: - logging.info(str(state.annotations)) for annotation in state.annotations: From 07ab25323cc9c20d7b0820b487bf132eb88b041e Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 06:12:44 +0200 Subject: [PATCH 33/97] Don't attempt to access annotations from concrete ints --- mythril/laser/ethereum/instructions.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index dcea0d20..4194d136 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -953,13 +953,9 @@ class Instruction: else: keccak = utils.sha3(data.value.to_bytes(length, byteorder="big")) result = symbol_factory.BitVecFuncVal( - util.concrete_int_from_bytes(keccak, 0), - "keccak256", - 256, - input_=data, - annotations=state.memory[index].annotations, + util.concrete_int_from_bytes(keccak, 0), "keccak256", 256, input_=data ) - log.info("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) + log.debug("Computed SHA3 Hash: " + str(binascii.hexlify(keccak))) state.stack.append(result) return [global_state] From 00de5335070c4dda6c6fd53edb37f9133af4ff64 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 06:21:23 +0200 Subject: [PATCH 34/97] Hopefully fix CircleCI complaint --- mythril/analysis/modules/dependence_on_predictable_vars.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 3ad31ecf..94268961 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -173,10 +173,11 @@ def _analyze_states(state: GlobalState) -> list: instructions = state.environment.code.instruction_list opcode = instructions[state.mstate.pc - 1]["opcode"] - annotation = PredictableValueAnnotation( - "block." + opcode.lower() + " environment variable" + state.mstate.stack[-1].annotate( + PredictableValueAnnotation( + "block." + opcode.lower() + " environment variable" + ) ) - state.mstate.stack[-1].annotate(annotation) return issues From 6887fbdc06e1953c487a5bdafe0ae80f999c3840 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Tue, 14 May 2019 10:41:52 +0200 Subject: [PATCH 35/97] move constraint creation out of try context --- mythril/analysis/modules/external_calls.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index 10f1eaa4..e24470a6 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -108,14 +108,15 @@ def _analyze_state(state): def _is_precompile_call(global_state: GlobalState): to = global_state.mstate.stack[-2] # type: BitVec + constraints = copy(global_state.mstate.constraints) + constraints += [ + Or( + to < symbol_factory.BitVecVal(1, 256), + to > symbol_factory.BitVecVal(16, 256), + ) + ] + try: - constraints = copy(global_state.mstate.constraints) - constraints += [ - Or( - to < symbol_factory.BitVecVal(1, 256), - to > symbol_factory.BitVecVal(16, 256), - ) - ] solver.get_model(constraints) return False except UnsatError: From 474582f8266fd3634b419ccd99455b570fd86ac6 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 18:48:09 +0200 Subject: [PATCH 36/97] General refactoring --- .../modules/dependence_on_predictable_vars.py | 91 +++++++++---------- mythril/laser/ethereum/instructions.py | 7 +- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 94268961..34e1826c 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -82,56 +82,57 @@ def _analyze_states(state: GlobalState) -> list: :return: """ - # Look for predictable state variables in jump condition - issues = [] - opcode = state.get_current_instruction()["opcode"] - if opcode in critical_ops: + if is_prehook(): - for annotation in state.annotations: + opcode = state.get_current_instruction()["opcode"] - if isinstance(annotation, PredictablePathAnnotation): - description = ( - "The " - + annotation.operation - + " is used in to determine an important control flow decision. " - ) - description += ( - "Note that the values of variables like coinbase, gaslimit, block number and timestamp " - "are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers " - "know hashes of earlier blocks. Don't use any of those environment variables for random number " - "generation or to make critical control flow decisions." - ) + if opcode in critical_ops: - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=state.get_current_instruction()["address"], - swc_id=TIMESTAMP_DEPENDENCE, - bytecode=state.environment.code.bytecode, - title="Dependence on predictable environment variable", - severity="Low", - description_head="A control flow decision is made based on a predictable variable.", - description_tail=description, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - issues.append(issue) + for annotation in state.annotations: - elif opcode == "JUMPI": + if isinstance(annotation, PredictablePathAnnotation): + description = ( + "The " + + annotation.operation + + " is used in to determine an important control flow decision. " + ) + description += ( + "Note that the values of variables like coinbase, gaslimit, block number and timestamp " + "are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers " + "know hashes of earlier blocks. Don't use any of those environment variables for random number " + "generation or to make critical control flow decisions." + ) - for annotation in state.mstate.stack[-2].annotations: - if isinstance(annotation, PredictableValueAnnotation): - state.annotate( - PredictablePathAnnotation( - annotation.operation, state.get_current_instruction()["address"] + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=state.get_current_instruction()["address"], + swc_id=TIMESTAMP_DEPENDENCE, + bytecode=state.environment.code.bytecode, + title="Dependence on predictable environment variable", + severity="Low", + description_head="A control flow decision is made based on a predictable variable.", + description_tail=description, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), ) - ) + issues.append(issue) + + elif opcode == "JUMPI": + + # Look for predictable state variables in jump condition - # Now the magic starts! + for annotation in state.mstate.stack[-2].annotations: + if isinstance(annotation, PredictableValueAnnotation): + state.annotate( + PredictablePathAnnotation( + annotation.operation, + state.get_current_instruction()["address"], + ) + ) - elif state.get_current_instruction()["opcode"] == "BLOCKHASH": - if is_prehook(): + elif opcode == "BLOCKHASH": param = state.mstate.stack[-1] @@ -155,10 +156,9 @@ def _analyze_states(state: GlobalState) -> list: else: # we're in post hook - if ( - state.environment.code.instruction_list[state.mstate.pc - 1]["opcode"] - == "BLOCKHASH" - ): + opcode = state.environment.code.instruction_list[state.mstate.pc - 1]["opcode"] + + if opcode == "BLOCKHASH": # if we're in the post hook of a BLOCKHASH op, check if an old block number was used to create it. for annotation in state.annotations: @@ -170,9 +170,6 @@ def _analyze_states(state: GlobalState) -> list: else: # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is executed. - instructions = state.environment.code.instruction_list - opcode = instructions[state.mstate.pc - 1]["opcode"] - state.mstate.stack[-1].annotate( PredictableValueAnnotation( "block." + opcode.lower() + " environment variable" diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 4194d136..d4f000df 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -203,6 +203,9 @@ class Instruction: end_time = datetime.now() self.iprof.record(op, start_time, end_time) + for st in global_state.mstate.stack: + logging.debug(st) + return result @StateTransition() @@ -895,7 +898,7 @@ class Instruction: return [global_state] @StateTransition(enable_gas=False) - def sha3_(self, global_state: GlobalState) -> List[GlobalState]: + def sha3_(selxf, global_state: GlobalState) -> List[GlobalState]: """ :param global_state: @@ -1591,6 +1594,8 @@ class Instruction: op0, condition = state.stack.pop(), state.stack.pop() + logging.debug(str(condition)) + try: jump_addr = util.get_concrete_int(op0) except TypeError: From cc63cda26ffae5e766dd53771d74b49096cec093 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 15 May 2019 06:07:44 +0200 Subject: [PATCH 37/97] Refine module --- .../modules/dependence_on_predictable_vars.py | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 34e1826c..5cb26202 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -15,10 +15,13 @@ import traceback log = logging.getLogger(__name__) predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] -critical_ops = ["CALL", "SUICIDE"] +final_ops = ["CALL", "SUICIDE", "STOP"] +# One of Bernhard's trademark hacks! + def is_prehook(): + """Check if we are in prehook.""" return "pre_hook" in traceback.format_stack()[-4] @@ -32,7 +35,7 @@ class PredictableValueAnnotation: class PredictablePathAnnotation(StateAnnotation): """State annotation used when a path is chosen based on a predictable variable.""" - def __init__(self, operation, location) -> None: + def __init__(self, operation: str, location: int) -> None: self.operation = operation self.location = location @@ -58,7 +61,7 @@ class PredictableDependenceModule(DetectionModule): "block.gaslimit, block.timestamp or block.number." ), entrypoint="callback", - pre_hooks=["BLOCKHASH", "JUMPI"] + critical_ops, + pre_hooks=["BLOCKHASH", "JUMPI"] + final_ops, post_hooks=["BLOCKHASH"] + predictable_ops, ) @@ -88,7 +91,7 @@ def _analyze_states(state: GlobalState) -> list: opcode = state.get_current_instruction()["opcode"] - if opcode in critical_ops: + if opcode in final_ops: for annotation in state.annotations: @@ -105,14 +108,28 @@ def _analyze_states(state: GlobalState) -> list: "generation or to make critical control flow decisions." ) + ''' + Usually report low severity except in cases where thje hash of a previous block is used to + determine control flow. + ''' + + severity = "Medium" if "hash" in annotation.operation else "Low" + + ''' + Note: We report the location of the JUMPI that lead to this path. Usually this maps to an if or + require statement. + ''' + + swc_id = TIMESTAMP_DEPENDENCE if "timestamp" in annotation.operation else WEAK_RANDOMNESS + issue = Issue( contract=state.environment.active_account.contract_name, function_name=state.environment.active_function_name, - address=state.get_current_instruction()["address"], - swc_id=TIMESTAMP_DEPENDENCE, + address=annotation.location, + swc_id=swc_id, bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", - severity="Low", + severity=severity, description_head="A control flow decision is made based on a predictable variable.", description_tail=description, gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), @@ -124,6 +141,7 @@ def _analyze_states(state: GlobalState) -> list: # Look for predictable state variables in jump condition for annotation in state.mstate.stack[-2].annotations: + if isinstance(annotation, PredictableValueAnnotation): state.annotate( PredictablePathAnnotation( From 19ce7c7526358f88dc1021a1219d7b4eef24ce39 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 15 May 2019 06:09:53 +0200 Subject: [PATCH 38/97] Of course, black has to be done --- .../modules/dependence_on_predictable_vars.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 5cb26202..cab8bee3 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -20,6 +20,7 @@ final_ops = ["CALL", "SUICIDE", "STOP"] # One of Bernhard's trademark hacks! + def is_prehook(): """Check if we are in prehook.""" return "pre_hook" in traceback.format_stack()[-4] @@ -108,19 +109,23 @@ def _analyze_states(state: GlobalState) -> list: "generation or to make critical control flow decisions." ) - ''' + """ Usually report low severity except in cases where thje hash of a previous block is used to determine control flow. - ''' + """ severity = "Medium" if "hash" in annotation.operation else "Low" - ''' + """ Note: We report the location of the JUMPI that lead to this path. Usually this maps to an if or require statement. - ''' + """ - swc_id = TIMESTAMP_DEPENDENCE if "timestamp" in annotation.operation else WEAK_RANDOMNESS + swc_id = ( + TIMESTAMP_DEPENDENCE + if "timestamp" in annotation.operation + else WEAK_RANDOMNESS + ) issue = Issue( contract=state.environment.active_account.contract_name, From 32275d07e4997ff34866e92d00236b5073b66e1b Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 15 May 2019 15:25:07 +0200 Subject: [PATCH 39/97] Fix norhh bugs --- mythril/analysis/modules/dependence_on_predictable_vars.py | 2 +- mythril/laser/ethereum/instructions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index cab8bee3..e97728c8 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -15,7 +15,7 @@ import traceback log = logging.getLogger(__name__) predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] -final_ops = ["CALL", "SUICIDE", "STOP"] +final_ops = ["CALL", "SUICIDE", "STOP", "RETURN"] # One of Bernhard's trademark hacks! diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index d4f000df..fe0ce2e8 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -898,7 +898,7 @@ class Instruction: return [global_state] @StateTransition(enable_gas=False) - def sha3_(selxf, global_state: GlobalState) -> List[GlobalState]: + def sha3_(self, global_state: GlobalState) -> List[GlobalState]: """ :param global_state: From 2ab2d7720f409c6f94e51b18dc632fb27c354cea Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 15 May 2019 15:25:52 +0200 Subject: [PATCH 40/97] Delete stray file --- 1 | 286 -------------------------------------------------------------- 1 file changed, 286 deletions(-) delete mode 100644 1 diff --git a/1 b/1 deleted file mode 100644 index 07770b5e..00000000 --- a/1 +++ /dev/null @@ -1,286 +0,0 @@ -mythril.support.signatures [INFO]: Using signature database at /Users/bernhardmueller/.mythril/signatures.db -mythril.analysis.security [INFO]: Found 0 detection modules -mythril.laser.ethereum.svm [INFO]: LASER EVM initialized with dynamic loader: -mythril.laser.ethereum.plugins.plugin_loader [INFO]: Loading plugin: -mythril.laser.ethereum.plugins.plugin_loader [INFO]: Loading plugin: -mythril.analysis.security [INFO]: Found 11 detection modules -mythril.analysis.security [INFO]: Found 11 detection modules -mythril.laser.ethereum.svm [DEBUG]: Starting LASER execution -mythril.laser.ethereum.svm [INFO]: Starting contract creation transaction -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE -mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH8 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating NUMBER -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB -mythril.laser.ethereum.instructions [DEBUG]: Evaluating BLOCKHASH -mythril.laser.ethereum.instructions [DEBUG]: Evaluating TIMESTAMP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD -mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] -mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP4 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE -mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[96]: 115792089237316195423570985008687907853269984665640564039457584007913129639935 - -0 & -115792089237316195423570985008687907853269984665640564039457584007913129639935 - -0 & -1_blockhash_block_block_number - 1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP3 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE -mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[128]: 1_timestamp -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP3 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD -mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] -mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SHA3 -mythril.laser.ethereum.instructions [DEBUG]: Created BitVecFunc hash. -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EXP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SLOAD -mythril.laser.ethereum.instructions [DEBUG]: Storage access at index 0 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MUL -mythril.laser.ethereum.instructions [DEBUG]: Evaluating NOT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP4 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MUL -mythril.laser.ethereum.instructions [DEBUG]: Evaluating OR -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SSTORE -mythril.laser.ethereum.instructions [DEBUG]: Write to storage[0] -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CODECOPY -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating RETURN -mythril.laser.ethereum.svm [INFO]: Finished contract creation, found 1 open states -mythril.laser.ethereum.svm [INFO]: Starting message call transaction, iteration: 0, 1 initial states -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE -mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATASIZE -mythril.laser.ethereum.instructions [DEBUG]: Evaluating LT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATALOAD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH29 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.svm [DEBUG]: - Entering function MAIN:unknown -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH4 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.svm [DEBUG]: - Entering function MAIN:unknown -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLDATALOAD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADDRESS -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH20 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH8 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating BALANCE -mythril.laser.ethereum.instructions [DEBUG]: Evaluating CALLVALUE -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD -mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] -mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating REVERT -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP3 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SLOAD -mythril.laser.ethereum.instructions [DEBUG]: Storage access at index 0 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EXP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DIV -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MSTORE -mythril.laser.ethereum.instructions [DEBUG]: MSTORE to mem[96]: If(If(If(If(2_balance_at_1461501637330902918203684832716283019655932542975 & -51421440056055728346017419001665401074216449311 == - 0, - 0, - 1) == - 0, - 1, - 0) == - 0, - 1, - 0) == - 0, - 1, - 0) -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ADD -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating AND -mythril.laser.ethereum.instructions [DEBUG]: Evaluating MLOAD -mythril.laser.ethereum.instructions [DEBUG]: MLOAD[64] -mythril.laser.ethereum.instructions [DEBUG]: Load from memory[64]: 96 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating EQ -mythril.laser.ethereum.instructions [DEBUG]: Evaluating DUP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating ISZERO -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating PUSH2 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SUB -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPI -mythril.laser.ethereum.instructions [DEBUG]: Pruned unreachable states. -mythril.laser.ethereum.instructions [DEBUG]: Evaluating SWAP1 -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating RETURN -mythril.laser.ethereum.instructions [DEBUG]: Evaluating POP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMP -mythril.laser.ethereum.instructions [DEBUG]: Evaluating JUMPDEST -mythril.laser.ethereum.instructions [DEBUG]: Evaluating STOP -mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Number of new instructions covered in tx 0: 131 -mythril.laser.ethereum.svm [INFO]: Starting message call transaction, iteration: 1, 0 initial states -mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Number of new instructions covered in tx 1: 0 -mythril.laser.ethereum.svm [INFO]: Finished symbolic execution -mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Achieved 31.85% coverage for code: 6060604052670de0b6b3a76400003414151561001a57600080fd5b600143034042604051808360001916600019168152602001828152602001925050506040518091039020600190046000806101000a81548160ff021916908360ff160217905550610164806100706000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ba4c16b14610051578063b2fa1c9e1461006c575b600080fd5b61006a600480803560ff16906020019091905050610099565b005b341561007757600080fd5b61007f610117565b604051808215151515815260200191505060405180910390f35b670de0b6b3a7640000341415156100af57600080fd5b6000809054906101000a900460ff1660ff168160ff161415610114573373ffffffffffffffffffffffffffffffffffffffff166108fc671bc16d674ec800009081150290604051600060405180830381858888f19350505050151561011357600080fd5b5b50565b6000803073ffffffffffffffffffffffffffffffffffffffff1631149050905600a165627a7a72305820e70964dd89df0e5b2cf45faf9eecd590a00131d465ed3f65857d843d01c130270029 -mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin [INFO]: Achieved 77.98% coverage for code: 60606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ba4c16b14610051578063b2fa1c9e1461006c575b600080fd5b61006a600480803560ff16906020019091905050610099565b005b341561007757600080fd5b61007f610117565b604051808215151515815260200191505060405180910390f35b670de0b6b3a7640000341415156100af57600080fd5b6000809054906101000a900460ff1660ff168160ff161415610114573373ffffffffffffffffffffffffffffffffffffffff166108fc671bc16d674ec800009081150290604051600060405180830381858888f19350505050151561011357600080fd5b5b50565b6000803073ffffffffffffffffffffffffffffffffffffffff1631149050905600a165627a7a72305820e70964dd89df0e5b2cf45faf9eecd590a00131d465ed3f65857d843d01c130270029 -mythril.analysis.security [INFO]: Starting analysis -mythril.analysis.security [INFO]: Found 0 detection modules -mythril.analysis.security [INFO]: Found 11 detection modules -mythril.analysis.security [DEBUG]: Retrieving results for DELEGATECALL Usage in Fallback Function -mythril.analysis.security [DEBUG]: Retrieving results for Dependence of Predictable Variables -mythril.analysis.security [DEBUG]: Retrieving results for Deprecated Operations -mythril.analysis.security [DEBUG]: Retrieving results for Ether Thief -mythril.analysis.security [DEBUG]: Retrieving results for Reachable Exceptions -mythril.analysis.security [DEBUG]: Retrieving results for External calls -mythril.analysis.security [DEBUG]: Retrieving results for Integer Overflow and Underflow -mythril.analysis.security [DEBUG]: Retrieving results for Multiple Sends -mythril.analysis.security [DEBUG]: Retrieving results for State Change After External calls -mythril.analysis.security [DEBUG]: Retrieving results for Unprotected Selfdestruct -mythril.analysis.security [DEBUG]: Retrieving results for Unchecked Return Value -mythril.analysis.security [INFO]: Found 11 detection modules -mythril.mythril.mythril_analyzer [INFO]: Solver statistics: -Query count: 35 -Solver time: 0.3555266857147217 From da8a1fd29aa28f17e23c081a128f4b0a40057a42 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 15 May 2019 20:52:59 +0530 Subject: [PATCH 41/97] Mythril v0.20.5 --- mythril/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/version.py b/mythril/version.py index 1c0dc71a..994e8f8f 100644 --- a/mythril/version.py +++ b/mythril/version.py @@ -4,4 +4,4 @@ This file is suitable for sourcing inside POSIX shell, e.g. bash as well as for importing into Python. """ -VERSION = "v0.20.4" # NOQA +VERSION = "v0.20.5" # NOQA From 1a9d0cdd0e1b10cf7c8c3a2fa894ad2a385100e9 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 15 May 2019 22:48:59 +0530 Subject: [PATCH 42/97] Mythril v0.20.6 --- mythril/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/version.py b/mythril/version.py index 994e8f8f..7896986e 100644 --- a/mythril/version.py +++ b/mythril/version.py @@ -4,4 +4,4 @@ This file is suitable for sourcing inside POSIX shell, e.g. bash as well as for importing into Python. """ -VERSION = "v0.20.5" # NOQA +VERSION = "v0.20.6" # NOQA From a9671de8a3751d916a4190c56879c712a3f02c61 Mon Sep 17 00:00:00 2001 From: JoranHonig Date: Thu, 16 May 2019 09:42:00 +0200 Subject: [PATCH 43/97] Balance modelling and symbolic sender variables (#1025) * add actor address to symbolic This will allow us to simulate semi-symbolic transaction senders * add value transfer to transaction global state creation * add proper balance tracking to world state and account * use address value vs string * disable actor address variable * use address directly * allow balance functions with int types * use value as getters since bitvecs aren't hashable * implement correct value transfer for suicide * use actor from actor pool * allow use of Or with *arg pattern * use bitvec instead of strings * add dynamic balance implementation to state datamodels * cleanup svm interface * use balance lambda in suicide op implementation * use bitvec instead of string address * update world state and account creation in symbolic * update tests to include overflow results * apply style rules * ignore previous open states for now * update native test to conform to new laser interface * fix incorrect types in the symbolic virtual machine * allow multiple types as input for address in account * fix type hint in symbolic.py * get int out of string in call * fix type in call op implementation * adapt test_transaction to conform to new laser interface * use static address to keep contracts from trying to enter themselves and make address type more dynamic * update evm test to conform to new laser interface * implement suicide to uncreated account * apply style rules * dynamically create colormap This removes the need for a globally maintained accountlist * get value out of address * add accounts getter * change symbolic test call to be valid with respect to the world state and account apis * remove dependency on globally recorded accounts * fix typing issues * fix type annotations in symbolic.py * fix remaining mypy warnings * simplify assertion check * execute lambda to get balance * make variable name plural * add documentation to svm constructor * use list comprehension to make code cleaner * remove comment * change variable name to plural * remove commented code * change variable name to conform to changed interface --- mythril/analysis/callgraph.py | 23 +- mythril/analysis/symbolic.py | 53 ++-- mythril/laser/ethereum/call.py | 20 +- mythril/laser/ethereum/instructions.py | 28 +- mythril/laser/ethereum/state/account.py | 46 ++-- mythril/laser/ethereum/state/environment.py | 2 +- mythril/laser/ethereum/state/global_state.py | 2 +- mythril/laser/ethereum/state/world_state.py | 57 ++-- mythril/laser/ethereum/svm.py | 89 +++---- .../laser/ethereum/transaction/symbolic.py | 31 ++- .../transaction/transaction_models.py | 16 +- mythril/laser/smt/bool.py | 7 +- tests/laser/evm_testsuite/evm_test.py | 23 +- tests/laser/test_transaction.py | 12 +- tests/laser/transaction/symbolic_test.py | 6 +- tests/native_test.py | 19 +- tests/report_test.py | 2 +- .../outputs_expected/calls.sol.o.json | 244 +++++++++--------- .../outputs_expected/calls.sol.o.jsonv2 | 2 +- .../outputs_expected/environments.sol.o.json | 36 --- .../environments.sol.o.markdown | 34 --- .../outputs_expected/environments.sol.o.text | 30 --- .../outputs_expected/ether_send.sol.o.jsonv2 | 12 +- .../kinds_of_calls.sol.o.jsonv2 | 2 +- .../outputs_expected/metacoin.sol.o.jsonv2 | 12 +- .../outputs_expected/nonascii.sol.o.jsonv2 | 12 +- .../outputs_expected/overflow.sol.o.json | 13 + .../outputs_expected/overflow.sol.o.jsonv2 | 17 ++ .../outputs_expected/overflow.sol.o.markdown | 13 + .../outputs_expected/overflow.sol.o.text | 11 + .../outputs_expected/rubixi.sol.o.json | 166 ------------ .../outputs_expected/rubixi.sol.o.markdown | 238 ----------------- .../outputs_expected/rubixi.sol.o.text | 177 ------------- .../outputs_expected/underflow.sol.o.json | 13 + .../outputs_expected/underflow.sol.o.jsonv2 | 17 ++ .../outputs_expected/underflow.sol.o.markdown | 13 + .../outputs_expected/underflow.sol.o.text | 11 + .../outputs_expected/weak_random.sol.o.json | 46 ---- .../weak_random.sol.o.markdown | 62 ----- .../outputs_expected/weak_random.sol.o.text | 46 ---- 40 files changed, 509 insertions(+), 1154 deletions(-) delete mode 100644 tests/testdata/outputs_expected/environments.sol.o.json delete mode 100644 tests/testdata/outputs_expected/environments.sol.o.markdown delete mode 100644 tests/testdata/outputs_expected/environments.sol.o.text delete mode 100644 tests/testdata/outputs_expected/rubixi.sol.o.json delete mode 100644 tests/testdata/outputs_expected/rubixi.sol.o.markdown delete mode 100644 tests/testdata/outputs_expected/rubixi.sol.o.text delete mode 100644 tests/testdata/outputs_expected/weak_random.sol.o.json delete mode 100644 tests/testdata/outputs_expected/weak_random.sol.o.markdown delete mode 100644 tests/testdata/outputs_expected/weak_random.sol.o.text diff --git a/mythril/analysis/callgraph.py b/mythril/analysis/callgraph.py index b02a62fa..dcbd0216 100644 --- a/mythril/analysis/callgraph.py +++ b/mythril/analysis/callgraph.py @@ -125,7 +125,7 @@ phrack_color = { } -def extract_nodes(statespace, color_map): +def extract_nodes(statespace): """ :param statespace: @@ -133,6 +133,7 @@ def extract_nodes(statespace, color_map): :return: """ nodes = [] + color_map = {} for node_key in statespace.nodes: node = statespace.nodes[node_key] instructions = [state.get_current_instruction() for state in node.states] @@ -164,10 +165,16 @@ def extract_nodes(statespace, color_map): else "\n".join(code_split[:6]) + "\n(click to expand +)" ) + if node.get_cfg_dict()["contract_name"] not in color_map.keys(): + color = default_colors[len(color_map) % len(default_colors)] + color_map[node.get_cfg_dict()["contract_name"]] = color + nodes.append( { "id": str(node_key), - "color": color_map[node.get_cfg_dict()["contract_name"]], + "color": color_map.get( + node.get_cfg_dict()["contract_name"], default_colors[0] + ), "size": 150, "fullLabel": "\n".join(code_split), "label": truncated_code, @@ -231,22 +238,12 @@ def generate_graph( template = env.get_template("callgraph.html") graph_opts = default_opts - accounts = statespace.accounts - - if phrackify: - color_map = {accounts[k].contract_name: phrack_color for k in accounts} - graph_opts.update(phrack_opts) - else: - color_map = { - accounts[k].contract_name: default_colors[i % len(default_colors)] - for i, k in enumerate(accounts) - } graph_opts["physics"]["enabled"] = physics return template.render( title=title, - nodes=extract_nodes(statespace, color_map), + nodes=extract_nodes(statespace), edges=extract_edges(statespace), phrackify=phrackify, opts=graph_opts, diff --git a/mythril/analysis/symbolic.py b/mythril/analysis/symbolic.py index c195a498..cdcb9070 100644 --- a/mythril/analysis/symbolic.py +++ b/mythril/analysis/symbolic.py @@ -2,22 +2,22 @@ purposes.""" import copy -from ethereum.utils import mk_contract_address + from mythril.analysis.security import get_detection_module_hooks, get_detection_modules from mythril.laser.ethereum import svm +from mythril.laser.ethereum.plugins.plugin_factory import PluginFactory +from mythril.laser.ethereum.plugins.plugin_loader import LaserPluginLoader from mythril.laser.ethereum.state.account import Account +from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum.strategy.basic import ( BreadthFirstSearchStrategy, DepthFirstSearchStrategy, ReturnRandomNaivelyStrategy, ReturnWeightedRandomStrategy, + BasicSearchStrategy, ) -from mythril.laser.ethereum.transaction.symbolic import CREATOR_ADDRESS - - -from mythril.laser.ethereum.plugins.plugin_factory import PluginFactory -from mythril.laser.ethereum.plugins.plugin_loader import LaserPluginLoader - +from mythril.laser.smt import symbol_factory, BitVec +from typing import Union, List, Dict, Type from mythril.solidity.soliditycontract import EVMContract, SolidityContract from .ops import Call, SStore, VarType, get_variable @@ -32,7 +32,7 @@ class SymExecWrapper: def __init__( self, contract, - address, + address: Union[int, str, BitVec], strategy, dynloader=None, max_depth=22, @@ -55,8 +55,13 @@ class SymExecWrapper: :param transaction_count: :param modules: """ + if isinstance(address, str): + address = symbol_factory.BitVecVal(int(address, 16), 256) + if isinstance(address, int): + address = symbol_factory.BitVecVal(address, 256) + if strategy == "dfs": - s_strategy = DepthFirstSearchStrategy + s_strategy = DepthFirstSearchStrategy # type: Type[BasicSearchStrategy] elif strategy == "bfs": s_strategy = BreadthFirstSearchStrategy elif strategy == "naive-random": @@ -66,19 +71,11 @@ class SymExecWrapper: else: raise ValueError("Invalid strategy argument supplied") - account = Account( - address, - contract.disassembly, - dynamic_loader=dynloader, - contract_name=contract.name, - ) requires_statespace = ( compulsory_statespace or len(get_detection_modules("post", modules)) > 0 ) - self.accounts = {address: account} self.laser = svm.LaserEVM( - self.accounts, dynamic_loader=dynloader, max_depth=max_depth, execution_timeout=execution_timeout, @@ -111,12 +108,16 @@ class SymExecWrapper: creation_code=contract.creation_code, contract_name=contract.name ) else: - self.laser.sym_exec(address) - created_address = "0x" + str(mk_contract_address(CREATOR_ADDRESS, 0).hex()) - for key, value in self.laser.world_state.accounts.items(): - if created_address == value.address: - contract.code = value.code.bytecode - break + account = Account( + address, + contract.disassembly, + dynamic_loader=dynloader, + contract_name=contract.name, + concrete_storage=False, + ) + world_state = WorldState() + world_state.put_account(account) + self.laser.sym_exec(world_state=world_state, target_address=address.value) if not requires_statespace: return @@ -126,8 +127,8 @@ class SymExecWrapper: # Generate lists of interesting operations - self.calls = [] - self.sstors = {} + self.calls = [] # type: List[Call] + self.sstors = {} # type: Dict[int, Dict[str, List[SStore]]] for key in self.nodes: @@ -204,7 +205,7 @@ class SymExecWrapper: elif op == "SSTORE": stack = copy.copy(state.mstate.stack) - address = state.environment.active_account.address + address = state.environment.active_account.address.value index, value = stack.pop(), stack.pop() diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index da63928d..08ef8773 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -3,13 +3,12 @@ instructions.py to get the necessary elements from the stack and determine the parameters for the new global state.""" import logging +import re from typing import Union, List, cast, Callable -from z3 import Z3Exception -from mythril.laser.smt import BitVec + +import mythril.laser.ethereum.util as util from mythril.laser.ethereum import natives from mythril.laser.ethereum.gas import OPCODE_GAS -from mythril.laser.smt import simplify, Expression, symbol_factory -import mythril.laser.ethereum.util as util from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.calldata import ( BaseCalldata, @@ -17,8 +16,9 @@ from mythril.laser.ethereum.state.calldata import ( ConcreteCalldata, ) from mythril.laser.ethereum.state.global_state import GlobalState +from mythril.laser.smt import BitVec +from mythril.laser.smt import simplify, Expression, symbol_factory from mythril.support.loader import DynLoader -import re """ This module contains the business logic used by Instruction in instructions.py @@ -96,7 +96,7 @@ def get_callee_address( # attempt to read the contract address from instance storage try: callee_address = dynamic_loader.read_storage( - environment.active_account.address, index + str(hex(environment.active_account.address.value)), index ) # TODO: verify whether this happens or not except: @@ -124,7 +124,7 @@ def get_callee_account( accounts = global_state.accounts try: - return global_state.accounts[callee_address] + return global_state.accounts[int(callee_address, 16)] except KeyError: # We have a valid call address, but contract is not in the modules list log.debug("Module with address " + callee_address + " not loaded.") @@ -145,7 +145,11 @@ def get_callee_account( log.debug("Dependency loaded: " + callee_address) callee_account = Account( - callee_address, code, callee_address, dynamic_loader=dynamic_loader + symbol_factory.BitVecVal(int(callee_address, 16), 256), + code, + callee_address, + dynamic_loader=dynamic_loader, + balances=global_state.world_state.balances, ) accounts[callee_address] = callee_account diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index b6bb61cd..a353fbc1 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1520,7 +1520,7 @@ class Instruction: global_state.environment.active_account ) global_state.accounts[ - global_state.environment.active_account.address + global_state.environment.active_account.address.value ] = global_state.environment.active_account global_state.environment.active_account.storage[index] = ( @@ -1756,31 +1756,19 @@ class Instruction: :param global_state: """ target = global_state.mstate.stack.pop() - account_created = False + transfer_amount = global_state.environment.active_account.balance() # Often the target of the suicide instruction will be symbolic - # If it isn't then well transfer the balance to the indicated contract - if isinstance(target, BitVec) and not target.symbolic: - target = "0x" + hex(target.value)[-40:] - if isinstance(target, str): - try: - global_state.world_state[ - target - ].balance += global_state.environment.active_account.balance - except KeyError: - global_state.world_state.create_account( - address=target, - balance=global_state.environment.active_account.balance, - ) - account_created = True + # If it isn't then we'll transfer the balance to the indicated contract + global_state.world_state[target].add_balance(transfer_amount) global_state.environment.active_account = deepcopy( global_state.environment.active_account ) global_state.accounts[ - global_state.environment.active_account.address + global_state.environment.active_account.address.value ] = global_state.environment.active_account - global_state.environment.active_account.balance = 0 + global_state.environment.active_account.set_balance(0) global_state.environment.active_account.deleted = True global_state.current_transaction.end(global_state) @@ -1865,9 +1853,7 @@ class Instruction: gas_price=environment.gasprice, gas_limit=gas, origin=environment.origin, - caller=symbol_factory.BitVecVal( - int(environment.active_account.address, 16), 256 - ), + caller=environment.active_account.address, callee_account=callee_account, call_data=call_data, call_value=value, diff --git a/mythril/laser/ethereum/state/account.py b/mythril/laser/ethereum/state/account.py index e608246e..381562ca 100644 --- a/mythril/laser/ethereum/state/account.py +++ b/mythril/laser/ethereum/state/account.py @@ -7,6 +7,7 @@ from typing import Any, Dict, KeysView, Union from z3 import ExprRef +from mythril.laser.smt import Array, symbol_factory, BitVec from mythril.disassembler.disassembly import Disassembly from mythril.laser.smt import symbol_factory @@ -30,7 +31,7 @@ class Storage: except KeyError: if ( self.address - and int(self.address[2:], 16) != 0 + and self.address.value != 0 and (self.dynld and self.dynld.storage_loading) ): try: @@ -74,10 +75,10 @@ class Account: def __init__( self, - address: str, + address: Union[BitVec, str], code=None, contract_name="unknown", - balance=None, + balances: Array = None, concrete_storage=False, dynamic_loader=None, ) -> None: @@ -91,36 +92,51 @@ class Account: """ self.nonce = 0 self.code = code or Disassembly("") - self.balance = ( - balance - if balance - else symbol_factory.BitVecSym("{}_balance".format(address), 256) + self.address = ( + address + if isinstance(address, BitVec) + else symbol_factory.BitVecVal(int(address, 16), 256) ) + self.storage = Storage( - concrete_storage, address=address, dynamic_loader=dynamic_loader + concrete_storage, address=self.address, dynamic_loader=dynamic_loader ) + # Metadata - self.address = address self.contract_name = contract_name self.deleted = False + self._balances = balances + self.balance = lambda: self._balances[self.address] + def __str__(self) -> str: return str(self.as_dict) - def set_balance(self, balance: ExprRef) -> None: + def set_balance(self, balance: Union[int, BitVec]) -> None: """ :param balance: """ - self.balance = balance + balance = ( + symbol_factory.BitVecVal(balance, 256) + if isinstance(balance, int) + else balance + ) + assert self._balances is not None + self._balances[self.address] = balance - def add_balance(self, balance: ExprRef) -> None: + def add_balance(self, balance: Union[int, BitVec]) -> None: """ :param balance: """ - self.balance += balance + balance = ( + symbol_factory.BitVecVal(balance, 256) + if isinstance(balance, int) + else balance + ) + self._balances[self.address] += balance @property def as_dict(self) -> Dict: @@ -131,7 +147,7 @@ class Account: return { "nonce": self.nonce, "code": self.code, - "balance": self.balance, + "balance": self.balance(), "storage": self.storage, } @@ -139,8 +155,8 @@ class Account: new_account = Account( address=self.address, code=self.code, - balance=self.balance, contract_name=self.contract_name, + balances=self._balances, ) new_account.storage = deepcopy(self.storage) new_account.code = self.code diff --git a/mythril/laser/ethereum/state/environment.py b/mythril/laser/ethereum/state/environment.py index 69830007..0f467413 100644 --- a/mythril/laser/ethereum/state/environment.py +++ b/mythril/laser/ethereum/state/environment.py @@ -39,7 +39,7 @@ class Environment: self.active_account = active_account self.active_function_name = "" - self.address = symbol_factory.BitVecVal(int(active_account.address, 16), 256) + self.address = active_account.address # Ib self.code = active_account.code if code is None else code diff --git a/mythril/laser/ethereum/state/global_state.py b/mythril/laser/ethereum/state/global_state.py index 5423aaf8..e6a13cd3 100644 --- a/mythril/laser/ethereum/state/global_state.py +++ b/mythril/laser/ethereum/state/global_state.py @@ -77,7 +77,7 @@ class GlobalState: :return: """ - return self.world_state.accounts + return self.world_state._accounts # TODO: remove this, as two instructions are confusing def get_current_instruction(self) -> Dict: diff --git a/mythril/laser/ethereum/state/world_state.py b/mythril/laser/ethereum/state/world_state.py index 862b7c8d..ba8611d0 100644 --- a/mythril/laser/ethereum/state/world_state.py +++ b/mythril/laser/ethereum/state/world_state.py @@ -2,6 +2,8 @@ from copy import copy from random import randint from typing import Dict, List, Iterator, Optional, TYPE_CHECKING + +from mythril.laser.smt import symbol_factory, Array, BitVec from ethereum.utils import mk_contract_address from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.annotation import StateAnnotation @@ -22,18 +24,29 @@ class WorldState: :param transaction_sequence: :param annotations: """ - self.accounts = {} # type: Dict[str, Account] + self._accounts = {} # type: Dict[int, Account] + self.balances = Array("balance", 256, 256) + self.node = None # type: Optional['Node'] self.transaction_sequence = transaction_sequence or [] self._annotations = annotations or [] - def __getitem__(self, item: str) -> Account: + @property + def accounts(self): + return self._accounts + + def __getitem__(self, item: BitVec) -> Account: """Gets an account from the worldstate using item as key. :param item: Address of the account to get :return: Account associated with the address """ - return self.accounts[item] + try: + return self._accounts[item.value] + except KeyError: + new_account = Account(address=item, code=None, balances=self.balances) + self._accounts[item.value] = new_account + return new_account def __copy__(self) -> "WorldState": """ @@ -45,7 +58,9 @@ class WorldState: transaction_sequence=self.transaction_sequence[:], annotations=new_annotations, ) - new_world_state.accounts = copy(self.accounts) + new_world_state.balances = copy(self.balances) + for account in self._accounts.values(): + new_world_state.put_account(copy(account)) new_world_state.node = self.node return new_world_state @@ -65,14 +80,22 @@ class WorldState: :param dynamic_loader: used for dynamically loading storage from the block chain :return: The new account """ - address = address if address else self._generate_new_address(creator) + address = ( + symbol_factory.BitVecVal(address, 256) + if address + else self._generate_new_address(creator) + ) + new_account = Account( - address, - balance=balance, + address=address, + balances=self.balances, dynamic_loader=dynamic_loader, concrete_storage=concrete_storage, ) - self._put_account(new_account) + if balance: + new_account.set_balance(symbol_factory.BitVecVal(balance, 256)) + + self.put_account(new_account) return new_account def create_initialized_contract_account(self, contract_code, storage) -> None: @@ -86,10 +109,10 @@ class WorldState: """ # TODO: Add type hints new_account = Account( - self._generate_new_address(), code=contract_code, balance=0 + self._generate_new_address(), code=contract_code, balances=self.balances ) new_account.storage = storage - self._put_account(new_account) + self.put_account(new_account) def annotate(self, annotation: StateAnnotation) -> None: """ @@ -116,22 +139,24 @@ class WorldState: """ return filter(lambda x: isinstance(x, annotation_type), self.annotations) - def _generate_new_address(self, creator=None) -> str: + def _generate_new_address(self, creator=None) -> BitVec: """Generates a new address for the global state. :return: """ if creator: # TODO: Use nounce - return "0x" + str(mk_contract_address(creator, 0).hex()) + address = "0x" + str(mk_contract_address(creator, 0).hex()) + return symbol_factory.BitVecVal(int(address, 16), 256) while True: address = "0x" + "".join([str(hex(randint(0, 16)))[-1] for _ in range(40)]) - if address not in self.accounts.keys(): - return address + if address not in self._accounts.keys(): + return symbol_factory.BitVecVal(int(address, 16), 256) - def _put_account(self, account: Account) -> None: + def put_account(self, account: Account) -> None: """ :param account: """ - self.accounts[account.address] = account + self._accounts[account.address.value] = account + account._balances = self.balances diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 0fcb8d77..fae71dc8 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -9,12 +9,12 @@ from mythril.laser.ethereum.cfg import NodeFlags, Node, Edge, JumpType from mythril.laser.ethereum.evm_exceptions import StackUnderflowException from mythril.laser.ethereum.evm_exceptions import VmException from mythril.laser.ethereum.instructions import Instruction -from mythril.laser.ethereum.state.account import Account +from mythril.laser.ethereum.iprof import InstructionProfiler +from mythril.laser.ethereum.plugins.signals import PluginSkipWorldState from mythril.laser.ethereum.state.global_state import GlobalState from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum.strategy.basic import DepthFirstSearchStrategy from mythril.laser.ethereum.time_handler import time_handler -from mythril.laser.ethereum.plugins.signals import PluginSkipWorldState from mythril.laser.ethereum.transaction import ( ContractCreationTransaction, TransactionEndSignal, @@ -22,7 +22,7 @@ from mythril.laser.ethereum.transaction import ( execute_contract_creation, execute_message_call, ) -from mythril.laser.ethereum.iprof import InstructionProfiler +from mythril.laser.smt import symbol_factory log = logging.getLogger(__name__) @@ -46,7 +46,6 @@ class LaserEVM: def __init__( self, - accounts: Dict[str, Account], dynamic_loader=None, max_depth=float("inf"), execution_timeout=60, @@ -57,21 +56,18 @@ class LaserEVM: enable_iprof=False, ) -> None: """ - - :param accounts: - :param dynamic_loader: - :param max_depth: - :param execution_timeout: - :param create_timeout: - :param strategy: - :param transaction_count: + Initializes the laser evm object + + :param dynamic_loader: Loads data from chain + :param max_depth: Maximum execution depth this vm should execute + :param execution_timeout: Time to take for execution + :param create_timeout: Time to take for contract creation + :param strategy: Execution search strategy + :param transaction_count: The amount of transactions to execute + :param requires_statespace: Variable indicating whether the statespace should be recorded + :param enable_iprof: Variable indicating whether instruction profiling should be turned on """ - world_state = WorldState() - world_state.accounts = accounts - # this sets the initial world state - self.world_state = world_state - self.open_states = [world_state] - + self.open_states = [] # type: List[WorldState] self.total_states = 0 self.dynamic_loader = dynamic_loader @@ -106,23 +102,30 @@ class LaserEVM: log.info("LASER EVM initialized with dynamic loader: " + str(dynamic_loader)) - @property - def accounts(self) -> Dict[str, Account]: - """ - - :return: - """ - return self.world_state.accounts - def sym_exec( - self, main_address=None, creation_code=None, contract_name=None + self, + world_state: WorldState = None, + target_address: int = None, + creation_code: str = None, + contract_name: str = None, ) -> None: + """ Starts symbolic execution + There are two modes of execution. + Either we analyze a preconfigured configuration, in which case the world_state and target_address variables + must be supplied. + Or we execute the creation code of a contract, in which case the creation code and desired name of that + contract should be provided. + + :param world_state The world state configuration from which to perform analysis + :param target_address The address of the contract account in the world state which analysis should target + :param creation_code The creation code to create the target contract in the symbolic environment + :param contract_name The name that the created account should be associated with """ + pre_configuration_mode = world_state is not None and target_address is not None + scratch_mode = creation_code is not None and contract_name is not None + if pre_configuration_mode == scratch_mode: + raise ValueError("Symbolic execution started with invalid parameters") - :param main_address: - :param creation_code: - :param contract_name: - """ log.debug("Starting LASER execution") for hook in self._start_sym_exec_hooks: hook() @@ -130,11 +133,12 @@ class LaserEVM: time_handler.start_execution(self.execution_timeout) self.time = datetime.now() - if main_address: - log.info("Starting message call transaction to {}".format(main_address)) - self._execute_transactions(main_address) + if pre_configuration_mode: + self.open_states = [world_state] + log.info("Starting message call transaction to {}".format(target_address)) + self._execute_transactions(symbol_factory.BitVecVal(target_address, 256)) - elif creation_code: + elif scratch_mode: log.info("Starting contract creation transaction") created_account = execute_contract_creation( self, creation_code, contract_name @@ -355,7 +359,7 @@ class LaserEVM: if not revert_changes: return_global_state.world_state = copy(global_state.world_state) return_global_state.environment.active_account = global_state.accounts[ - return_global_state.environment.active_account.address + return_global_state.environment.active_account.address.value ] # Execute the post instruction handler @@ -389,19 +393,6 @@ class LaserEVM: self._new_node_state( state, JumpType.CONDITIONAL, state.mstate.constraints[-1] ) - - elif opcode in ("CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"): - assert len(new_states) <= 1 - for state in new_states: - self._new_node_state(state, JumpType.CALL) - # Keep track of added contracts so the graph can be generated properly - if ( - state.environment.active_account.contract_name - not in self.world_state.accounts.keys() - ): - self.world_state.accounts[ - state.environment.active_account.address - ] = state.environment.active_account elif opcode == "RETURN": for state in new_states: self._new_node_state(state, JumpType.RETURN) diff --git a/mythril/laser/ethereum/transaction/symbolic.py b/mythril/laser/ethereum/transaction/symbolic.py index def5048e..9a8ccc5d 100644 --- a/mythril/laser/ethereum/transaction/symbolic.py +++ b/mythril/laser/ethereum/transaction/symbolic.py @@ -2,25 +2,32 @@ symbolic values.""" import logging - -from mythril.laser.smt import symbol_factory from mythril.disassembler.disassembly import Disassembly from mythril.laser.ethereum.cfg import Node, Edge, JumpType -from mythril.laser.ethereum.state.calldata import BaseCalldata, SymbolicCalldata from mythril.laser.ethereum.state.account import Account +from mythril.laser.ethereum.state.calldata import SymbolicCalldata +from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum.transaction.transaction_models import ( MessageCallTransaction, ContractCreationTransaction, get_next_transaction_id, + BaseTransaction, ) +from mythril.laser.smt import symbol_factory, Or, BitVec log = logging.getLogger(__name__) CREATOR_ADDRESS = 0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE ATTACKER_ADDRESS = 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF +ACTOR_ADDRESSES = [ + symbol_factory.BitVecVal(0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE, 256), + symbol_factory.BitVecVal(0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF, 256), + symbol_factory.BitVecVal(0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEE, 256), +] + -def execute_message_call(laser_evm, callee_address: str) -> None: +def execute_message_call(laser_evm, callee_address: BitVec) -> None: """Executes a message call transaction from all open states. :param laser_evm: @@ -46,7 +53,9 @@ def execute_message_call(laser_evm, callee_address: str) -> None: origin=symbol_factory.BitVecSym( "origin{}".format(next_transaction_id), 256 ), - caller=symbol_factory.BitVecVal(ATTACKER_ADDRESS, 256), + caller=symbol_factory.BitVecSym( + "sender_{}".format(next_transaction_id), 256 + ), callee_account=open_world_state[callee_address], call_data=SymbolicCalldata(next_transaction_id), call_value=symbol_factory.BitVecSym( @@ -69,12 +78,14 @@ def execute_contract_creation( :return: """ # TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here - open_states = laser_evm.open_states[:] del laser_evm.open_states[:] - new_account = laser_evm.world_state.create_account( + world_state = WorldState() + open_states = [world_state] + new_account = world_state.create_account( 0, concrete_storage=True, dynamic_loader=None, creator=CREATOR_ADDRESS ) + if contract_name: new_account.contract_name = contract_name @@ -104,7 +115,7 @@ def execute_contract_creation( return new_account -def _setup_global_state_for_execution(laser_evm, transaction) -> None: +def _setup_global_state_for_execution(laser_evm, transaction: BaseTransaction) -> None: """Sets up global state and cfg for a transactions execution. :param laser_evm: @@ -114,6 +125,10 @@ def _setup_global_state_for_execution(laser_evm, transaction) -> None: global_state = transaction.initial_global_state() global_state.transaction_stack.append((transaction, None)) + global_state.mstate.constraints.append( + Or(*[transaction.caller == actor for actor in ACTOR_ADDRESSES]) + ) + new_node = Node( global_state.environment.active_account.contract_name, function_name=global_state.environment.active_function_name, diff --git a/mythril/laser/ethereum/transaction/transaction_models.py b/mythril/laser/ethereum/transaction/transaction_models.py index 3c5aabf4..f5863c1c 100644 --- a/mythril/laser/ethereum/transaction/transaction_models.py +++ b/mythril/laser/ethereum/transaction/transaction_models.py @@ -111,8 +111,19 @@ class BaseTransaction: # Initialize the execution environment global_state = GlobalState(self.world_state, environment, None) global_state.environment.active_function_name = active_function + + sender = environment.sender + receiver = environment.active_account.address + value = environment.callvalue + + global_state.world_state.balances[sender] -= value + global_state.world_state.balances[receiver] += value + return global_state + def initial_global_state(self) -> GlobalState: + raise NotImplementedError + class MessageCallTransaction(BaseTransaction): """Transaction object models an transaction.""" @@ -143,6 +154,7 @@ class MessageCallTransaction(BaseTransaction): :param revert: """ self.return_data = return_data + raise TransactionEndSignal(global_state, revert) @@ -190,7 +202,9 @@ class ContractCreationTransaction(BaseTransaction): contract_code = bytes.hex(array.array("B", return_data).tostring()) global_state.environment.active_account.code.assign_bytecode(contract_code) - self.return_data = global_state.environment.active_account.address + self.return_data = str( + hex(global_state.environment.active_account.address.value) + ) assert global_state.environment.active_account.code.instruction_list != [] raise TransactionEndSignal(global_state, revert=revert) diff --git a/mythril/laser/smt/bool.py b/mythril/laser/smt/bool.py index 9fa097e4..1dd1cc76 100644 --- a/mythril/laser/smt/bool.py +++ b/mythril/laser/smt/bool.py @@ -90,15 +90,16 @@ def And(*args: Union[Bool, bool]) -> Bool: return Bool(z3.And([a.raw for a in args_list]), union) -def Or(a: Bool, b: Bool) -> Bool: +def Or(*args: Union[Bool, bool]) -> Bool: """Create an or expression. :param a: :param b: :return: """ - union = a.annotations + b.annotations - return Bool(z3.Or(a.raw, b.raw), annotations=union) + args_list = [arg if isinstance(arg, Bool) else Bool(arg) for arg in args] + union = [arg.annotations for arg in args_list] + return Bool(z3.Or([a.raw for a in args_list]), annotations=union) def Not(a: Bool) -> Bool: diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 6227b3ce..22a48070 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -1,8 +1,9 @@ from mythril.laser.ethereum.svm import LaserEVM from mythril.laser.ethereum.state.account import Account +from mythril.laser.ethereum.state.world_state import WorldState from mythril.disassembler.disassembly import Disassembly from mythril.laser.ethereum.transaction.concolic import execute_message_call -from mythril.laser.smt import Expression, BitVec +from mythril.laser.smt import Expression, BitVec, symbol_factory from mythril.analysis.solver import get_model from datetime import datetime @@ -82,25 +83,27 @@ def test_vmtest( # Arrange if test_name == "gasprice": return - accounts = {} + + world_state = WorldState() + for address, details in pre_condition.items(): account = Account(address) account.code = Disassembly(details["code"][2:]) - account.balance = int(details["balance"], 16) account.nonce = int(details["nonce"], 16) + world_state.put_account(account) + account.set_balance(int(details["balance"], 16)) - accounts[address] = account - - laser_evm = LaserEVM(accounts) + laser_evm = LaserEVM() + laser_evm.open_states = [world_state] # Act laser_evm.time = datetime.now() final_states = execute_message_call( laser_evm, - callee_address=action["address"], - caller_address=action["caller"], - origin_address=binascii.a2b_hex(action["origin"][2:]), + callee_address=symbol_factory.BitVecVal(int(action["address"], 16), 256), + caller_address=symbol_factory.BitVecVal(int(action["caller"], 16), 256), + origin_address=symbol_factory.BitVecVal(int(action["origin"], 16), 256), code=action["code"][2:], gas_limit=int(action["gas"], 16), data=binascii.a2b_hex(action["data"][2:]), @@ -132,7 +135,7 @@ def test_vmtest( ) for address, details in post_condition.items(): - account = world_state[address] + account = world_state[symbol_factory.BitVecVal(int(address, 16), 256)] assert account.nonce == int(details["nonce"], 16) assert account.code.bytecode == details["code"][2:] diff --git a/tests/laser/test_transaction.py b/tests/laser/test_transaction.py index 8e9ac415..b741ab66 100644 --- a/tests/laser/test_transaction.py +++ b/tests/laser/test_transaction.py @@ -1,6 +1,8 @@ from mythril.disassembler.disassembly import Disassembly from mythril.laser.ethereum import svm from mythril.laser.ethereum.state.account import Account +from mythril.laser.ethereum.state.world_state import WorldState + import mythril.laser.ethereum.cfg as cfg @@ -18,15 +20,17 @@ def test_intercontract_call(): ) callee_address = "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" + world_state = WorldState() + caller_account = Account(caller_address, caller_code, contract_name="Caller") callee_account = Account(callee_address, callee_code, contract_name="Callee") + world_state.put_account(callee_account) + world_state.put_account(caller_account) - accounts = {caller_address: caller_account, callee_address: callee_account} - - laser = svm.LaserEVM(accounts) + laser = svm.LaserEVM() # Act - laser.sym_exec(caller_address) + laser.sym_exec(world_state=world_state, target_address=int(caller_address, 16)) # Assert # Initial node starts in contract caller diff --git a/tests/laser/transaction/symbolic_test.py b/tests/laser/transaction/symbolic_test.py index f3939528..3ff46917 100644 --- a/tests/laser/transaction/symbolic_test.py +++ b/tests/laser/transaction/symbolic_test.py @@ -9,6 +9,8 @@ from mythril.laser.ethereum.transaction import ( from mythril.laser.ethereum.svm import LaserEVM from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.world_state import WorldState +from mythril.laser.smt import symbol_factory + import unittest.mock as mock from unittest.mock import MagicMock @@ -29,7 +31,7 @@ def test_execute_message_call(mocked_setup: MagicMock): laser_evm = LaserEVM({}) world_state = WorldState() - world_state.accounts["address"] = Account("address") + world_state.put_account(Account("0x0")) laser_evm.open_states = [world_state] laser_evm.exec = MagicMock() @@ -37,7 +39,7 @@ def test_execute_message_call(mocked_setup: MagicMock): mocked_setup.side_effect = _is_message_call # Act - execute_message_call(laser_evm, "address") + execute_message_call(laser_evm, symbol_factory.BitVecVal(0, 256)) # Assert # laser_evm.exec.assert_called_once() diff --git a/tests/native_test.py b/tests/native_test.py index c58a25e3..b9fd3671 100644 --- a/tests/native_test.py +++ b/tests/native_test.py @@ -3,6 +3,7 @@ from mythril.mythril import MythrilDisassembler from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.machine_state import MachineState from mythril.laser.ethereum.state.global_state import GlobalState +from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum import svm from tests import BaseTestCase @@ -29,13 +30,6 @@ IDENTITY_TEST[1] = (hex(476934798798347), False) def _all_info(laser): - accounts = {} - for address, _account in laser.world_state.accounts.items(): - account = _account.as_dict - account["code"] = account["code"].instruction_list - account["balance"] = str(account["balance"]) - accounts[address] = account - nodes = {} for uid, node in laser.nodes.items(): states = [] @@ -66,7 +60,6 @@ def _all_info(laser): edges = [edge.as_dict for edge in laser.edges] return { - "accounts": accounts, "nodes": nodes, "edges": edges, "total_states": laser.total_states, @@ -85,13 +78,13 @@ class NativeTests(BaseTestCase): """""" disassembly = SolidityContract( "./tests/native_tests.sol", - solc_binary=MythrilDisassembler._init_solc_binary("0.5.0"), + solc_binary=MythrilDisassembler._init_solc_binary("0.5.3"), ).disassembly account = Account("0x0000000000000000000000000000000000000000", disassembly) - accounts = {account.address: account} - - laser = svm.LaserEVM(accounts, max_depth=100, transaction_count=1) - laser.sym_exec(account.address) + world_state = WorldState() + world_state.put_account(account) + laser = svm.LaserEVM(max_depth=100, transaction_count=1) + laser.sym_exec(world_state=world_state, target_address=account.address.value) laser_info = str(_all_info(laser)) diff --git a/tests/report_test.py b/tests/report_test.py index 30e9cabd..e83f3d67 100644 --- a/tests/report_test.py +++ b/tests/report_test.py @@ -32,7 +32,7 @@ def _generate_report(input_file): contract = EVMContract(input_file.read_text(), enable_online_lookup=False) sym = SymExecWrapper( contract, - address=(util.get_indexed_address(0)), + address=0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE, strategy="dfs", execution_timeout=30, transaction_count=1, diff --git a/tests/testdata/outputs_expected/calls.sol.o.json b/tests/testdata/outputs_expected/calls.sol.o.json index 624cf510..fbcd2784 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.json +++ b/tests/testdata/outputs_expected/calls.sol.o.json @@ -1,123 +1,123 @@ { - "error":null, - "issues":[ - { - "address":661, - "contract":"Unknown", - "debug":"", - "description":"The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", - "function":"thisisfine()", - "max_gas_used":1254, - "min_gas_used":643, - "severity":"Low", - "sourceMap":null, - "swc-id":"107", - "title":"External Call To Fixed Address" - }, - { - "address":661, - "contract":"Unknown", - "debug":"", - "description":"The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", - "function":"thisisfine()", - "max_gas_used":35972, - "min_gas_used":1361, - "severity":"Low", - "sourceMap":null, - "swc-id":"104", - "title":"Unchecked Call Return Value" - }, - { - "address":779, - "contract":"Unknown", - "debug":"", - "description":"The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", - "function":"callstoredaddress()", - "max_gas_used":1298, - "min_gas_used":687, - "severity":"Low", - "sourceMap":null, - "swc-id":"107", - "title":"External Call To Fixed Address" - }, - { - "address":779, - "contract":"Unknown", - "debug":"", - "description":"The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", - "function":"callstoredaddress()", - "max_gas_used":36016, - "min_gas_used":1405, - "severity":"Low", - "sourceMap":null, - "swc-id":"104", - "title":"Unchecked Call Return Value" - }, - { - "address":858, - "contract":"Unknown", - "debug":"", - "description":"The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", - "function":"reentrancy()", - "max_gas_used":1320, - "min_gas_used":709, - "severity":"Low", - "sourceMap":null, - "swc-id":"107", - "title":"External Call To Fixed Address" - }, - { - "address":858, - "contract":"Unknown", - "debug":"", - "description":"The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", - "function":"reentrancy()", - "max_gas_used":61052, - "min_gas_used":6441, - "severity":"Low", - "sourceMap":null, - "swc-id":"104", - "title":"Unchecked Call Return Value" - }, - { - "address":869, - "contract":"Unknown", - "debug":"", - "description":"The contract account state is changed after an external call. \nConsider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.", - "function":"reentrancy()", - "max_gas_used":null, - "min_gas_used":null, - "severity":"Low", - "sourceMap":null, - "swc-id":"107", - "title":"State change after external call" - }, - { - "address":912, - "contract":"Unknown", - "debug":"", - "description":"A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", - "function":"calluseraddress(address)", - "max_gas_used":616, - "min_gas_used":335, - "severity":"Medium", - "sourceMap":null, - "swc-id":"107", - "title":"External Call To User-Supplied Address" - }, - { - "address":912, - "contract":"Unknown", - "debug":"", - "description":"The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", - "function":"calluseraddress(address)", - "max_gas_used":35336, - "min_gas_used":1055, - "severity":"Low", - "sourceMap":null, - "swc-id":"104", - "title":"Unchecked Call Return Value" - } - ], - "success":true -} + "error": null, + "issues": [ + { + "address": 661, + "contract": "Unknown", + "debug": "", + "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "function": "thisisfine()", + "max_gas_used": 1254, + "min_gas_used": 643, + "severity": "Low", + "sourceMap": null, + "swc-id": "107", + "title": "External Call To Fixed Address" + }, + { + "address": 661, + "contract": "Unknown", + "debug": "", + "description": "The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", + "function": "thisisfine()", + "max_gas_used": 35972, + "min_gas_used": 1361, + "severity": "Low", + "sourceMap": null, + "swc-id": "104", + "title": "Unchecked Call Return Value" + }, + { + "address": 779, + "contract": "Unknown", + "debug": "", + "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "function": "callstoredaddress()", + "max_gas_used": 1298, + "min_gas_used": 687, + "severity": "Low", + "sourceMap": null, + "swc-id": "107", + "title": "External Call To Fixed Address" + }, + { + "address": 779, + "contract": "Unknown", + "debug": "", + "description": "The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", + "function": "callstoredaddress()", + "max_gas_used": 36016, + "min_gas_used": 1405, + "severity": "Low", + "sourceMap": null, + "swc-id": "104", + "title": "Unchecked Call Return Value" + }, + { + "address": 858, + "contract": "Unknown", + "debug": "", + "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "function": "reentrancy()", + "max_gas_used": 1320, + "min_gas_used": 709, + "severity": "Low", + "sourceMap": null, + "swc-id": "107", + "title": "External Call To Fixed Address" + }, + { + "address": 858, + "contract": "Unknown", + "debug": "", + "description": "The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", + "function": "reentrancy()", + "max_gas_used": 61052, + "min_gas_used": 6441, + "severity": "Low", + "sourceMap": null, + "swc-id": "104", + "title": "Unchecked Call Return Value" + }, + { + "address": 869, + "contract": "Unknown", + "debug": "", + "description": "The contract account state is changed after an external call. \nConsider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.", + "function": "reentrancy()", + "max_gas_used": null, + "min_gas_used": null, + "severity": "Low", + "sourceMap": null, + "swc-id": "107", + "title": "State change after external call" + }, + { + "address": 912, + "contract": "Unknown", + "debug": "", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", + "function": "calluseraddress(address)", + "max_gas_used": 616, + "min_gas_used": 335, + "severity": "Medium", + "sourceMap": null, + "swc-id": "107", + "title": "External Call To User-Supplied Address" + }, + { + "address": 912, + "contract": "Unknown", + "debug": "", + "description": "The return value of a message call is not checked.\nExternal calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states.", + "function": "calluseraddress(address)", + "max_gas_used": 35336, + "min_gas_used": 1055, + "severity": "Low", + "sourceMap": null, + "swc-id": "104", + "title": "Unchecked Call Return Value" + } + ], + "success": true +} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/calls.sol.o.jsonv2 b/tests/testdata/outputs_expected/calls.sol.o.jsonv2 index 44d5bc89..624d3410 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/calls.sol.o.jsonv2 @@ -162,4 +162,4 @@ ], "sourceType": "raw-bytecode" } -] +] \ No newline at end of file diff --git a/tests/testdata/outputs_expected/environments.sol.o.json b/tests/testdata/outputs_expected/environments.sol.o.json deleted file mode 100644 index d4ae2a37..00000000 --- a/tests/testdata/outputs_expected/environments.sol.o.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "error": null, - "issues": [ - { - "address": 158, - "contract": "Unknown", - "debug": "", - "description": "The arithmetic operation can result in integer overflow.\n", - "function": "_function_0x83f12fec", - "swc-id": "101", - "title": "Integer Overflow", - "type": "Warning" - }, - { - "address": 278, - "contract": "Unknown", - "debug": "", - "description": "The arithmetic operation can result in integer overflow.\n", - "function": "_function_0x83f12fec", - "swc-id": "101", - "title": "Integer Overflow", - "type": "Warning" - }, - { - "address": 378, - "contract": "Unknown", - "debug": "", - "description": "The substraction can result in an integer underflow.\n", - "function": "_function_0x83f12fec", - "swc-id": "101", - "title": "Integer Underflow", - "type": "Warning" - } - ], - "success": true -} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/environments.sol.o.markdown b/tests/testdata/outputs_expected/environments.sol.o.markdown deleted file mode 100644 index c9630745..00000000 --- a/tests/testdata/outputs_expected/environments.sol.o.markdown +++ /dev/null @@ -1,34 +0,0 @@ -# Analysis results for test-filename.sol - -## Integer Overflow -- SWC ID: 101 -- Type: Warning -- Contract: Unknown -- Function name: `_function_0x83f12fec` -- PC address: 158 - -### Description - -The arithmetic operation can result in integer overflow. - -## Integer Overflow -- SWC ID: 101 -- Type: Warning -- Contract: Unknown -- Function name: `_function_0x83f12fec` -- PC address: 278 - -### Description - -The arithmetic operation can result in integer overflow. - -## Integer Underflow -- SWC ID: 101 -- Type: Warning -- Contract: Unknown -- Function name: `_function_0x83f12fec` -- PC address: 378 - -### Description - -The substraction can result in an integer underflow. diff --git a/tests/testdata/outputs_expected/environments.sol.o.text b/tests/testdata/outputs_expected/environments.sol.o.text deleted file mode 100644 index ef673002..00000000 --- a/tests/testdata/outputs_expected/environments.sol.o.text +++ /dev/null @@ -1,30 +0,0 @@ -==== Integer Overflow ==== -SWC ID: 101 -Type: Warning -Contract: Unknown -Function name: _function_0x83f12fec -PC address: 158 -The arithmetic operation can result in integer overflow. - --------------------- - -==== Integer Overflow ==== -SWC ID: 101 -Type: Warning -Contract: Unknown -Function name: _function_0x83f12fec -PC address: 278 -The arithmetic operation can result in integer overflow. - --------------------- - -==== Integer Underflow ==== -SWC ID: 101 -Type: Warning -Contract: Unknown -Function name: _function_0x83f12fec -PC address: 378 -The substraction can result in an integer underflow. - --------------------- - diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 b/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 index 3bce29c2..9f1597a1 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 @@ -1 +1,11 @@ -[{"issues": [], "meta": {}, "sourceFormat": "evm-byzantium-bytecode", "sourceList": ["0x3746c7c2ae7b0d4c3f8b1905df9a7ea169b9f93bec68a10a00b4c9d27a18c6fb"], "sourceType": "raw-bytecode"}] +[ + { + "issues": [], + "meta": {}, + "sourceFormat": "evm-byzantium-bytecode", + "sourceList": [ + "0x3746c7c2ae7b0d4c3f8b1905df9a7ea169b9f93bec68a10a00b4c9d27a18c6fb" + ], + "sourceType": "raw-bytecode" + } +] \ No newline at end of file diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 index f7da0197..4f0d13e0 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 @@ -94,4 +94,4 @@ ], "sourceType": "raw-bytecode" } -] +] \ No newline at end of file diff --git a/tests/testdata/outputs_expected/metacoin.sol.o.jsonv2 b/tests/testdata/outputs_expected/metacoin.sol.o.jsonv2 index c669f304..40de69b4 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/metacoin.sol.o.jsonv2 @@ -1 +1,11 @@ -[{"issues": [], "meta": {}, "sourceFormat": "evm-byzantium-bytecode", "sourceList": ["0x0e6f727bb3301e02d3be831bf34357522fd2f1d40e90dff8e2214553b06b5f6c"], "sourceType": "raw-bytecode"}] +[ + { + "issues": [], + "meta": {}, + "sourceFormat": "evm-byzantium-bytecode", + "sourceList": [ + "0x0e6f727bb3301e02d3be831bf34357522fd2f1d40e90dff8e2214553b06b5f6c" + ], + "sourceType": "raw-bytecode" + } +] \ No newline at end of file diff --git a/tests/testdata/outputs_expected/nonascii.sol.o.jsonv2 b/tests/testdata/outputs_expected/nonascii.sol.o.jsonv2 index be2cc307..0667ad8c 100644 --- a/tests/testdata/outputs_expected/nonascii.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/nonascii.sol.o.jsonv2 @@ -1 +1,11 @@ -[{"issues": [], "meta": {}, "sourceFormat": "evm-byzantium-bytecode", "sourceList": ["0x11a78eb09819f505ba4f10747e6d1f7a44480e602c67573b7abac2f733a85d93"], "sourceType": "raw-bytecode"}] +[ + { + "issues": [], + "meta": {}, + "sourceFormat": "evm-byzantium-bytecode", + "sourceList": [ + "0x11a78eb09819f505ba4f10747e6d1f7a44480e602c67573b7abac2f733a85d93" + ], + "sourceType": "raw-bytecode" + } +] \ No newline at end of file diff --git a/tests/testdata/outputs_expected/overflow.sol.o.json b/tests/testdata/outputs_expected/overflow.sol.o.json index 89fdb839..c8d029f7 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.json +++ b/tests/testdata/outputs_expected/overflow.sol.o.json @@ -26,6 +26,19 @@ "sourceMap": null, "swc-id": "101", "title": "Integer Underflow" + }, + { + "address": 725, + "contract": "Unknown", + "debug": "", + "description": "The binary addition can overflow.\nThe operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion.", + "function": "sendeth(address,uint256)", + "max_gas_used": 78155, + "min_gas_used": 17019, + "severity": "High", + "sourceMap": null, + "swc-id": "101", + "title": "Integer Overflow" } ], "success": true diff --git a/tests/testdata/outputs_expected/overflow.sol.o.jsonv2 b/tests/testdata/outputs_expected/overflow.sol.o.jsonv2 index dfcc29d5..570fdeba 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/overflow.sol.o.jsonv2 @@ -34,6 +34,23 @@ "severity": "High", "swcID": "SWC-101", "swcTitle": "Integer Overflow and Underflow" + }, + { + "description": { + "head": "The binary addition can overflow.", + "tail": "The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion." + }, + "extra": { + "discoveryTime": "" + }, + "locations": [ + { + "sourceMap": "725:1:0" + } + ], + "severity": "High", + "swcID": "SWC-101", + "swcTitle": "Integer Overflow and Underflow" } ], "meta": {}, diff --git a/tests/testdata/outputs_expected/overflow.sol.o.markdown b/tests/testdata/outputs_expected/overflow.sol.o.markdown index 8774d894..82642a1e 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.markdown +++ b/tests/testdata/outputs_expected/overflow.sol.o.markdown @@ -25,3 +25,16 @@ The operands of the subtraction operation are not sufficiently constrained. The The binary subtraction can underflow. The operands of the subtraction operation are not sufficiently constrained. The subtraction could therefore result in an integer underflow. Prevent the underflow by checking inputs or ensure sure that the underflow is caught by an assertion. + +## Integer Overflow +- SWC ID: 101 +- Severity: High +- Contract: Unknown +- Function name: `sendeth(address,uint256)` +- PC address: 725 +- Estimated Gas Usage: 17019 - 78155 + +### Description + +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. diff --git a/tests/testdata/outputs_expected/overflow.sol.o.text b/tests/testdata/outputs_expected/overflow.sol.o.text index 698665d8..e70dda5b 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.text +++ b/tests/testdata/outputs_expected/overflow.sol.o.text @@ -20,3 +20,14 @@ The binary subtraction can underflow. The operands of the subtraction operation are not sufficiently constrained. The subtraction could therefore result in an integer underflow. Prevent the underflow by checking inputs or ensure sure that the underflow is caught by an assertion. -------------------- +==== Integer Overflow ==== +SWC ID: 101 +Severity: High +Contract: Unknown +Function name: sendeth(address,uint256) +PC address: 725 +Estimated Gas Usage: 17019 - 78155 +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. +-------------------- + diff --git a/tests/testdata/outputs_expected/rubixi.sol.o.json b/tests/testdata/outputs_expected/rubixi.sol.o.json deleted file mode 100644 index d328ade0..00000000 --- a/tests/testdata/outputs_expected/rubixi.sol.o.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "success": true, - "error": null, - "issues": [ - { - "title": "Ether send", - "description": "In the function `_function_0x4229616d` a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.", - "function": "_function_0x4229616d", - "type": "Warning", - "address": 1599, - "debug": "" - }, - { - "title": "Ether send", - "description": "In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.", - "function": "_function_0xb4022950", - "type": "Warning", - "address": 1940, - "debug": "" - }, - { - "title": "Ether send", - "description": "In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.\nThere is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.", - "function": "_function_0xb4022950", - "type": "Warning", - "address": 2582, - "debug": "" - }, - { - "title": "Exception state", - "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", - "function": "_function_0x57d4021b", - "type": "Informational", - "address": 1653, - "debug": "" - }, - { - "title": "Exception state", - "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", - "function": "_function_0x9dbc4f9b", - "type": "Informational", - "address": 2085, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "fallback", - "type": "Informational", - "address": 3111, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "fallback", - "type": "Informational", - "address": 3140, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "fallback", - "type": "Informational", - "address": 2950, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "fallback", - "type": "Informational", - "address": 1268, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x09dfdc71", - "type": "Informational", - "address": 310, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x09dfdc71", - "type": "Informational", - "address": 1316, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x253459e3", - "type": "Informational", - "address": 1375, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x4229616d", - "type": "Informational", - "address": 1511, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x57d4021b", - "type": "Informational", - "address": 1679, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x6fbaaa1e", - "type": "Informational", - "address": 618, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x8a5fb3ca", - "type": "Informational", - "address": 805, - "debug": "" - }, - { - "title": "Invariant branch condition", - "description": "Found a conditional jump which always follows the same branch", - "function": "_function_0x9dbc4f9b", - "type": "Informational", - "address": 2187, - "debug": "" - }, - { - "title": "Unchecked CALL return value", - "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", - "function": "_function_0x4229616d", - "type": "Informational", - "address": 1599, - "debug": "" - }, - { - "title": "Unchecked CALL return value", - "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", - "function": "_function_0xb4022950", - "type": "Informational", - "address": 1940, - "debug": "" - }, - { - "title": "Unchecked CALL return value", - "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", - "function": "_function_0xb4022950", - "type": "Informational", - "address": 2582, - "debug": "" - } - ] -} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/rubixi.sol.o.markdown b/tests/testdata/outputs_expected/rubixi.sol.o.markdown deleted file mode 100644 index ba755c49..00000000 --- a/tests/testdata/outputs_expected/rubixi.sol.o.markdown +++ /dev/null @@ -1,238 +0,0 @@ -# Analysis results for test-filename.sol - -## Ether send - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0x4229616d` -- PC address: 1599 - -### Description - -In the function `_function_0x4229616d` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. - -## Ether send - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0xb4022950` -- PC address: 1940 - -### Description - -In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. - -## Ether send - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0xb4022950` -- PC address: 2582 - -### Description - -In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. - -## Exception state - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x57d4021b` -- PC address: 1653 - -### Description - -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. - -## Exception state - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x9dbc4f9b` -- PC address: 2085 - -### Description - -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `fallback` -- PC address: 3111 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `fallback` -- PC address: 3140 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `fallback` -- PC address: 2950 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `fallback` -- PC address: 1268 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x09dfdc71` -- PC address: 310 - -### Description - -Found a conditional jump which always follows the same branch, value: False - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x09dfdc71` -- PC address: 1316 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x253459e3` -- PC address: 1375 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x4229616d` -- PC address: 1511 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x57d4021b` -- PC address: 1679 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x6fbaaa1e` -- PC address: 618 - -### Description - -Found a conditional jump which always follows the same branch, value: False - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x8a5fb3ca` -- PC address: 805 - -### Description - -Found a conditional jump which always follows the same branch, value: False - -## Tautology - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x9dbc4f9b` -- PC address: 2187 - -### Description - -Found a conditional jump which always follows the same branch, value: True - -## Unchecked CALL return value - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0x4229616d` -- PC address: 1599 - -### Description - -The return value of an external call is not checked. Note that execution continue even if the called contract throws. - -## Unchecked CALL return value - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0xb4022950` -- PC address: 1940 - -### Description - -The return value of an external call is not checked. Note that execution continue even if the called contract throws. - -## Unchecked CALL return value - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0xb4022950` -- PC address: 2582 - -### Description - -The return value of an external call is not checked. Note that execution continue even if the called contract throws. \ No newline at end of file diff --git a/tests/testdata/outputs_expected/rubixi.sol.o.text b/tests/testdata/outputs_expected/rubixi.sol.o.text deleted file mode 100644 index 80a40a7f..00000000 --- a/tests/testdata/outputs_expected/rubixi.sol.o.text +++ /dev/null @@ -1,177 +0,0 @@ -==== Ether send ==== -Type: Warning -Contract: Unknown -Function name: _function_0x4229616d -PC address: 1599 -In the function `_function_0x4229616d` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. --------------------- - -==== Ether send ==== -Type: Warning -Contract: Unknown -Function name: _function_0xb4022950 -PC address: 1940 -In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. --------------------- - -==== Ether send ==== -Type: Warning -Contract: Unknown -Function name: _function_0xb4022950 -PC address: 2582 -In the function `_function_0xb4022950` a non-zero amount of Ether is sent to an address taken from storage slot 5. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. - -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 5. This storage slot can be written to by calling the function `_function_0x67f809e9`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. --------------------- - -==== Exception state ==== -Type: Informational -Contract: Unknown -Function name: _function_0x57d4021b -PC address: 1653 -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. --------------------- - -==== Exception state ==== -Type: Informational -Contract: Unknown -Function name: _function_0x9dbc4f9b -PC address: 2085 -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: fallback -PC address: 3111 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: fallback -PC address: 3140 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: fallback -PC address: 2950 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: fallback -PC address: 1268 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x09dfdc71 -PC address: 310 -Found a conditional jump which always follows the same branch, value: False --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x09dfdc71 -PC address: 1316 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x253459e3 -PC address: 1375 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x4229616d -PC address: 1511 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x57d4021b -PC address: 1679 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x6fbaaa1e -PC address: 618 -Found a conditional jump which always follows the same branch, value: False --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x8a5fb3ca -PC address: 805 -Found a conditional jump which always follows the same branch, value: False --------------------- - -==== Tautology ==== -Type: Informational -Contract: Unknown -Function name: _function_0x9dbc4f9b -PC address: 2187 -Found a conditional jump which always follows the same branch, value: True --------------------- - -==== Unchecked CALL return value ==== -Type: Informational -Contract: Unknown -Function name: _function_0x4229616d -PC address: 1599 -The return value of an external call is not checked. Note that execution continue even if the called contract throws. --------------------- - -==== Unchecked CALL return value ==== -Type: Informational -Contract: Unknown -Function name: _function_0xb4022950 -PC address: 1940 -The return value of an external call is not checked. Note that execution continue even if the called contract throws. --------------------- - -==== Unchecked CALL return value ==== -Type: Informational -Contract: Unknown -Function name: _function_0xb4022950 -PC address: 2582 -The return value of an external call is not checked. Note that execution continue even if the called contract throws. --------------------- - diff --git a/tests/testdata/outputs_expected/underflow.sol.o.json b/tests/testdata/outputs_expected/underflow.sol.o.json index 6a2464d5..a0042598 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.json +++ b/tests/testdata/outputs_expected/underflow.sol.o.json @@ -26,6 +26,19 @@ "sourceMap": null, "swc-id": "101", "title": "Integer Underflow" + }, + { + "address": 725, + "contract": "Unknown", + "debug": "", + "description": "The binary addition can overflow.\nThe operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion.", + "function": "sendeth(address,uint256)", + "max_gas_used": 52861, + "min_gas_used": 11915, + "severity": "High", + "sourceMap": null, + "swc-id": "101", + "title": "Integer Overflow" } ], "success": true diff --git a/tests/testdata/outputs_expected/underflow.sol.o.jsonv2 b/tests/testdata/outputs_expected/underflow.sol.o.jsonv2 index 94854e04..b6611bdd 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/underflow.sol.o.jsonv2 @@ -34,6 +34,23 @@ "severity": "High", "swcID": "SWC-101", "swcTitle": "Integer Overflow and Underflow" + }, + { + "description": { + "head": "The binary addition can overflow.", + "tail": "The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion." + }, + "extra": { + "discoveryTime": "" + }, + "locations": [ + { + "sourceMap": "725:1:0" + } + ], + "severity": "High", + "swcID": "SWC-101", + "swcTitle": "Integer Overflow and Underflow" } ], "meta": {}, diff --git a/tests/testdata/outputs_expected/underflow.sol.o.markdown b/tests/testdata/outputs_expected/underflow.sol.o.markdown index 48399072..acc444d4 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.markdown +++ b/tests/testdata/outputs_expected/underflow.sol.o.markdown @@ -25,3 +25,16 @@ The operands of the subtraction operation are not sufficiently constrained. The The binary subtraction can underflow. The operands of the subtraction operation are not sufficiently constrained. The subtraction could therefore result in an integer underflow. Prevent the underflow by checking inputs or ensure sure that the underflow is caught by an assertion. + +## Integer Overflow +- SWC ID: 101 +- Severity: High +- Contract: Unknown +- Function name: `sendeth(address,uint256)` +- PC address: 725 +- Estimated Gas Usage: 11915 - 52861 + +### Description + +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. diff --git a/tests/testdata/outputs_expected/underflow.sol.o.text b/tests/testdata/outputs_expected/underflow.sol.o.text index 16701a04..498ff588 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.text +++ b/tests/testdata/outputs_expected/underflow.sol.o.text @@ -20,3 +20,14 @@ The binary subtraction can underflow. The operands of the subtraction operation are not sufficiently constrained. The subtraction could therefore result in an integer underflow. Prevent the underflow by checking inputs or ensure sure that the underflow is caught by an assertion. -------------------- +==== Integer Overflow ==== +SWC ID: 101 +Severity: High +Contract: Unknown +Function name: sendeth(address,uint256) +PC address: 725 +Estimated Gas Usage: 11915 - 52861 +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. +-------------------- + diff --git a/tests/testdata/outputs_expected/weak_random.sol.o.json b/tests/testdata/outputs_expected/weak_random.sol.o.json deleted file mode 100644 index 2338b178..00000000 --- a/tests/testdata/outputs_expected/weak_random.sol.o.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "success": true, - "error": null, - "issues": [ - { - "title": "Dependence on predictable environment variable", - "description": "In the function `_function_0xe9874106` the following predictable state variables are used to determine Ether recipient:\n- block.coinbase\n", - "function": "_function_0xe9874106", - "type": "Warning", - "address": 1285, - "debug": "" - }, - { - "title": "Ether send", - "description": "In the function `_function_0xe9874106` a non-zero amount of Ether is sent to an address taken from storage slot 0.\nThere is a check on storage index 0. This storage slot can be written to by calling the function `fallback`.\n\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.\nThere is a check on storage index 1. This storage slot can be written to by calling the function `fallback`.", - "function": "_function_0xe9874106", - "type": "Warning", - "address": 1285, - "debug": "" - }, - { - "title": "Exception state", - "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", - "function": "fallback", - "type": "Informational", - "address": 356, - "debug": "" - }, - { - "title": "Exception state", - "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", - "function": "_function_0xe9874106", - "type": "Informational", - "address": 146, - "debug": "" - }, - { - "title": "Transaction order dependence", - "description": "A possible transaction order independence vulnerability exists in function _function_0xe9874106. The value or direction of the call statement is determined from a tainted storage location", - "function": "_function_0xe9874106", - "type": "Warning", - "address": 1285, - "debug": "" - } - ] -} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/weak_random.sol.o.markdown b/tests/testdata/outputs_expected/weak_random.sol.o.markdown deleted file mode 100644 index b5744566..00000000 --- a/tests/testdata/outputs_expected/weak_random.sol.o.markdown +++ /dev/null @@ -1,62 +0,0 @@ -# Analysis results for test-filename.sol - -## Dependence on predictable environment variable - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0xe9874106` -- PC address: 1285 - -### Description - -In the function `_function_0xe9874106` the following predictable state variables are used to determine Ether recipient: -- block.coinbase - - -## Ether send - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0xe9874106` -- PC address: 1285 - -### Description - -In the function `_function_0xe9874106` a non-zero amount of Ether is sent to an address taken from storage slot 0. -There is a check on storage index 0. This storage slot can be written to by calling the function `fallback`. - -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. - -## Exception state - -- Type: Informational -- Contract: Unknown -- Function name: `fallback` -- PC address: 356 - -### Description - -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. - -## Exception state - -- Type: Informational -- Contract: Unknown -- Function name: `_function_0xe9874106` -- PC address: 146 - -### Description - -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. - -## Transaction order dependence - -- Type: Warning -- Contract: Unknown -- Function name: `_function_0xe9874106` -- PC address: 1285 - -### Description - -A possible transaction order independence vulnerability exists in function _function_0xe9874106. The value or direction of the call statement is determined from a tainted storage location \ No newline at end of file diff --git a/tests/testdata/outputs_expected/weak_random.sol.o.text b/tests/testdata/outputs_expected/weak_random.sol.o.text deleted file mode 100644 index 9e105cfe..00000000 --- a/tests/testdata/outputs_expected/weak_random.sol.o.text +++ /dev/null @@ -1,46 +0,0 @@ -==== Dependence on predictable environment variable ==== -Type: Warning -Contract: Unknown -Function name: _function_0xe9874106 -PC address: 1285 -In the function `_function_0xe9874106` the following predictable state variables are used to determine Ether recipient: -- block.coinbase - --------------------- - -==== Ether send ==== -Type: Warning -Contract: Unknown -Function name: _function_0xe9874106 -PC address: 1285 -In the function `_function_0xe9874106` a non-zero amount of Ether is sent to an address taken from storage slot 0. -There is a check on storage index 0. This storage slot can be written to by calling the function `fallback`. - -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. -There is a check on storage index 1. This storage slot can be written to by calling the function `fallback`. --------------------- - -==== Exception state ==== -Type: Informational -Contract: Unknown -Function name: fallback -PC address: 356 -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. --------------------- - -==== Exception state ==== -Type: Informational -Contract: Unknown -Function name: _function_0xe9874106 -PC address: 146 -A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking. --------------------- - -==== Transaction order dependence ==== -Type: Warning -Contract: Unknown -Function name: _function_0xe9874106 -PC address: 1285 -A possible transaction order independence vulnerability exists in function _function_0xe9874106. The value or direction of the call statement is determined from a tainted storage location --------------------- - From 111f1f166f60cf394bb70d57a1365e541e4cf6d7 Mon Sep 17 00:00:00 2001 From: Xiao Liang Date: Thu, 16 May 2019 15:58:06 +0800 Subject: [PATCH 44/97] Dockerfile improvement (#1017) * build(dockerfile): support preinstalling custom solc * build(dockerfile): run with normal user mythril * build(dockerfile): fix install SOLC command & install under mythril user * fix.build(dockerfile): when build-time argument SOLC not specified * fix.build & chore(dockerfile): copy signature db to user directory & remove CHOWN operation for copied files Fix copying to `signatures.db` to root home directory mistake. `chown` operation was unnecessary and removed. --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1a17a17e..9843f72a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM ubuntu:bionic +# Space-separated version string without leading 'v' (e.g. "0.4.21 0.4.22") +ARG SOLC + RUN apt-get update \ && apt-get install -y \ libsqlite3-0 \ @@ -36,5 +39,12 @@ COPY . /opt/mythril RUN cd /opt/mythril \ && python setup.py install -COPY ./mythril/support/assets/signatures.db /root/.mythril/signatures.db +RUN useradd -m mythril +USER mythril +WORKDIR /home/mythril + +RUN ( [ ! -z "${SOLC}" ] && set -e && for ver in $SOLC; do python -m solc.install v${ver}; done ) || true + +COPY ./mythril/support/assets/signatures.db /home/mythril/.mythril/signatures.db + ENTRYPOINT ["/usr/local/bin/myth"] From 02b902637c2e6b1725346e430107d056857f4351 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Fri, 17 May 2019 01:23:53 +0200 Subject: [PATCH 45/97] Adds Docker pulls shield to README.md... also renames "Downloads" into "PyPI Installs" to avoid confusions. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ad0e66dc..fcbe2cc9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ ![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril-classic/master.svg) [![Waffle.io - Columns and their card count](https://badge.waffle.io/ConsenSys/mythril-classic.svg?columns=In%20Progress)](https://waffle.io/ConsenSys/mythril-classic/) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) -[![Downloads](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) +[![PyPI Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) +[![DockerHub Pulls](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth)](https://img.shields.io/docker/pulls/mythril/myth.svg) Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. From e24b2bc7722bd494bf9f5aa6703b14192bddc139 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Fri, 17 May 2019 01:28:40 +0200 Subject: [PATCH 46/97] Fix of the previous commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fcbe2cc9..2ea489ef 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![Waffle.io - Columns and their card count](https://badge.waffle.io/ConsenSys/mythril-classic.svg?columns=In%20Progress)](https://waffle.io/ConsenSys/mythril-classic/) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) [![PyPI Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) -[![DockerHub Pulls](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth)](https://img.shields.io/docker/pulls/mythril/myth.svg) +[![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. From c5d59ce623dac6d922b21b6e987ba06012076a05 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Fri, 17 May 2019 01:45:19 +0200 Subject: [PATCH 47/97] Another fix of the previous commit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ea489ef..766128cc 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ ![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril-classic/master.svg) [![Waffle.io - Columns and their card count](https://badge.waffle.io/ConsenSys/mythril-classic.svg?columns=In%20Progress)](https://waffle.io/ConsenSys/mythril-classic/) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) -[![PyPI Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) -[![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) +[![PyPI Installs](https://img.shields.io/pypi/dm/ansicolortags.svg?label=PyPI Installs)](https://pypi.org/project/mythril/) +[![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. From 4ee2270168e5ea254d13b1485f976d1b1fa2aeff Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 14:08:52 +0200 Subject: [PATCH 48/97] Update mythril/analysis/modules/dependence_on_predictable_vars.py Co-Authored-By: Nikhil Parasaram --- mythril/analysis/modules/dependence_on_predictable_vars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index e97728c8..c1d2a2b1 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -195,7 +195,7 @@ def _analyze_states(state: GlobalState) -> list: state.mstate.stack[-1].annotate( PredictableValueAnnotation( - "block." + opcode.lower() + " environment variable" + "block.{} environment variable".format(opcode.lower()) ) ) From dce7d9dc7c667f5de329fdea5185eea419408fa9 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 14:10:33 +0200 Subject: [PATCH 49/97] Add suggestion from norhh --- mythril/analysis/modules/dependence_on_predictable_vars.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index c1d2a2b1..efc326dd 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -190,6 +190,7 @@ def _analyze_states(state: GlobalState) -> list: state.mstate.stack[-1].annotate( PredictableValueAnnotation("block hash of a previous block") ) + break else: # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is executed. From d1d4460605368335abeb55d62e0790571a5355b8 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 14:17:16 +0200 Subject: [PATCH 50/97] Add norhh suggestion #2 --- mythril/laser/ethereum/instructions.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index fe0ce2e8..32b48ce7 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -942,13 +942,19 @@ class Instruction: data = symbol_factory.BitVecVal(0, 1) if data.symbolic: + + annotations = [] + + for b in state.memory[index : index + length]: + annotations.append(b.annotations) + argument_str = str(state.memory[index]).replace(" ", "_") result = symbol_factory.BitVecFuncSym( "KECCAC[{}]".format(argument_str), "keccak256", 256, input_=data, - annotations=state.memory[index].annotations, + annotations=annotations, ) log.debug("Created BitVecFunc hash.") From 2a6b282ecaea494b5c7b7980f0c0d3e8fb64ca39 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 14:29:06 +0200 Subject: [PATCH 51/97] Check if variable is BitVec before copying annotations --- mythril/laser/ethereum/instructions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 59bb7dc0..ef15c879 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -946,7 +946,8 @@ class Instruction: annotations = [] for b in state.memory[index : index + length]: - annotations.append(b.annotations) + if isinstance(b, BitVec): + annotations.append(b.annotations) argument_str = str(state.memory[index]).replace(" ", "_") result = symbol_factory.BitVecFuncSym( From 990e84f66a84822ea373b96ee9ccec065cc4fc3a Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 14:36:12 +0200 Subject: [PATCH 52/97] Re-add block_number class variable to environment --- mythril/laser/ethereum/state/environment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mythril/laser/ethereum/state/environment.py b/mythril/laser/ethereum/state/environment.py index 0f467413..a3300f9a 100644 --- a/mythril/laser/ethereum/state/environment.py +++ b/mythril/laser/ethereum/state/environment.py @@ -40,6 +40,7 @@ class Environment: self.active_function_name = "" self.address = active_account.address + self.block_number = symbol_factory.BitVecSym("block_number", 256) # Ib self.code = active_account.code if code is None else code From 23478f43ecc8dc406acbf48b98f893ff8c55911e Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 16:00:54 +0200 Subject: [PATCH 53/97] Add typehints, remove debug statements --- .../analysis/modules/dependence_on_predictable_vars.py | 9 +++------ mythril/laser/ethereum/instructions.py | 5 ----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index efc326dd..8aaa375c 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -18,18 +18,15 @@ predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"] final_ops = ["CALL", "SUICIDE", "STOP", "RETURN"] -# One of Bernhard's trademark hacks! - - -def is_prehook(): - """Check if we are in prehook.""" +def is_prehook() -> bool: + """Check if we are in prehook. One of Bernhard's trademark hacks!""" return "pre_hook" in traceback.format_stack()[-4] class PredictableValueAnnotation: """Symbol annotation used if a variable is initialized from a predictable environment variable.""" - def __init__(self, operation) -> None: + def __init__(self, operation: str) -> None: self.operation = operation diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index ef15c879..f17d4401 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -203,9 +203,6 @@ class Instruction: end_time = datetime.now() self.iprof.record(op, start_time, end_time) - for st in global_state.mstate.stack: - logging.debug(st) - return result @StateTransition() @@ -1601,8 +1598,6 @@ class Instruction: op0, condition = state.stack.pop(), state.stack.pop() - logging.debug(str(condition)) - try: jump_addr = util.get_concrete_int(op0) except TypeError: From 2cfa81ba2ce1c708c459a8c98ef3e67b106acd70 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 16:02:05 +0200 Subject: [PATCH 54/97] Fix typo in commnent --- mythril/analysis/modules/dependence_on_predictable_vars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 8aaa375c..5bb7e59e 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -107,7 +107,7 @@ def _analyze_states(state: GlobalState) -> list: ) """ - Usually report low severity except in cases where thje hash of a previous block is used to + Usually report low severity except in cases where the hash of a previous block is used to determine control flow. """ From c03ddd4ae066e2c5851ac5fc4514d5219dcf4fe3 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 20 May 2019 10:38:45 +0200 Subject: [PATCH 55/97] Modify report text --- mythril/analysis/modules/dependence_on_predictable_vars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 5bb7e59e..d2dbdcd1 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -97,7 +97,7 @@ def _analyze_states(state: GlobalState) -> list: description = ( "The " + annotation.operation - + " is used in to determine an important control flow decision. " + + " is used in to determine a control flow decision. " ) description += ( "Note that the values of variables like coinbase, gaslimit, block number and timestamp " From f6dc443aeb39632860e9d41554a9a8ab0b5aebce Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 20 May 2019 19:04:38 +0200 Subject: [PATCH 56/97] Fix badges --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 766128cc..5e7b1eca 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,8 @@ [![PyPI](https://badge.fury.io/py/mythril.svg)](https://pypi.python.org/pypi/mythril) [![Read the Docs](https://readthedocs.org/projects/mythril-classic/badge/?version=master)](https://mythril-classic.readthedocs.io/en/master/) ![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril-classic/master.svg) -[![Waffle.io - Columns and their card count](https://badge.waffle.io/ConsenSys/mythril-classic.svg?columns=In%20Progress)](https://waffle.io/ConsenSys/mythril-classic/) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) -[![PyPI Installs](https://img.shields.io/pypi/dm/ansicolortags.svg?label=PyPI Installs)](https://pypi.org/project/mythril/) +[![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril)] [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. From fb8968157e89d238bd436f6e340643c04bf7eca2 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 20 May 2019 19:06:05 +0200 Subject: [PATCH 57/97] Fix badges (2) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e7b1eca..01ba10cf 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Read the Docs](https://readthedocs.org/projects/mythril-classic/badge/?version=master)](https://mythril-classic.readthedocs.io/en/master/) ![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril-classic/master.svg) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) -[![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril)] +[![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. From 9bbb9841fdd46b3543c269fb5757aff13ffad779 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 20 May 2019 19:18:54 +0200 Subject: [PATCH 58/97] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 01ba10cf..dcb9cccc 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,7 @@ [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. - -Note that Mythril Classic is designed for security auditors. If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues: - -- [Sabre](https://github.com/b-mueller/sabre) -- [MythX Plugin for Truffle](https://github.com/ConsenSys/truffle-security) +Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. Whether you want to contribute, need support, or want to learn what we have cooking for the future, our [Discord server](https://discord.gg/E3YrVtG) will serve your needs. From 441ba16276f9d6e04266e1cb066d244d1cfb5f9d Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 10:33:07 +0200 Subject: [PATCH 59/97] Mythril Classic -> Mythril --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dcb9cccc..4924d94d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mythril Classic +# Mythril

@@ -6,13 +6,13 @@ [![Discord](https://img.shields.io/discord/481002907366588416.svg)](https://discord.gg/E3YrVtG) [![PyPI](https://badge.fury.io/py/mythril.svg)](https://pypi.python.org/pypi/mythril) -[![Read the Docs](https://readthedocs.org/projects/mythril-classic/badge/?version=master)](https://mythril-classic.readthedocs.io/en/master/) -![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril-classic/master.svg) +[![Read the Docs](https://readthedocs.org/projects/mythril/badge/?version=master)](https://mythril.readthedocs.io/en/master/) +![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril/master.svg) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril Classic is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. +Mythril is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. Whether you want to contribute, need support, or want to learn what we have cooking for the future, our [Discord server](https://discord.gg/E3YrVtG) will serve your needs. @@ -34,12 +34,12 @@ See the [Wiki](https://github.com/ConsenSys/mythril/wiki/Installation-and-Setup) ## Usage -Instructions for using Mythril Classic are found on the [Wiki](https://github.com/ConsenSys/mythril-classic/wiki). +Instructions for using Mythril are found on the [Wiki](https://github.com/ConsenSys/mythril/wiki). For support or general discussions please join the Mythril community on [Discord](https://discord.gg/E3YrVtG). ## Bulding the Documentation -Mythril Classic's documentation is contained in the `docs` folder and is published to [Read the Docs](https://mythril-classic.readthedocs.io/en/master/). It is based on Sphinx and can be built using the Makefile contained in the subdirectory: +Mythril's documentation is contained in the `docs` folder and is published to [Read the Docs](https://mythril.readthedocs.io/en/master/). It is based on Sphinx and can be built using the Makefile contained in the subdirectory: ``` cd docs From b6c51e8e17144531ddc13ba0ed3e6d605087183b Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 17:37:33 +0200 Subject: [PATCH 60/97] Add DOS detection module --- mythril/analysis/modules/dos.py | 110 ++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 mythril/analysis/modules/dos.py diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py new file mode 100644 index 00000000..0b948a93 --- /dev/null +++ b/mythril/analysis/modules/dos.py @@ -0,0 +1,110 @@ +"""This module contains the detection code for insecure delegate call usage.""" + +import logging +from typing import List + +from mythril.analysis.swc_data import DOS_WITH_BLOCK_GAS_LIMIT +from mythril.analysis.report import Issue +from mythril.analysis.modules.base import DetectionModule +from mythril.laser.ethereum.state.global_state import GlobalState +from mythril.laser.ethereum.state.annotation import StateAnnotation +from mythril.laser.ethereum import util + +log = logging.getLogger(__name__) + + +class LoopAnnotation(StateAnnotation): + def __init__(self, jump_address: int) -> None: + self.jump_address = jump_address + + +class DOS(DetectionModule): + """This module detects denial of service by exhausting gas.""" + + def __init__(self) -> None: + """""" + super().__init__( + name="DOS", + swc_id=DOS_WITH_BLOCK_GAS_LIMIT, + description="Check for DOS", + entrypoint="callback", + pre_hooks=["JUMPI", "CALL", "SSTORE"], + ) + + self._jumpdest_count = {} + + def execute(self, state: GlobalState) -> None: + """ + + :param state: + :return: + """ + log.debug("Executing module: DOS") + + self._issues.extend(self._analyze_states(state)) + + def _analyze_states(self, state: GlobalState) -> List[Issue]: + """ + :param state: the current state + :return: returns the issues for that corresponding state + """ + + opcode = state.get_current_instruction()["opcode"] + + if opcode == "JUMPI": + + target = util.get_concrete_int(state.mstate.stack[-1]) + + try: + transaction = state.current_transaction + self._jumpdest_count[transaction] + + try: + if self._jumpdest_count[transaction][target] > 3: + state.annotate( + LoopAnnotation(state.get_current_instruction()["address"]) + ) + else: + self._jumpdest_count[transaction][target] += 1 + except KeyError: + self._jumpdest_count[transaction][target] = 0 + + except KeyError: + self._jumpdest_count[transaction] = {} + self._jumpdest_count[transaction][target] = 0 + + else: + + for annotation in state.annotations: + + if type(annotation) == LoopAnnotation: + + operation = ( + "A storage modification" + if opcode == "CALL" + else "An external call" + ) + + description_head = ( + "Potential Denial-of-Service if block gas limit is reached." + ) + description_tail = operation + " is executed in a loop." + + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=annotation.jump_address, + swc_id=DOS_WITH_BLOCK_GAS_LIMIT, + bytecode=state.environment.code.bytecode, + title="Potential Denial-of-Service if block gas limit is reached", + severity="Low", + description_head=description_head, + description_tail=description_tail, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + return [issue] + + return [] + + +detector = DOS() From f255723045f6be2b7befb1e375d9b924b725cc5f Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 17:59:15 +0200 Subject: [PATCH 61/97] Better annotations check --- mythril/analysis/modules/dos.py | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index 0b948a93..63183b62 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -1,7 +1,7 @@ """This module contains the detection code for insecure delegate call usage.""" import logging -from typing import List +from typing import cast, List from mythril.analysis.swc_data import DOS_WITH_BLOCK_GAS_LIMIT from mythril.analysis.report import Issue @@ -75,34 +75,34 @@ class DOS(DetectionModule): else: - for annotation in state.annotations: - - if type(annotation) == LoopAnnotation: - - operation = ( - "A storage modification" - if opcode == "CALL" - else "An external call" - ) - - description_head = ( - "Potential Denial-of-Service if block gas limit is reached." - ) - description_tail = operation + " is executed in a loop." - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=annotation.jump_address, - swc_id=DOS_WITH_BLOCK_GAS_LIMIT, - bytecode=state.environment.code.bytecode, - title="Potential Denial-of-Service if block gas limit is reached", - severity="Low", - description_head=description_head, - description_tail=description_tail, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - return [issue] + annotations = cast( + List[LoopAnnotation], list(state.get_annotations(LoopAnnotation)) + ) + + if len(annotations) > 0: + + operation = ( + "A storage modification" if opcode == "CALL" else "An external call" + ) + + description_head = ( + "Potential Denial-of-Service if block gas limit is reached." + ) + description_tail = operation + " is executed in a loop." + + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=annotations[0].jump_address, + swc_id=DOS_WITH_BLOCK_GAS_LIMIT, + bytecode=state.environment.code.bytecode, + title="Potential Denial-of-Service if block gas limit is reached", + severity="Low", + description_head=description_head, + description_tail=description_tail, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + return [issue] return [] From 58a8a7b621bdaa8852878cd87b2939e0791bcb92 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 18:53:16 +0200 Subject: [PATCH 62/97] Add missing type annotation --- mythril/analysis/modules/dos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index 63183b62..dd5fa18e 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -31,7 +31,8 @@ class DOS(DetectionModule): pre_hooks=["JUMPI", "CALL", "SSTORE"], ) - self._jumpdest_count = {} + """Keeps track of how often jump destinations are reached.""" + self._jumpdest_count = {} # type: Dict[object, dict] def execute(self, state: GlobalState) -> None: """ From 66ec7de153d336582dc1dd7c3510d7784efb17e9 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 19:06:19 +0200 Subject: [PATCH 63/97] Make code nicer: --- .../modules/dependence_on_predictable_vars.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index d2dbdcd1..a8c7ac75 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -10,6 +10,7 @@ from mythril.laser.smt import ULT, symbol_factory from mythril.analysis.swc_data import TIMESTAMP_DEPENDENCE, WEAK_RANDOMNESS from mythril.laser.ethereum.state.global_state import GlobalState from mythril.laser.ethereum.state.annotation import StateAnnotation +from typing import cast, List import traceback log = logging.getLogger(__name__) @@ -151,6 +152,7 @@ def _analyze_states(state: GlobalState) -> list: state.get_current_instruction()["address"], ) ) + break elif opcode == "BLOCKHASH": @@ -181,13 +183,15 @@ def _analyze_states(state: GlobalState) -> list: if opcode == "BLOCKHASH": # if we're in the post hook of a BLOCKHASH op, check if an old block number was used to create it. - for annotation in state.annotations: + annotations = cast( + List[OldBlockNumberUsedAnnotation], + list(state.get_annotations(OldBlockNumberUsedAnnotation)), + ) - if isinstance(annotation, OldBlockNumberUsedAnnotation): - state.mstate.stack[-1].annotate( - PredictableValueAnnotation("block hash of a previous block") - ) - break + if len(annotations): + state.mstate.stack[-1].annotate( + PredictableValueAnnotation("block hash of a previous block") + ) else: # Always create an annotation when COINBASE, GASLIMIT, TIMESTAMP or NUMBER is executed. From 5bedb338ec5182bcaf6b04a46b7b5125acb1ea90 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 21 May 2019 19:08:44 +0200 Subject: [PATCH 64/97] Import Dict: --- mythril/analysis/modules/dos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index dd5fa18e..0525741b 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -1,7 +1,7 @@ """This module contains the detection code for insecure delegate call usage.""" import logging -from typing import cast, List +from typing import Dict, cast, List from mythril.analysis.swc_data import DOS_WITH_BLOCK_GAS_LIMIT from mythril.analysis.report import Issue From 2175ee7b1aa75e3658b384daddd5578fbe57b761 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 22 May 2019 10:20:09 +0530 Subject: [PATCH 65/97] update detection capabilities (#1040) --- docs/source/module-list.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/module-list.rst b/docs/source/module-list.rst index d7dffa23..89a5cb05 100644 --- a/docs/source/module-list.rst +++ b/docs/source/module-list.rst @@ -35,7 +35,7 @@ The `exceptions module `_ detects `SWC-117 (Reentrancy) `_ by detecting state changes after calls to external contracts. +The `external calls module `_ warns about `SWC-117 (Reentrancy) `_ by detecting calls to external contracts. ******* Integer @@ -55,11 +55,12 @@ Suicide The `suicide module `_ detects `SWC-106 (Unprotected SELFDESTRUCT) `_. + **************************** -Transaction Order Dependence +State Change External Calls **************************** -The `transaction order dependence module `_ detects `SWC-114 (Transaction Order Dependence / Race Conditions) `_. +The `state change external calls module `_ detects `SWC-107 (Reentrancy) `_ by detecting state change after calls to an external contract. **************** Unchecked Retval From 386855ae2fc333f3ce9dee236b201c8e71ad0a15 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 22 May 2019 15:29:04 +0200 Subject: [PATCH 66/97] Implement norhh suggestions --- mythril/analysis/modules/dos.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index 0525741b..b9404e7d 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -56,12 +56,11 @@ class DOS(DetectionModule): target = util.get_concrete_int(state.mstate.stack[-1]) - try: - transaction = state.current_transaction - self._jumpdest_count[transaction] + transaction = state.current_transaction + if state.current_transaction in self._jumpdest_count: try: - if self._jumpdest_count[transaction][target] > 3: + if self._jumpdest_count[transaction][target] == 4: state.annotate( LoopAnnotation(state.get_current_instruction()["address"]) ) @@ -70,7 +69,7 @@ class DOS(DetectionModule): except KeyError: self._jumpdest_count[transaction][target] = 0 - except KeyError: + else: self._jumpdest_count[transaction] = {} self._jumpdest_count[transaction][target] = 0 From 57d3b7c96d802e7833efe6121735e7131a38c7d4 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 22 May 2019 18:17:41 +0200 Subject: [PATCH 67/97] Implement norhh suggestions #2 --- mythril/analysis/modules/dos.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index b9404e7d..54a09ea0 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -60,12 +60,11 @@ class DOS(DetectionModule): if state.current_transaction in self._jumpdest_count: try: + self._jumpdest_count[transaction][target] += 1 if self._jumpdest_count[transaction][target] == 4: state.annotate( LoopAnnotation(state.get_current_instruction()["address"]) ) - else: - self._jumpdest_count[transaction][target] += 1 except KeyError: self._jumpdest_count[transaction][target] = 0 @@ -88,7 +87,7 @@ class DOS(DetectionModule): description_head = ( "Potential Denial-of-Service if block gas limit is reached." ) - description_tail = operation + " is executed in a loop." + description_tail = "{} is executed in a loop.".format(operation) issue = Issue( contract=state.environment.active_account.contract_name, From e36be4b69d41947ccfcfe3acc29d62e865c69533 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 23 May 2019 13:05:38 +0200 Subject: [PATCH 68/97] Refactor multiple_sends module --- mythril/analysis/modules/multiple_sends.py | 56 +++++++++------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 1afaaed2..53f9a29a 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -17,11 +17,11 @@ log = logging.getLogger(__name__) class MultipleSendsAnnotation(StateAnnotation): def __init__(self) -> None: - self.calls = [] # type: List[Optional[Call]] + self.call_offsets = [] # type: List[int] def __copy__(self): result = MultipleSendsAnnotation() - result.calls = copy(self.calls) + result.call_offsets = copy(self.call_offsets) return result @@ -62,51 +62,41 @@ def _analyze_state(state: GlobalState): list(state.get_annotations(MultipleSendsAnnotation)), ) if len(annotations) == 0: - log.debug("Creating annotation for state") state.annotate(MultipleSendsAnnotation()) annotations = cast( List[MultipleSendsAnnotation], list(state.get_annotations(MultipleSendsAnnotation)), ) - calls = annotations[0].calls + call_offsets = annotations[0].call_offsets if instruction["opcode"] in ["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"]: - call = get_call_from_state(state) - if call: - calls += [call] + call_offsets.append(state.get_current_instruction()["address"]) else: # RETURN or STOP - if len(calls) > 1: + if len(call_offsets) > 1: - description_tail = ( - "Consecutive calls are executed at the following bytecode offsets:\n" - ) + for offset in call_offsets[1:]: - for call in calls: - description_tail += "Offset: {}\n".format( - call.state.get_current_instruction()["address"] + description_tail = ( + "This call is executed after a previous call in the same transaction. " + "Try to isolate each call, transfer or send into its own transaction." ) - description_tail += ( - "Try to isolate each external call into its own transaction," - " as external calls can fail accidentally or deliberately.\n" - ) - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=instruction["address"], - swc_id=MULTIPLE_SENDS, - bytecode=state.environment.code.bytecode, - title="Multiple Calls in a Single Transaction", - severity="Medium", - description_head="Multiple sends are executed in one transaction.", - description_tail=description_tail, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - - return [issue] + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=offset, + swc_id=MULTIPLE_SENDS, + bytecode=state.environment.code.bytecode, + title="Multiple Calls in a Single Transaction", + severity="Low", + description_head="Multiple calls are executed in the same transaction.", + description_tail=description_tail, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + + return [issue] return [] From 4d91d803fb2af8a413b52082269e7a73d3649a61 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 23 May 2019 13:10:07 +0200 Subject: [PATCH 69/97] Remove unused dependencies --- mythril/analysis/modules/multiple_sends.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 53f9a29a..5c9ff5ae 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -1,16 +1,14 @@ """This module contains the detection code to find multiple sends occurring in a single transaction.""" from copy import copy -from typing import cast, List, Optional +from typing import cast, List -from mythril.analysis.ops import Call from mythril.analysis.report import Issue from mythril.analysis.swc_data import MULTIPLE_SENDS from mythril.analysis.modules.base import DetectionModule from mythril.laser.ethereum.state.annotation import StateAnnotation from mythril.laser.ethereum.state.global_state import GlobalState import logging -from mythril.analysis.call_helpers import get_call_from_state log = logging.getLogger(__name__) From 73500d86b6d39e818aa6899d2b4dda48e1e8d299 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 23 May 2019 20:01:52 +0200 Subject: [PATCH 70/97] Norhh feedback #3 --- mythril/analysis/modules/dos.py | 79 ++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 30 deletions(-) diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index 54a09ea0..c4a089f3 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -1,4 +1,4 @@ -"""This module contains the detection code for insecure delegate call usage.""" +"""This module contains the detection code SWC-128 - DOS with block gas limit.""" import logging from typing import Dict, cast, List @@ -14,12 +14,21 @@ log = logging.getLogger(__name__) class LoopAnnotation(StateAnnotation): - def __init__(self, jump_address: int) -> None: - self.jump_address = jump_address + def __init__(self, loop_start: int, loop_end: int) -> None: + self.loop_start = loop_start + self.loop_end = loop_end + + def contains(self, address: int) -> bool: + return self.loop_start < address < self.loop_end class DOS(DetectionModule): - """This module detects denial of service by exhausting gas.""" + """This module consists of a makeshift loop detector that annotates the state with + a list of byte ranges likely to be loops. If a CALL or SSTORE detection is found in + one of the ranges it creates a low-severity issue. This is not super precise but + good enough to identify places that warrant a closer look. Checking the loop condition + would be a possible improvement. + """ def __init__(self) -> None: """""" @@ -51,6 +60,7 @@ class DOS(DetectionModule): """ opcode = state.get_current_instruction()["opcode"] + address = state.get_current_instruction()["address"] if opcode == "JUMPI": @@ -62,9 +72,14 @@ class DOS(DetectionModule): try: self._jumpdest_count[transaction][target] += 1 if self._jumpdest_count[transaction][target] == 4: - state.annotate( - LoopAnnotation(state.get_current_instruction()["address"]) + + annotation = ( + LoopAnnotation(address, target) + if target > address + else LoopAnnotation(target, address) ) + + state.annotate(annotation) except KeyError: self._jumpdest_count[transaction][target] = 0 @@ -78,30 +93,34 @@ class DOS(DetectionModule): List[LoopAnnotation], list(state.get_annotations(LoopAnnotation)) ) - if len(annotations) > 0: - - operation = ( - "A storage modification" if opcode == "CALL" else "An external call" - ) - - description_head = ( - "Potential Denial-of-Service if block gas limit is reached." - ) - description_tail = "{} is executed in a loop.".format(operation) - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=annotations[0].jump_address, - swc_id=DOS_WITH_BLOCK_GAS_LIMIT, - bytecode=state.environment.code.bytecode, - title="Potential Denial-of-Service if block gas limit is reached", - severity="Low", - description_head=description_head, - description_tail=description_tail, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - return [issue] + for annotation in annotations: + + if annotation.contains(address): + + operation = ( + "A storage modification" + if opcode == "SSTORE" + else "An external call" + ) + + description_head = ( + "Potential denial-of-service if block gas limit is reached." + ) + description_tail = "{} is executed in a loop.".format(operation) + + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=annotation.loop_start, + swc_id=DOS_WITH_BLOCK_GAS_LIMIT, + bytecode=state.environment.code.bytecode, + title="Potential denial-of-service if block gas limit is reached", + severity="Low", + description_head=description_head, + description_tail=description_tail, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + return [issue] return [] From de78d019e323aae0ddafdb54ab0f5ee5109cbce7 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Fri, 24 May 2019 09:49:38 +0200 Subject: [PATCH 71/97] Norhh suggestion #1 --- mythril/analysis/modules/multiple_sends.py | 45 +++++++++++----------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 5c9ff5ae..6b09db77 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -72,29 +72,28 @@ def _analyze_state(state: GlobalState): call_offsets.append(state.get_current_instruction()["address"]) else: # RETURN or STOP - if len(call_offsets) > 1: - - for offset in call_offsets[1:]: - - description_tail = ( - "This call is executed after a previous call in the same transaction. " - "Try to isolate each call, transfer or send into its own transaction." - ) - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=offset, - swc_id=MULTIPLE_SENDS, - bytecode=state.environment.code.bytecode, - title="Multiple Calls in a Single Transaction", - severity="Low", - description_head="Multiple calls are executed in the same transaction.", - description_tail=description_tail, - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - - return [issue] + + for offset in call_offsets[1:]: + + description_tail = ( + "This call is executed after a previous call in the same transaction. " + "Try to isolate each call, transfer or send into its own transaction." + ) + + issue = Issue( + contract=state.environment.active_account.contract_name, + function_name=state.environment.active_function_name, + address=offset, + swc_id=MULTIPLE_SENDS, + bytecode=state.environment.code.bytecode, + title="Multiple Calls in a Single Transaction", + severity="Low", + description_head="Multiple calls are executed in the same transaction.", + description_tail=description_tail, + gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), + ) + + return [issue] return [] From 2cea270e3634895087b9837f4a2f49e6b74a43d0 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Fri, 24 May 2019 20:56:37 +0530 Subject: [PATCH 72/97] Update mythril/laser/ethereum/state/memory.py Co-Authored-By: JoranHonig --- mythril/laser/ethereum/state/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/state/memory.py b/mythril/laser/ethereum/state/memory.py index ef27fe1a..0038d5ec 100644 --- a/mythril/laser/ethereum/state/memory.py +++ b/mythril/laser/ethereum/state/memory.py @@ -157,7 +157,7 @@ class Memory: self[start + i] = cast(List[Union[int, BitVec]], value)[i] else: - if key >= self.__len__(): + if key >= len(self): return if isinstance(value, int): assert 0 <= value <= 0xFF From 77bf67bd71fd567157d3b0e984bb77bbe2f953d1 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Fri, 24 May 2019 20:15:09 +0200 Subject: [PATCH 73/97] Use newer z3 version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 11cdeff3..3cabe805 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,6 @@ pytest_mock requests rlp>=1.0.1 transaction>=2.2.1 -z3-solver-mythril>=4.8.4.1 +z3-solver>=4.8.5.0 pysha3 matplotlib From 062a07c2c7ad049a5bc2185e21b53ead9a43b2dd Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 25 May 2019 11:56:30 +0530 Subject: [PATCH 74/97] Use symbolic storage for concrete=False (#1039) --- mythril/laser/ethereum/state/account.py | 6 ++- .../outputs_expected/calls.sol.o.graph.html | 6 +-- .../outputs_expected/calls.sol.o.json | 20 +++++----- .../outputs_expected/calls.sol.o.jsonv2 | 20 +++++----- .../outputs_expected/calls.sol.o.markdown | 26 ++++++------- .../outputs_expected/calls.sol.o.text | 26 ++++++------- .../ether_send.sol.o.graph.html | 4 +- .../outputs_expected/ether_send.sol.o.json | 29 ++++++++++++++- .../outputs_expected/ether_send.sol.o.jsonv2 | 37 ++++++++++++++++++- .../ether_send.sol.o.markdown | 28 +++++++++++++- .../outputs_expected/ether_send.sol.o.text | 23 +++++++++++- .../returnvalue.sol.o.graph.html | 6 +-- .../outputs_expected/returnvalue.sol.o.json | 12 +++--- .../outputs_expected/returnvalue.sol.o.jsonv2 | 12 +++--- .../returnvalue.sol.o.markdown | 16 ++++---- .../outputs_expected/returnvalue.sol.o.text | 16 ++++---- 16 files changed, 199 insertions(+), 88 deletions(-) diff --git a/mythril/laser/ethereum/state/account.py b/mythril/laser/ethereum/state/account.py index 381562ca..e806a71e 100644 --- a/mythril/laser/ethereum/state/account.py +++ b/mythril/laser/ethereum/state/account.py @@ -47,9 +47,13 @@ class Storage: return self._storage[item] except ValueError: pass + if self.concrete: return symbol_factory.BitVecVal(0, 256) - self._storage[item] = symbol_factory.BitVecVal(0, 256) + + self._storage[item] = symbol_factory.BitVecSym( + "storage_{}_{}".format(str(item), str(self.address)), 256 + ) return self._storage[item] def __setitem__(self, key: Union[int, str], value: Any) -> None: diff --git a/tests/testdata/outputs_expected/calls.sol.o.graph.html b/tests/testdata/outputs_expected/calls.sol.o.graph.html index 0884c542..0614f7da 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.graph.html +++ b/tests/testdata/outputs_expected/calls.sol.o.graph.html @@ -24,8 +24,8 @@ @@ -59,4 +59,4 @@ }); - + \ No newline at end of file diff --git a/tests/testdata/outputs_expected/calls.sol.o.json b/tests/testdata/outputs_expected/calls.sol.o.json index fbcd2784..93fce2b7 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.json +++ b/tests/testdata/outputs_expected/calls.sol.o.json @@ -5,14 +5,14 @@ "address": 661, "contract": "Unknown", "debug": "", - "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", "function": "thisisfine()", "max_gas_used": 1254, "min_gas_used": 643, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", - "title": "External Call To Fixed Address" + "title": "External Call To User-Supplied Address" }, { "address": 661, @@ -31,14 +31,14 @@ "address": 779, "contract": "Unknown", "debug": "", - "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", "function": "callstoredaddress()", "max_gas_used": 1298, "min_gas_used": 687, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", - "title": "External Call To Fixed Address" + "title": "External Call To User-Supplied Address" }, { "address": 779, @@ -57,14 +57,14 @@ "address": 858, "contract": "Unknown", "debug": "", - "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", "function": "reentrancy()", "max_gas_used": 1320, "min_gas_used": 709, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", - "title": "External Call To Fixed Address" + "title": "External Call To User-Supplied Address" }, { "address": 858, @@ -87,7 +87,7 @@ "function": "reentrancy()", "max_gas_used": null, "min_gas_used": null, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", "title": "State change after external call" diff --git a/tests/testdata/outputs_expected/calls.sol.o.jsonv2 b/tests/testdata/outputs_expected/calls.sol.o.jsonv2 index 624d3410..9acb8f18 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/calls.sol.o.jsonv2 @@ -3,8 +3,8 @@ "issues": [ { "description": { - "head": "The contract executes an external message call.", - "tail": "An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully." + "head": "A call to a user-supplied address is executed.", + "tail": "The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state." }, "extra": { "discoveryTime": "" @@ -14,14 +14,14 @@ "sourceMap": "661:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, { "description": { - "head": "The contract executes an external message call.", - "tail": "An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully." + "head": "A call to a user-supplied address is executed.", + "tail": "The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state." }, "extra": { "discoveryTime": "" @@ -31,14 +31,14 @@ "sourceMap": "779:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, { "description": { - "head": "The contract executes an external message call.", - "tail": "An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully." + "head": "A call to a user-supplied address is executed.", + "tail": "The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state." }, "extra": { "discoveryTime": "" @@ -48,7 +48,7 @@ "sourceMap": "858:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, @@ -82,7 +82,7 @@ "sourceMap": "869:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, diff --git a/tests/testdata/outputs_expected/calls.sol.o.markdown b/tests/testdata/outputs_expected/calls.sol.o.markdown index b45544be..9472f159 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.markdown +++ b/tests/testdata/outputs_expected/calls.sol.o.markdown @@ -1,8 +1,8 @@ # Analysis results for test-filename.sol -## External Call To Fixed Address +## External Call To User-Supplied Address - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `thisisfine()` - PC address: 661 @@ -10,8 +10,8 @@ ### Description -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. ## Unchecked Call Return Value - SWC ID: 104 @@ -26,9 +26,9 @@ An external function call to a fixed contract address is executed. Make sure tha The return value of a message call is not checked. External calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states. -## External Call To Fixed Address +## External Call To User-Supplied Address - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `callstoredaddress()` - PC address: 779 @@ -36,8 +36,8 @@ External calls return a boolean value. If the callee contract halts with an exce ### Description -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. ## Unchecked Call Return Value - SWC ID: 104 @@ -52,9 +52,9 @@ An external function call to a fixed contract address is executed. Make sure tha The return value of a message call is not checked. External calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states. -## External Call To Fixed Address +## External Call To User-Supplied Address - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `reentrancy()` - PC address: 858 @@ -62,8 +62,8 @@ External calls return a boolean value. If the callee contract halts with an exce ### Description -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. ## Unchecked Call Return Value - SWC ID: 104 @@ -80,7 +80,7 @@ External calls return a boolean value. If the callee contract halts with an exce ## State change after external call - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `reentrancy()` - PC address: 869 diff --git a/tests/testdata/outputs_expected/calls.sol.o.text b/tests/testdata/outputs_expected/calls.sol.o.text index 27706fd1..6b20a8a3 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.text +++ b/tests/testdata/outputs_expected/calls.sol.o.text @@ -1,12 +1,12 @@ -==== External Call To Fixed Address ==== +==== External Call To User-Supplied Address ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: thisisfine() PC address: 661 Estimated Gas Usage: 643 - 1254 -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -------------------- ==== Unchecked Call Return Value ==== @@ -20,15 +20,15 @@ The return value of a message call is not checked. External calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states. -------------------- -==== External Call To Fixed Address ==== +==== External Call To User-Supplied Address ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: callstoredaddress() PC address: 779 Estimated Gas Usage: 687 - 1298 -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -------------------- ==== Unchecked Call Return Value ==== @@ -42,15 +42,15 @@ The return value of a message call is not checked. External calls return a boolean value. If the callee contract halts with an exception, 'false' is returned and execution continues in the caller. It is usually recommended to wrap external calls into a require statement to prevent unexpected states. -------------------- -==== External Call To Fixed Address ==== +==== External Call To User-Supplied Address ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: reentrancy() PC address: 858 Estimated Gas Usage: 709 - 1320 -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -------------------- ==== Unchecked Call Return Value ==== @@ -66,7 +66,7 @@ External calls return a boolean value. If the callee contract halts with an exce ==== State change after external call ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: reentrancy() PC address: 869 diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.graph.html b/tests/testdata/outputs_expected/ether_send.sol.o.graph.html index 74bac94a..b7ea6248 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.graph.html +++ b/tests/testdata/outputs_expected/ether_send.sol.o.graph.html @@ -24,8 +24,8 @@ diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.json b/tests/testdata/outputs_expected/ether_send.sol.o.json index 712f50c1..3f7072fe 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.json +++ b/tests/testdata/outputs_expected/ether_send.sol.o.json @@ -1,5 +1,32 @@ { "error": null, - "issues": [], + "issues": [ + { + "address": 722, + "contract": "Unknown", + "debug": "", + "description": "Anyone can withdraw ETH from the contract account.\nArbitrary senders other than the contract creator can withdraw ETH from the contract account without previously having sent an equivalent amount of ETH to it. This is likely to be a vulnerability.", + "function": "withdrawfunds()", + "max_gas_used": 1749, + "min_gas_used": 1138, + "severity": "High", + "sourceMap": null, + "swc-id": "105", + "title": "Unprotected Ether Withdrawal" + }, + { + "address": 883, + "contract": "Unknown", + "debug": "", + "description": "The binary addition can overflow.\nThe operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion.", + "function": "invest()", + "max_gas_used": 26883, + "min_gas_used": 6598, + "severity": "High", + "sourceMap": null, + "swc-id": "101", + "title": "Integer Overflow" + } + ], "success": true } \ No newline at end of file diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 b/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 index 9f1597a1..a92e3c21 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/ether_send.sol.o.jsonv2 @@ -1,6 +1,41 @@ [ { - "issues": [], + "issues": [ + { + "description": { + "head": "Anyone can withdraw ETH from the contract account.", + "tail": "Arbitrary senders other than the contract creator can withdraw ETH from the contract account without previously having sent an equivalent amount of ETH to it. This is likely to be a vulnerability." + }, + "extra": { + "discoveryTime": "" + }, + "locations": [ + { + "sourceMap": "722:1:0" + } + ], + "severity": "High", + "swcID": "SWC-105", + "swcTitle": "Unprotected Ether Withdrawal" + }, + { + "description": { + "head": "The binary addition can overflow.", + "tail": "The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion." + }, + "extra": { + "discoveryTime": "" + }, + "locations": [ + { + "sourceMap": "883:1:0" + } + ], + "severity": "High", + "swcID": "SWC-101", + "swcTitle": "Integer Overflow and Underflow" + } + ], "meta": {}, "sourceFormat": "evm-byzantium-bytecode", "sourceList": [ diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.markdown b/tests/testdata/outputs_expected/ether_send.sol.o.markdown index 321484fd..2e1c2a9e 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.markdown +++ b/tests/testdata/outputs_expected/ether_send.sol.o.markdown @@ -1,3 +1,27 @@ -# Analysis results for None +# Analysis results for test-filename.sol -The analysis was completed successfully. No issues were detected. +## Unprotected Ether Withdrawal +- SWC ID: 105 +- Severity: High +- Contract: Unknown +- Function name: `withdrawfunds()` +- PC address: 722 +- Estimated Gas Usage: 1138 - 1749 + +### Description + +Anyone can withdraw ETH from the contract account. +Arbitrary senders other than the contract creator can withdraw ETH from the contract account without previously having sent an equivalent amount of ETH to it. This is likely to be a vulnerability. + +## Integer Overflow +- SWC ID: 101 +- Severity: High +- Contract: Unknown +- Function name: `invest()` +- PC address: 883 +- Estimated Gas Usage: 6598 - 26883 + +### Description + +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.text b/tests/testdata/outputs_expected/ether_send.sol.o.text index 729320d8..493978be 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.text +++ b/tests/testdata/outputs_expected/ether_send.sol.o.text @@ -1 +1,22 @@ -The analysis was completed successfully. No issues were detected. +==== Unprotected Ether Withdrawal ==== +SWC ID: 105 +Severity: High +Contract: Unknown +Function name: withdrawfunds() +PC address: 722 +Estimated Gas Usage: 1138 - 1749 +Anyone can withdraw ETH from the contract account. +Arbitrary senders other than the contract creator can withdraw ETH from the contract account without previously having sent an equivalent amount of ETH to it. This is likely to be a vulnerability. +-------------------- + +==== Integer Overflow ==== +SWC ID: 101 +Severity: High +Contract: Unknown +Function name: invest() +PC address: 883 +Estimated Gas Usage: 6598 - 26883 +The binary addition can overflow. +The operands of the addition operation are not sufficiently constrained. The addition could therefore result in an integer overflow. Prevent the overflow by checking inputs or ensure sure that the overflow is caught by an assertion. +-------------------- + diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html b/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html index 278fa213..cbc662d5 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html @@ -24,8 +24,8 @@ @@ -59,4 +59,4 @@ }); - + \ No newline at end of file diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.json b/tests/testdata/outputs_expected/returnvalue.sol.o.json index b31986bd..1f01da4b 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.json +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.json @@ -5,27 +5,27 @@ "address": 196, "contract": "Unknown", "debug": "", - "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", "function": "callchecked()", "max_gas_used": 1210, "min_gas_used": 599, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", - "title": "External Call To Fixed Address" + "title": "External Call To User-Supplied Address" }, { "address": 285, "contract": "Unknown", "debug": "", - "description": "The contract executes an external message call.\nAn external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully.", + "description": "A call to a user-supplied address is executed.\nThe callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state.", "function": "callnotchecked()", "max_gas_used": 1232, "min_gas_used": 621, - "severity": "Low", + "severity": "Medium", "sourceMap": null, "swc-id": "107", - "title": "External Call To Fixed Address" + "title": "External Call To User-Supplied Address" }, { "address": 285, diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.jsonv2 b/tests/testdata/outputs_expected/returnvalue.sol.o.jsonv2 index 03fb9c0d..9c245482 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.jsonv2 @@ -3,8 +3,8 @@ "issues": [ { "description": { - "head": "The contract executes an external message call.", - "tail": "An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully." + "head": "A call to a user-supplied address is executed.", + "tail": "The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state." }, "extra": { "discoveryTime": "" @@ -14,14 +14,14 @@ "sourceMap": "196:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, { "description": { - "head": "The contract executes an external message call.", - "tail": "An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully." + "head": "A call to a user-supplied address is executed.", + "tail": "The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state." }, "extra": { "discoveryTime": "" @@ -31,7 +31,7 @@ "sourceMap": "285:1:0" } ], - "severity": "Low", + "severity": "Medium", "swcID": "SWC-107", "swcTitle": "Reentrancy" }, diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.markdown b/tests/testdata/outputs_expected/returnvalue.sol.o.markdown index fcbd0a1b..5309f405 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.markdown +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.markdown @@ -1,8 +1,8 @@ # Analysis results for test-filename.sol -## External Call To Fixed Address +## External Call To User-Supplied Address - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `callchecked()` - PC address: 196 @@ -10,12 +10,12 @@ ### Description -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -## External Call To Fixed Address +## External Call To User-Supplied Address - SWC ID: 107 -- Severity: Low +- Severity: Medium - Contract: Unknown - Function name: `callnotchecked()` - PC address: 285 @@ -23,8 +23,8 @@ An external function call to a fixed contract address is executed. Make sure tha ### Description -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. ## Unchecked Call Return Value - SWC ID: 104 diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.text b/tests/testdata/outputs_expected/returnvalue.sol.o.text index 2678bf80..baff23ea 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.text +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.text @@ -1,23 +1,23 @@ -==== External Call To Fixed Address ==== +==== External Call To User-Supplied Address ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: callchecked() PC address: 196 Estimated Gas Usage: 599 - 1210 -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -------------------- -==== External Call To Fixed Address ==== +==== External Call To User-Supplied Address ==== SWC ID: 107 -Severity: Low +Severity: Medium Contract: Unknown Function name: callnotchecked() PC address: 285 Estimated Gas Usage: 621 - 1232 -The contract executes an external message call. -An external function call to a fixed contract address is executed. Make sure that the callee contract has been reviewed carefully. +A call to a user-supplied address is executed. +The callee address of an external message call can be set by the caller. Note that the callee can contain arbitrary code and may re-enter any function in this contract. Review the business logic carefully to prevent averse effects on the contract state. -------------------- ==== Unchecked Call Return Value ==== From d25cd7a47ea227c73b62cd341fed7c16bca6812c Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sat, 25 May 2019 18:45:55 +0200 Subject: [PATCH 75/97] Update z3 version in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4605b5d3..21474308 100755 --- a/setup.py +++ b/setup.py @@ -75,7 +75,7 @@ setup( "coloredlogs>=10.0", "py_ecc==1.4.2", "ethereum>=2.3.2", - "z3-solver-mythril>=4.8.4.1", + "z3-solver>=4.8.5.0", "requests", "py-solc", "plyvel", From 9dfd2aa604e635aaab0f2bb2ce8c676fcf2ae648 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 26 May 2019 16:23:28 +0530 Subject: [PATCH 76/97] Enhance delegate call (#1042) * Enhance delegate call * Slightly update report texts * Black thou shalst use * Upate tests --- mythril/analysis/modules/delegatecall.py | 143 +++++++++++------- mythril/laser/ethereum/instructions.py | 1 - .../kinds_of_calls.sol.o.json | 13 ++ .../kinds_of_calls.sol.o.jsonv2 | 17 +++ .../kinds_of_calls.sol.o.markdown | 13 ++ .../kinds_of_calls.sol.o.text | 11 ++ 6 files changed, 146 insertions(+), 52 deletions(-) diff --git a/mythril/analysis/modules/delegatecall.py b/mythril/analysis/modules/delegatecall.py index 3ef4a338..aeb3e06f 100644 --- a/mythril/analysis/modules/delegatecall.py +++ b/mythril/analysis/modules/delegatecall.py @@ -1,19 +1,72 @@ """This module contains the detection code for insecure delegate call usage.""" -import re +import json import logging -from typing import List +from copy import copy +from typing import List, cast +from mythril.analysis import solver from mythril.analysis.swc_data import DELEGATECALL_TO_UNTRUSTED_CONTRACT -from mythril.analysis.ops import get_variable, VarType, Call, Variable from mythril.analysis.report import Issue -from mythril.analysis.call_helpers import get_call_from_state from mythril.analysis.modules.base import DetectionModule +from mythril.exceptions import UnsatError +from mythril.laser.ethereum.state.annotation import StateAnnotation from mythril.laser.ethereum.state.global_state import GlobalState - +from mythril.laser.smt import symbol_factory, UGT +from mythril.laser.smt import symbol_factory, UGT log = logging.getLogger(__name__) +class DelegateCallAnnotation(StateAnnotation): + def __init__(self, call_state: GlobalState) -> None: + """ + Initialize DelegateCall Annotation + :param call_state: Call state + """ + self.call_state = call_state + self.return_value = call_state.new_bitvec( + "retval_{}".format(call_state.get_current_instruction()["address"]), 256 + ) + + def get_issue(self, global_state: GlobalState, transaction_sequence: str) -> Issue: + """ + Returns Issue for the annotation + :param global_state: Global State + :param transaction_sequence: Transaction sequence + :return: Issue + """ + + address = self.call_state.get_current_instruction()["address"] + logging.debug( + "[DELEGATECALL] Detected delegatecall to a user-supplied address : {}".format( + address + ) + ) + description_head = "The contract delegates execution to another contract with a user-supplied address." + description_tail = ( + "The smart contract delegates execution to a user-supplied address. Note that callers " + "can execute arbitrary contracts and that the callee contract " + "can access the storage of the calling contract. " + ) + + return Issue( + contract=self.call_state.environment.active_account.contract_name, + function_name=self.call_state.environment.active_function_name, + address=address, + swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, + title="Delegatecall Proxy To User-Supplied Address", + bytecode=global_state.environment.code.bytecode, + severity="Medium", + description_head=description_head, + description_tail=description_tail, + debug=transaction_sequence, + gas_used=( + global_state.mstate.min_gas_used, + global_state.mstate.max_gas_used, + ), + ) + + class DelegateCallModule(DetectionModule): """This module detects calldata being forwarded using DELEGATECALL.""" @@ -24,7 +77,7 @@ class DelegateCallModule(DetectionModule): swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, description="Check for invocations of delegatecall(msg.data) in the fallback function.", entrypoint="callback", - pre_hooks=["DELEGATECALL"], + pre_hooks=["DELEGATECALL", "RETURN", "STOP"], ) def execute(self, state: GlobalState) -> list: @@ -43,59 +96,47 @@ def _analyze_states(state: GlobalState) -> List[Issue]: :param state: the current state :return: returns the issues for that corresponding state """ - call = get_call_from_state(state) - if call is None: - return [] - issues = [] # type: List[Issue] + issues = [] + op_code = state.get_current_instruction()["opcode"] + annotations = cast( + List[DelegateCallAnnotation], + list(state.get_annotations(DelegateCallAnnotation)), + ) - if call.type is not "DELEGATECALL": - return [] - if state.environment.active_function_name is not "fallback": + if len(annotations) == 0 and op_code in ("RETURN", "STOP"): return [] - state = call.state - address = state.get_current_instruction()["address"] - meminstart = get_variable(state.mstate.stack[-3]) + if op_code == "DELEGATECALL": + gas = state.mstate.stack[-1] + to = state.mstate.stack[-2] - if meminstart.type == VarType.CONCRETE: - issues += _concrete_call(call, state, address, meminstart) + constraints = copy(state.mstate.constraints) + # Check whether we can also set the callee address - return issues + constraints += [ + to == 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF, + UGT(gas, symbol_factory.BitVecVal(2300, 256)), + ] + try: + solver.get_model(constraints) + state.annotate(DelegateCallAnnotation(call_state=state)) + except UnsatError: + log.debug("[DELEGATECALL] Annotation skipped.") -def _concrete_call( - call: Call, state: GlobalState, address: int, meminstart: Variable -) -> List[Issue]: - """ - :param call: The current call's information - :param state: The current state - :param address: The PC address - :param meminstart: memory starting position - :return: issues - """ - if not re.search(r"calldata.*\[0", str(state.mstate.memory[meminstart.val])): return [] - - issue = Issue( - contract=state.environment.active_account.contract_name, - function_name=state.environment.active_function_name, - address=address, - swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, - bytecode=state.environment.code.bytecode, - title="Delegatecall Proxy", - severity="Low", - description_head="The contract implements a delegatecall proxy.", - description_tail="The smart contract forwards the received calldata via delegatecall. Note that callers " - "can execute arbitrary functions in the callee contract and that the callee contract " - "can access the storage of the calling contract. " - "Make sure that the callee contract is audited properly.", - gas_used=(state.mstate.min_gas_used, state.mstate.max_gas_used), - ) - - target = hex(call.to.val) if call.to.type == VarType.CONCRETE else str(call.to) - issue.description += "DELEGATECALL target: {}".format(target) - - return [issue] + else: + for annotation in annotations: + try: + transaction_sequence = solver.get_transaction_sequence( + state, state.mstate.constraints + [annotation.return_value == 1] + ) + debug = json.dumps(transaction_sequence, indent=4) + issues.append(annotation.get_issue(state, transaction_sequence=debug)) + except UnsatError: + continue + + return issues detector = DelegateCallModule() diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index f17d4401..087b6421 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -2109,7 +2109,6 @@ class Instruction: "retval_" + str(instr["address"]), 256 ) global_state.mstate.stack.append(return_value) - global_state.mstate.constraints.append(return_value == 0) return [global_state] try: diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.json b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.json index b6bc99ac..72ac1e67 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.json +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.json @@ -27,6 +27,19 @@ "swc-id": "111", "title": "Use of callcode" }, + { + "address": 849, + "contract": "Unknown", + "debug": "", + "description": "The contract delegates execution to another contract with a user-supplied address.\nThe smart contract delegates execution to a user-supplied address. Note that callers can execute arbitrary contracts and that the callee contract can access the storage of the calling contract. ", + "function": "_function_0x9b58bc26", + "max_gas_used": 35928, + "min_gas_used": 1176, + "severity": "Medium", + "sourceMap": null, + "swc-id": "112", + "title": "Delegatecall Proxy To User-Supplied Address" + }, { "address": 849, "contract": "Unknown", diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 index 4f0d13e0..cf80cc34 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.jsonv2 @@ -1,6 +1,23 @@ [ { "issues": [ + { + "description": { + "head": "The contract delegates execution to another contract with a user-supplied address.", + "tail": "The smart contract delegates execution to a user-supplied address. Note that callers can execute arbitrary contracts and that the callee contract can access the storage of the calling contract. " + }, + "extra": { + "discoveryTime": "" + }, + "locations": [ + { + "sourceMap": "849:1:0" + } + ], + "severity": "Medium", + "swcID": "SWC-112", + "swcTitle": "Delegatecall to Untrusted Callee" + }, { "description": { "head": "Use of callcode is deprecated.", diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.markdown b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.markdown index 4e222b18..e6f7f11e 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.markdown +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.markdown @@ -26,6 +26,19 @@ External calls return a boolean value. If the callee contract halts with an exce Use of callcode is deprecated. The callcode method executes code of another contract in the context of the caller account. Due to a bug in the implementation it does not persist sender and value over the call. It was therefore deprecated and may be removed in the future. Use the delegatecall method instead. +## Delegatecall Proxy To User-Supplied Address +- SWC ID: 112 +- Severity: Medium +- Contract: Unknown +- Function name: `_function_0x9b58bc26` +- PC address: 849 +- Estimated Gas Usage: 1176 - 35928 + +### Description + +The contract delegates execution to another contract with a user-supplied address. +The smart contract delegates execution to a user-supplied address. Note that callers can execute arbitrary contracts and that the callee contract can access the storage of the calling contract. + ## Unchecked Call Return Value - SWC ID: 104 - Severity: Low diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.text b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.text index 9e9761c3..1bb3abad 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.text +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.text @@ -20,6 +20,17 @@ Use of callcode is deprecated. The callcode method executes code of another contract in the context of the caller account. Due to a bug in the implementation it does not persist sender and value over the call. It was therefore deprecated and may be removed in the future. Use the delegatecall method instead. -------------------- +==== Delegatecall Proxy To User-Supplied Address ==== +SWC ID: 112 +Severity: Medium +Contract: Unknown +Function name: _function_0x9b58bc26 +PC address: 849 +Estimated Gas Usage: 1176 - 35928 +The contract delegates execution to another contract with a user-supplied address. +The smart contract delegates execution to a user-supplied address. Note that callers can execute arbitrary contracts and that the callee contract can access the storage of the calling contract. +-------------------- + ==== Unchecked Call Return Value ==== SWC ID: 104 Severity: Low From 44e31a216e4506c4fd255ff13889b03e3e212c3e Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 20:16:56 +0200 Subject: [PATCH 77/97] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4924d94d..598ccc55 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril is an open-source security analysis tool for Ethereum smart contracts. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. +Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. Whether you want to contribute, need support, or want to learn what we have cooking for the future, our [Discord server](https://discord.gg/E3YrVtG) will serve your needs. From e4f3a4a9a76c6496061284ff945b1ef1543590ef Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 20:20:13 +0200 Subject: [PATCH 78/97] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 598ccc55..a14760cd 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic analysis, taint analysis and control flow checking to detect a variety of security vulnerabilities. It's also used in the backend of [MythX API](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. +Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis detect a variety of security vulnerabilities. It's also used in the backend of [MythX](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. Whether you want to contribute, need support, or want to learn what we have cooking for the future, our [Discord server](https://discord.gg/E3YrVtG) will serve your needs. From ab940af8b793f1c73b5041eca8513e1de100cdf1 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 22:31:56 +0200 Subject: [PATCH 79/97] Refactor module logging --- mythril/analysis/modules/base.py | 18 +++++++++++++++++- mythril/analysis/modules/delegatecall.py | 4 +--- .../modules/dependence_on_predictable_vars.py | 4 +--- mythril/analysis/modules/deprecated_ops.py | 2 +- mythril/analysis/modules/dos.py | 3 +-- mythril/analysis/modules/ether_thief.py | 2 +- mythril/analysis/modules/exceptions.py | 2 +- mythril/analysis/modules/external_calls.py | 2 +- mythril/analysis/modules/integer.py | 2 +- mythril/analysis/modules/multiple_sends.py | 2 +- .../modules/state_change_external_calls.py | 2 +- mythril/analysis/modules/suicide.py | 2 +- mythril/analysis/modules/unchecked_retval.py | 2 +- mythril/analysis/security.py | 6 ++++++ mythril/interfaces/cli.py | 2 -- 15 files changed, 35 insertions(+), 20 deletions(-) diff --git a/mythril/analysis/modules/base.py b/mythril/analysis/modules/base.py index d7075109..13b2df81 100644 --- a/mythril/analysis/modules/base.py +++ b/mythril/analysis/modules/base.py @@ -49,12 +49,28 @@ class DetectionModule: """ self._issues = [] - def execute(self, statespace): + def execute(self, statespace) -> list: """The entry point for execution, which is being called by Mythril. :param statespace: :return: """ + + log.debug("Entering analysis module: {}".format(self.__class__.__name__)) + + issues = self._execute(statespace) + + log.debug("Exiting analysis module: {}".format(self.__class__.__name__)) + + return issues + + def _execute(self, statespace): + """The entry point for execution, which is being called by Mythril. + + :param statespace: + :return: + """ + raise NotImplementedError() def __repr__(self) -> str: diff --git a/mythril/analysis/modules/delegatecall.py b/mythril/analysis/modules/delegatecall.py index aeb3e06f..6a0c7449 100644 --- a/mythril/analysis/modules/delegatecall.py +++ b/mythril/analysis/modules/delegatecall.py @@ -12,7 +12,6 @@ from mythril.exceptions import UnsatError from mythril.laser.ethereum.state.annotation import StateAnnotation from mythril.laser.ethereum.state.global_state import GlobalState from mythril.laser.smt import symbol_factory, UGT -from mythril.laser.smt import symbol_factory, UGT log = logging.getLogger(__name__) @@ -80,13 +79,12 @@ class DelegateCallModule(DetectionModule): pre_hooks=["DELEGATECALL", "RETURN", "STOP"], ) - def execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> list: """ :param state: :return: """ - log.debug("Executing module: DELEGATE_CALL") self._issues.extend(_analyze_states(state)) return self.issues diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index a8c7ac75..937f2b7b 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -64,15 +64,13 @@ class PredictableDependenceModule(DetectionModule): post_hooks=["BLOCKHASH"] + predictable_ops, ) - def execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> list: """ :param state: :return: """ - log.debug("Executing module: DEPENDENCE_ON_PREDICTABLE_VARS") - self._issues.extend(_analyze_states(state)) return self.issues diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index 6e8adacc..f4703cd9 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -76,7 +76,7 @@ class DeprecatedOperationsModule(DetectionModule): pre_hooks=["ORIGIN", "CALLCODE"], ) - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): """ :param state: diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index c4a089f3..9614ba95 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -43,13 +43,12 @@ class DOS(DetectionModule): """Keeps track of how often jump destinations are reached.""" self._jumpdest_count = {} # type: Dict[object, dict] - def execute(self, state: GlobalState) -> None: + def _execute(self, state: GlobalState) -> None: """ :param state: :return: """ - log.debug("Executing module: DOS") self._issues.extend(self._analyze_states(state)) diff --git a/mythril/analysis/modules/ether_thief.py b/mythril/analysis/modules/ether_thief.py index d382ca07..0ab17d42 100644 --- a/mythril/analysis/modules/ether_thief.py +++ b/mythril/analysis/modules/ether_thief.py @@ -51,7 +51,7 @@ class EtherThief(DetectionModule): super().reset_module() self._cache_addresses = {} - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): """ :param state: diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py index 8eaf6400..23740f9c 100644 --- a/mythril/analysis/modules/exceptions.py +++ b/mythril/analysis/modules/exceptions.py @@ -72,7 +72,7 @@ class ReachableExceptionsModule(DetectionModule): pre_hooks=["ASSERT_FAIL"], ) - def execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> list: """ :param state: diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index e24470a6..6bc26687 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -137,7 +137,7 @@ class ExternalCalls(DetectionModule): pre_hooks=["CALL"], ) - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): """ :param state: diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py index 43f57c96..773e8173 100644 --- a/mythril/analysis/modules/integer.py +++ b/mythril/analysis/modules/integer.py @@ -84,7 +84,7 @@ class IntegerOverflowUnderflowModule(DetectionModule): self._overflow_cache = {} self._underflow_cache = {} - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): """Executes analysis module for integer underflow and integer overflow. :param state: Statespace to analyse diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 6b09db77..60ef35ff 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -43,7 +43,7 @@ class MultipleSendsModule(DetectionModule): ], ) - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): self._issues.extend(_analyze_state(state)) return self.issues diff --git a/mythril/analysis/modules/state_change_external_calls.py b/mythril/analysis/modules/state_change_external_calls.py index 6a394009..107a3633 100644 --- a/mythril/analysis/modules/state_change_external_calls.py +++ b/mythril/analysis/modules/state_change_external_calls.py @@ -84,7 +84,7 @@ class StateChange(DetectionModule): ], ) - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): self._issues.extend(self._analyze_state(state)) return self.issues diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index 62bc3e00..009e0503 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -37,7 +37,7 @@ class SuicideModule(DetectionModule): super().reset_module() self._cache_address = {} - def execute(self, state: GlobalState): + def _execute(self, state: GlobalState): """ :param state: diff --git a/mythril/analysis/modules/unchecked_retval.py b/mythril/analysis/modules/unchecked_retval.py index 45fdceec..b88be6df 100644 --- a/mythril/analysis/modules/unchecked_retval.py +++ b/mythril/analysis/modules/unchecked_retval.py @@ -49,7 +49,7 @@ class UncheckedRetvalModule(DetectionModule): post_hooks=["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"], ) - def execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> list: """ :param state: diff --git a/mythril/analysis/security.py b/mythril/analysis/security.py index abacf49a..71f0a516 100644 --- a/mythril/analysis/security.py +++ b/mythril/analysis/security.py @@ -52,6 +52,10 @@ def get_detection_modules(entrypoint, include_modules=()): :param include_modules: :return: """ + + module = importlib.import_module("mythril.analysis.modules.base") + module.log.setLevel(log.level) + include_modules = list(include_modules) _modules = [] @@ -62,12 +66,14 @@ def get_detection_modules(entrypoint, include_modules=()): module = importlib.import_module( "mythril.analysis.modules." + module_name ) + module.log.setLevel(log.level) if module.detector.entrypoint == entrypoint: _modules.append(module) else: for module_name in include_modules: module = importlib.import_module("mythril.analysis.modules." + module_name) if module.__name__ != "base" and module.detector.entrypoint == entrypoint: + module.log.setLevel(log.level) _modules.append(module) log.info("Found %s detection modules", len(_modules)) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 0fbbab7e..ad2d79c7 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -24,8 +24,6 @@ from mythril.mythril import ( ) from mythril.version import VERSION -# logging.basicConfig(level=logging.DEBUG) - log = logging.getLogger(__name__) From 76c2219f56d4323bb5cb791cacf5bc4f3348c9b7 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 22:36:39 +0200 Subject: [PATCH 80/97] Update method descriptions --- mythril/analysis/modules/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mythril/analysis/modules/base.py b/mythril/analysis/modules/base.py index 13b2df81..1ab3105b 100644 --- a/mythril/analysis/modules/base.py +++ b/mythril/analysis/modules/base.py @@ -53,7 +53,7 @@ class DetectionModule: """The entry point for execution, which is being called by Mythril. :param statespace: - :return: + :return: list """ log.debug("Entering analysis module: {}".format(self.__class__.__name__)) @@ -64,11 +64,11 @@ class DetectionModule: return issues - def _execute(self, statespace): - """The entry point for execution, which is being called by Mythril. + def _execute(self, statespace) -> list: + """Module main method (override this) :param statespace: - :return: + :return: list """ raise NotImplementedError() From 2e62bbaea17e233964c8468b4219957b453e1612 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 22:40:06 +0200 Subject: [PATCH 81/97] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a14760cd..8cde7978 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis detect a variety of security vulnerabilities. It's also used in the backend of [MythX](https://mythx.io). If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. +Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis detect a variety of security vulnerabilities. It's also used (in combination with other tools and techniques) in the [MythX](https://mythx.io) security analysis platform. + +If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. Whether you want to contribute, need support, or want to learn what we have cooking for the future, our [Discord server](https://discord.gg/E3YrVtG) will serve your needs. From b055707ac0e69e2e25a66a11f6de0c95806f7971 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 22:40:58 +0200 Subject: [PATCH 82/97] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cde7978..5d057cfb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) -Mythril is a security analysis tool for EVM bytecode. It can be used to detect security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis detect a variety of security vulnerabilities. It's also used (in combination with other tools and techniques) in the [MythX](https://mythx.io) security analysis platform. +Mythril is a security analysis tool for EVM bytecode. It detects security vulnerabilities in smart contracts built for Ethereum, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis detect a variety of security vulnerabilities. It's also used (in combination with other tools and techniques) in the [MythX](https://mythx.io) security analysis platform. If you are a smart contract developer, we recommend using [MythX tools](https://github.com/b-mueller/awesome-mythx-smart-contract-security) which are optimized for usability and cover a wider range of security issues. From a134a05206d029b022b2e8363f093708e47cbd52 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 23:08:33 +0200 Subject: [PATCH 83/97] Fix method annotations and remove redundant return statements --- mythril/analysis/modules/base.py | 12 +++++------- mythril/analysis/modules/delegatecall.py | 1 - .../modules/dependence_on_predictable_vars.py | 1 - mythril/analysis/modules/deprecated_ops.py | 1 - mythril/analysis/modules/ether_thief.py | 1 - mythril/analysis/modules/exceptions.py | 1 - mythril/analysis/modules/external_calls.py | 1 - mythril/analysis/modules/multiple_sends.py | 1 - .../analysis/modules/state_change_external_calls.py | 1 - mythril/analysis/modules/suicide.py | 1 - mythril/analysis/modules/unchecked_retval.py | 1 - 11 files changed, 5 insertions(+), 17 deletions(-) diff --git a/mythril/analysis/modules/base.py b/mythril/analysis/modules/base.py index 1ab3105b..08ede008 100644 --- a/mythril/analysis/modules/base.py +++ b/mythril/analysis/modules/base.py @@ -49,26 +49,24 @@ class DetectionModule: """ self._issues = [] - def execute(self, statespace) -> list: + def execute(self, statespace): """The entry point for execution, which is being called by Mythril. :param statespace: - :return: list + :return: """ log.debug("Entering analysis module: {}".format(self.__class__.__name__)) - issues = self._execute(statespace) + self._execute(statespace) log.debug("Exiting analysis module: {}".format(self.__class__.__name__)) - return issues - - def _execute(self, statespace) -> list: + def _execute(self, statespace): """Module main method (override this) :param statespace: - :return: list + :return: """ raise NotImplementedError() diff --git a/mythril/analysis/modules/delegatecall.py b/mythril/analysis/modules/delegatecall.py index 6a0c7449..56774065 100644 --- a/mythril/analysis/modules/delegatecall.py +++ b/mythril/analysis/modules/delegatecall.py @@ -86,7 +86,6 @@ class DelegateCallModule(DetectionModule): :return: """ self._issues.extend(_analyze_states(state)) - return self.issues def _analyze_states(state: GlobalState) -> List[Issue]: diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 937f2b7b..3e33392f 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -72,7 +72,6 @@ class PredictableDependenceModule(DetectionModule): """ self._issues.extend(_analyze_states(state)) - return self.issues def _analyze_states(state: GlobalState) -> list: diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index f4703cd9..8e301bc5 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -83,7 +83,6 @@ class DeprecatedOperationsModule(DetectionModule): :return: """ self._issues.extend(_analyze_state(state)) - return self.issues detector = DeprecatedOperationsModule() diff --git a/mythril/analysis/modules/ether_thief.py b/mythril/analysis/modules/ether_thief.py index 0ab17d42..061acf76 100644 --- a/mythril/analysis/modules/ether_thief.py +++ b/mythril/analysis/modules/ether_thief.py @@ -58,7 +58,6 @@ class EtherThief(DetectionModule): :return: """ self._issues.extend(self._analyze_state(state)) - return self.issues def _analyze_state(self, state): """ diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py index 23740f9c..8a803c7e 100644 --- a/mythril/analysis/modules/exceptions.py +++ b/mythril/analysis/modules/exceptions.py @@ -79,7 +79,6 @@ class ReachableExceptionsModule(DetectionModule): :return: """ self._issues.extend(_analyze_state(state)) - return self.issues detector = ReachableExceptionsModule() diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index 6bc26687..f163fc3a 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -144,7 +144,6 @@ class ExternalCalls(DetectionModule): :return: """ self._issues.extend(_analyze_state(state)) - return self.issues detector = ExternalCalls() diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 60ef35ff..1b1be4d1 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -45,7 +45,6 @@ class MultipleSendsModule(DetectionModule): def _execute(self, state: GlobalState): self._issues.extend(_analyze_state(state)) - return self.issues def _analyze_state(state: GlobalState): diff --git a/mythril/analysis/modules/state_change_external_calls.py b/mythril/analysis/modules/state_change_external_calls.py index 107a3633..e6de110e 100644 --- a/mythril/analysis/modules/state_change_external_calls.py +++ b/mythril/analysis/modules/state_change_external_calls.py @@ -86,7 +86,6 @@ class StateChange(DetectionModule): def _execute(self, state: GlobalState): self._issues.extend(self._analyze_state(state)) - return self.issues @staticmethod def _add_external_call(global_state: GlobalState) -> None: diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index 009e0503..2b1ff739 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -44,7 +44,6 @@ class SuicideModule(DetectionModule): :return: """ self._issues.extend(self._analyze_state(state)) - return self.issues def _analyze_state(self, state): log.info("Suicide module: Analyzing suicide instruction") diff --git a/mythril/analysis/modules/unchecked_retval.py b/mythril/analysis/modules/unchecked_retval.py index b88be6df..5fc2ac0b 100644 --- a/mythril/analysis/modules/unchecked_retval.py +++ b/mythril/analysis/modules/unchecked_retval.py @@ -56,7 +56,6 @@ class UncheckedRetvalModule(DetectionModule): :return: """ self._issues.extend(_analyze_state(state)) - return self.issues def _analyze_state(state: GlobalState) -> list: From 39364503f12cc825f82a1d4e4d12c84e1056c36a Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 26 May 2019 23:16:27 +0200 Subject: [PATCH 84/97] More annotations, fix problem in predictable_vars module --- mythril/analysis/modules/base.py | 2 +- mythril/analysis/modules/delegatecall.py | 2 +- mythril/analysis/modules/dependence_on_predictable_vars.py | 4 ++-- mythril/analysis/modules/deprecated_ops.py | 2 +- mythril/analysis/modules/ether_thief.py | 2 +- mythril/analysis/modules/exceptions.py | 2 +- mythril/analysis/modules/external_calls.py | 2 +- mythril/analysis/modules/integer.py | 2 +- mythril/analysis/modules/multiple_sends.py | 2 +- mythril/analysis/modules/state_change_external_calls.py | 2 +- mythril/analysis/modules/suicide.py | 2 +- mythril/analysis/modules/unchecked_retval.py | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mythril/analysis/modules/base.py b/mythril/analysis/modules/base.py index 08ede008..e66c2e6d 100644 --- a/mythril/analysis/modules/base.py +++ b/mythril/analysis/modules/base.py @@ -49,7 +49,7 @@ class DetectionModule: """ self._issues = [] - def execute(self, statespace): + def execute(self, statespace) -> None: """The entry point for execution, which is being called by Mythril. :param statespace: diff --git a/mythril/analysis/modules/delegatecall.py b/mythril/analysis/modules/delegatecall.py index 56774065..71bc0fb4 100644 --- a/mythril/analysis/modules/delegatecall.py +++ b/mythril/analysis/modules/delegatecall.py @@ -79,7 +79,7 @@ class DelegateCallModule(DetectionModule): pre_hooks=["DELEGATECALL", "RETURN", "STOP"], ) - def _execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 3e33392f..747d4ab5 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -21,7 +21,7 @@ final_ops = ["CALL", "SUICIDE", "STOP", "RETURN"] def is_prehook() -> bool: """Check if we are in prehook. One of Bernhard's trademark hacks!""" - return "pre_hook" in traceback.format_stack()[-4] + return "pre_hook" in traceback.format_stack()[-5] class PredictableValueAnnotation: @@ -64,7 +64,7 @@ class PredictableDependenceModule(DetectionModule): post_hooks=["BLOCKHASH"] + predictable_ops, ) - def _execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index 8e301bc5..24553ffc 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -76,7 +76,7 @@ class DeprecatedOperationsModule(DetectionModule): pre_hooks=["ORIGIN", "CALLCODE"], ) - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/ether_thief.py b/mythril/analysis/modules/ether_thief.py index 061acf76..863ff449 100644 --- a/mythril/analysis/modules/ether_thief.py +++ b/mythril/analysis/modules/ether_thief.py @@ -51,7 +51,7 @@ class EtherThief(DetectionModule): super().reset_module() self._cache_addresses = {} - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py index 8a803c7e..387a1975 100644 --- a/mythril/analysis/modules/exceptions.py +++ b/mythril/analysis/modules/exceptions.py @@ -72,7 +72,7 @@ class ReachableExceptionsModule(DetectionModule): pre_hooks=["ASSERT_FAIL"], ) - def _execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index f163fc3a..510dd82c 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -137,7 +137,7 @@ class ExternalCalls(DetectionModule): pre_hooks=["CALL"], ) - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py index 773e8173..48556389 100644 --- a/mythril/analysis/modules/integer.py +++ b/mythril/analysis/modules/integer.py @@ -84,7 +84,7 @@ class IntegerOverflowUnderflowModule(DetectionModule): self._overflow_cache = {} self._underflow_cache = {} - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: """Executes analysis module for integer underflow and integer overflow. :param state: Statespace to analyse diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index 1b1be4d1..8ea4dd62 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -43,7 +43,7 @@ class MultipleSendsModule(DetectionModule): ], ) - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: self._issues.extend(_analyze_state(state)) diff --git a/mythril/analysis/modules/state_change_external_calls.py b/mythril/analysis/modules/state_change_external_calls.py index e6de110e..74855be9 100644 --- a/mythril/analysis/modules/state_change_external_calls.py +++ b/mythril/analysis/modules/state_change_external_calls.py @@ -84,7 +84,7 @@ class StateChange(DetectionModule): ], ) - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: self._issues.extend(self._analyze_state(state)) @staticmethod diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index 2b1ff739..abe38ac9 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -37,7 +37,7 @@ class SuicideModule(DetectionModule): super().reset_module() self._cache_address = {} - def _execute(self, state: GlobalState): + def _execute(self, state: GlobalState) -> None: """ :param state: diff --git a/mythril/analysis/modules/unchecked_retval.py b/mythril/analysis/modules/unchecked_retval.py index 5fc2ac0b..fce83af8 100644 --- a/mythril/analysis/modules/unchecked_retval.py +++ b/mythril/analysis/modules/unchecked_retval.py @@ -49,7 +49,7 @@ class UncheckedRetvalModule(DetectionModule): post_hooks=["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"], ) - def _execute(self, state: GlobalState) -> list: + def _execute(self, state: GlobalState) -> None: """ :param state: From e384ee8f58ce750a1b38c24289fb173a2ef480ac Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 27 May 2019 09:37:19 +0530 Subject: [PATCH 85/97] Add comments --- mythril/laser/ethereum/state/machine_state.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mythril/laser/ethereum/state/machine_state.py b/mythril/laser/ethereum/state/machine_state.py index c1e7a585..f925a1aa 100644 --- a/mythril/laser/ethereum/state/machine_state.py +++ b/mythril/laser/ethereum/state/machine_state.py @@ -125,6 +125,8 @@ class MachineState: """ if self.memory_size > start + size: return 0 + + # The extension size is calculated based on the word length new_size = utils.ceil32(start + size) // 32 old_size = self.memory_size // 32 From 01e15f0454a43ca52d15af7ee55cf98c5d469d73 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 27 May 2019 19:43:40 +0200 Subject: [PATCH 86/97] Bump version --- mythril/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/version.py b/mythril/version.py index 7896986e..0b19f08b 100644 --- a/mythril/version.py +++ b/mythril/version.py @@ -4,4 +4,4 @@ This file is suitable for sourcing inside POSIX shell, e.g. bash as well as for importing into Python. """ -VERSION = "v0.20.6" # NOQA +VERSION = "v0.20.7" # NOQA From 1f226e1ac4962ad6587123a3f1754fcbaca1f84a Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 28 May 2019 15:39:03 +0200 Subject: [PATCH 87/97] Add constraints on sender and receiver --- mythril/analysis/modules/ether_thief.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mythril/analysis/modules/ether_thief.py b/mythril/analysis/modules/ether_thief.py index 863ff449..3fa65aa7 100644 --- a/mythril/analysis/modules/ether_thief.py +++ b/mythril/analysis/modules/ether_thief.py @@ -7,6 +7,7 @@ from copy import copy from mythril.analysis import solver from mythril.analysis.modules.base import DetectionModule from mythril.analysis.report import Issue +from mythril.laser.ethereum.transaction.symbolic import ATTACKER_ADDRESS from mythril.analysis.swc_data import UNPROTECTED_ETHER_WITHDRAWAL from mythril.exceptions import UnsatError from mythril.laser.ethereum.state.global_state import GlobalState @@ -81,15 +82,13 @@ class EtherThief(DetectionModule): constraints = copy(state.mstate.constraints) for tx in state.world_state.transaction_sequence: - if tx.caller == 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF: - # There's sometimes no overflow check on balances added. - # But we don't care about attacks that require more 2^^256 ETH to be sent. + constraints += [BVAddNoOverflow(eth_sent_total, tx.call_value, False)] + eth_sent_total = Sum(eth_sent_total, tx.call_value) - constraints += [BVAddNoOverflow(eth_sent_total, tx.call_value, False)] - eth_sent_total = Sum(eth_sent_total, tx.call_value) constraints += [ + tx.caller == ATTACKER_ADDRESS, UGT(call_value, eth_sent_total), - target == state.environment.sender, + target == ATTACKER_ADDRESS, ] try: From c49500d662bc5987ca99eb0324528dc0dd748c56 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 29 May 2019 21:10:48 +0200 Subject: [PATCH 88/97] Bump version --- mythril/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/version.py b/mythril/version.py index 0b19f08b..0e8364bd 100644 --- a/mythril/version.py +++ b/mythril/version.py @@ -4,4 +4,4 @@ This file is suitable for sourcing inside POSIX shell, e.g. bash as well as for importing into Python. """ -VERSION = "v0.20.7" # NOQA +VERSION = "v0.20.8" # NOQA From 1ad0e8b844de7e2607a8e18c2869001db305e4e5 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 31 May 2019 23:44:53 +0200 Subject: [PATCH 89/97] refactor and update setup.py - update project name in setup.py & documentation - update copyright - update url - update setup.py according to best practices --- docs/source/conf.py | 8 +- mythril/__init__.py | 2 +- mythril/{version.py => __version__.py} | 0 mythril/interfaces/cli.py | 2 +- setup.py | 134 +++++++++++++++---------- 5 files changed, 85 insertions(+), 61 deletions(-) rename mythril/{version.py => __version__.py} (100%) diff --git a/docs/source/conf.py b/docs/source/conf.py index 36f41a8c..7169c4fa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,14 +20,14 @@ sys.path.insert(0, os.path.abspath("../../")) # -- Project information ----------------------------------------------------- -project = "Mythril Classic" -copyright = "2018, Bernhard Mueller" -author = "Bernhard Mueller" +project = "Mythril" +copyright = "2019, ConsenSys Diligence" +author = "ConsenSys Dilligence" # The short X.Y version version = "" # The full version, including alpha/beta/rc tags -from mythril.version import VERSION +from mythril.__version__ import __version__ as VERSION release = VERSION diff --git a/mythril/__init__.py b/mythril/__init__.py index bfd74099..5f8e6963 100644 --- a/mythril/__init__.py +++ b/mythril/__init__.py @@ -3,4 +3,4 @@ __docformat__ = "restructuredtext" # Accept mythril.VERSION to get mythril's current version number -from .version import VERSION # NOQA +from .__version__ import __version__ as VERSION # NOQA diff --git a/mythril/version.py b/mythril/__version__.py similarity index 100% rename from mythril/version.py rename to mythril/__version__.py diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index ad2d79c7..e3725d38 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -22,7 +22,7 @@ from mythril.mythril import ( MythrilConfig, MythrilLevelDB, ) -from mythril.version import VERSION +from mythril.__version__ import __version__ as VERSION log = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index 21474308..b46a378f 100755 --- a/setup.py +++ b/setup.py @@ -9,21 +9,82 @@ publish to pypi w/o having to convert Readme.md to RST: """ from setuptools import setup, find_packages from setuptools.command.install import install -from pathlib import Path import sys import os +import io -# To make lint checkers happy we set VERSION here, but -# it is redefined by the exec below +# Package meta-data. +NAME = "mythril" +DESCRIPTION = "Security analysis tool for Ethereum smart contracts" +URL = "https://github.com/ConsenSys/mythril" +AUTHOR = "ConsenSys Dilligence" +AUTHOR_MAIL = None +REQUIRES_PYTHON = ">=3.5.0" + + +# What packages are required for this module to be executed? +REQUIRED = [ + "coloredlogs>=10.0", + "py_ecc==1.4.2", + "ethereum>=2.3.2", + "z3-solver>=4.8.5.0", + "requests", + "py-solc", + "plyvel", + "eth_abi==1.3.0", + "eth-utils>=1.0.1", + "eth-account>=0.1.0a2,<=0.3.0", + "eth-hash>=0.1.0", + "eth-keyfile>=0.5.1", + "eth-keys>=0.2.0b3", + "eth-rlp>=0.1.0", + "eth-tester==0.1.0b32", + "eth-typing>=2.0.0", + "coverage", + "jinja2>=2.9", + "rlp>=1.0.1", + "transaction>=2.2.1", + "py-flags", + "mock", + "configparser>=3.5.0", + "persistent>=4.2.0", + "ethereum-input-decoder>=0.2.2", + "matplotlib", +] + +TESTS_REQUIRE = ["mypy", "pytest>=3.6.0", "pytest_mock", "pytest-cov"] + +# What packages are optional? +EXTRAS = { + # 'fancy feature': ['django'], +} + +# If version is set to None then it will be fetched from __version__.py VERSION = None -# Package version (vX.Y.Z). It must match git tag being used for CircleCI -# deployment; otherwise the build will failed. +here = os.path.abspath(os.path.dirname(__file__)) + +# Import the README and use it as the long-description. +# Note: this will only work if 'README.md' is present in your MANIFEST.in file! +try: + with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f: + long_description = "\n" + f.read() +except FileNotFoundError: + long_description = DESCRIPTION -version_path = (Path(__file__).parent / "mythril" / "version.py").absolute() -exec(open(str(version_path), "r").read()) +# Load the package's __version__.py module as a dictionary. +about = {} +if not VERSION: + project_slug = NAME.lower().replace("-", "_").replace(" ", "_") + with open(os.path.join(here, project_slug, "__version__.py")) as f: + exec(f.read(), about) +else: + about["__version__"] = VERSION + +# Package version (vX.Y.Z). It must match git tag being used for CircleCI +# deployment; otherwise the build will failed. class VerifyVersionCommand(install): """Custom command to verify that the git tag matches our version.""" @@ -40,25 +101,15 @@ class VerifyVersionCommand(install): sys.exit(info) -def read_file(fname): - """return file contents. - - :param fname: path relative to setup.py - :return: file contents - """ - with open(os.path.join(os.path.dirname(__file__), fname), "r") as fd: - return fd.read() - - setup( - name="mythril", - version=VERSION[1:], - description="Security analysis tool for Ethereum smart contracts", - long_description=read_file("README.md") if os.path.isfile("README.md") else "", + name=NAME, + version=about["__version__"][1:], + description=DESCRIPTION, + long_description=long_description, long_description_content_type="text/markdown", # requires twine and recent setuptools - url="https://github.com/b-mueller/mythril", - author="Bernhard Mueller", - author_email="bernhard.mueller11@gmail.com", + url=URL, + author=AUTHOR, + author_mail=AUTHOR_MAIL, license="MIT", classifiers=[ "Development Status :: 3 - Alpha", @@ -71,37 +122,10 @@ setup( ], keywords="hacking disassembler security ethereum", packages=find_packages(exclude=["contrib", "docs", "tests"]), - install_requires=[ - "coloredlogs>=10.0", - "py_ecc==1.4.2", - "ethereum>=2.3.2", - "z3-solver>=4.8.5.0", - "requests", - "py-solc", - "plyvel", - "eth_abi==1.3.0", - "eth-utils>=1.0.1", - "eth-account>=0.1.0a2,<=0.3.0", - "eth-hash>=0.1.0", - "eth-keyfile>=0.5.1", - "eth-keys>=0.2.0b3", - "eth-rlp>=0.1.0", - "eth-tester==0.1.0b32", - "eth-typing>=2.0.0", - "coverage", - "jinja2>=2.9", - "rlp>=1.0.1", - "transaction>=2.2.1", - "py-flags", - "mock", - "configparser>=3.5.0", - "persistent>=4.2.0", - "ethereum-input-decoder>=0.2.2", - "matplotlib", - ], - tests_require=["mypy", "pytest>=3.6.0", "pytest_mock", "pytest-cov"], - python_requires=">=3.5", - extras_require={}, + install_requires=REQUIRED, + tests_require=TESTS_REQUIRE, + python_requires=REQUIRES_PYTHON, + extras_require=EXTRAS, package_data={"mythril.analysis.templates": ["*"], "mythril.support.assets": ["*"]}, include_package_data=True, entry_points={"console_scripts": ["myth=mythril.interfaces.cli:main"]}, From 678ff395ec34e992afd07d223ca4f4ab1bf02116 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 31 May 2019 23:47:07 +0200 Subject: [PATCH 90/97] remove unused pipfile --- Pipfile | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Pipfile diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 753481aa..00000000 --- a/Pipfile +++ /dev/null @@ -1,19 +0,0 @@ -[[source]] -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -"e1839a8" = {path = ".", editable = true} - -[dev-packages] -pylint = "*" -yapf = "*" -pytest = "*" -pytest-mock = "*" -pytest-cov = "*" - -[requires] - -[pipenv] -allow_prereleases = true From 3ad9919527adf69f7203bdfc56698e48f106f74a Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Sat, 1 Jun 2019 00:10:54 +0200 Subject: [PATCH 91/97] apply style rules --- mythril/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/__init__.py b/mythril/__init__.py index 5f8e6963..063d3b9b 100644 --- a/mythril/__init__.py +++ b/mythril/__init__.py @@ -3,4 +3,4 @@ __docformat__ = "restructuredtext" # Accept mythril.VERSION to get mythril's current version number -from .__version__ import __version__ as VERSION # NOQA +from .__version__ import __version__ as VERSION # NOQA From 0d4023d629b14d4396d370c395a68fa87b59ddb2 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Sat, 1 Jun 2019 00:19:30 +0200 Subject: [PATCH 92/97] rename to __version__ --- mythril/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/__version__.py b/mythril/__version__.py index 0e8364bd..47e8bec6 100644 --- a/mythril/__version__.py +++ b/mythril/__version__.py @@ -4,4 +4,4 @@ This file is suitable for sourcing inside POSIX shell, e.g. bash as well as for importing into Python. """ -VERSION = "v0.20.8" # NOQA +__version__ = "v0.20.8" From 415b611c3cf906fad8fa918facc6fdf59645f37b Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 5 Jun 2019 22:12:36 +0530 Subject: [PATCH 93/97] Fix Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9843f72a..eb1c32b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,8 +39,6 @@ COPY . /opt/mythril RUN cd /opt/mythril \ && python setup.py install -RUN useradd -m mythril -USER mythril WORKDIR /home/mythril RUN ( [ ! -z "${SOLC}" ] && set -e && for ver in $SOLC; do python -m solc.install v${ver}; done ) || true From ff767f7fd5ed8c7abf96c50f4c9c9c65d560fd9e Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 6 Jun 2019 13:35:08 +0530 Subject: [PATCH 94/97] Fix badge by passing token --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d057cfb..8e874045 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Discord](https://img.shields.io/discord/481002907366588416.svg)](https://discord.gg/E3YrVtG) [![PyPI](https://badge.fury.io/py/mythril.svg)](https://pypi.python.org/pypi/mythril) [![Read the Docs](https://readthedocs.org/projects/mythril/badge/?version=master)](https://mythril.readthedocs.io/en/master/) -![Master Build Status](https://img.shields.io/circleci/project/github/ConsenSys/mythril/master.svg) +![Master Build Status](https://img.shields.io/circleci/build/github/ConsenSys/mythril/master.svg?token=97124ecfaee54366859cae98b5dafc0714325f8b) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) From d51d8fd8717c90a6216d81e6b271f27a47bec07c Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 6 Jun 2019 13:42:22 +0530 Subject: [PATCH 95/97] Change the build branch for flag --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e874045..8618cb5a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Discord](https://img.shields.io/discord/481002907366588416.svg)](https://discord.gg/E3YrVtG) [![PyPI](https://badge.fury.io/py/mythril.svg)](https://pypi.python.org/pypi/mythril) [![Read the Docs](https://readthedocs.org/projects/mythril/badge/?version=master)](https://mythril.readthedocs.io/en/master/) -![Master Build Status](https://img.shields.io/circleci/build/github/ConsenSys/mythril/master.svg?token=97124ecfaee54366859cae98b5dafc0714325f8b) +![Master Build Status](https://img.shields.io/circleci/build/github/ConsenSys/mythril.svg?token=97124ecfaee54366859cae98b5dafc0714325f8b) [![Sonarcloud - Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mythril&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mythril) [![Pypi Installs](https://pepy.tech/badge/mythril)](https://pepy.tech/project/mythril) [![DockerHub Pulls](https://img.shields.io/docker/pulls/mythril/myth.svg?label=DockerHub Pulls)](https://cloud.docker.com/u/mythril/repository/docker/mythril/myth) From 85c599d83265a0c8556b71b5a13ad54a0514d29c Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 6 Jun 2019 14:32:40 +0530 Subject: [PATCH 96/97] Add a check for analysis modules run (#1064) --- mythril/analysis/symbolic.py | 18 ++++++++++-------- mythril/mythril/mythril_analyzer.py | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mythril/analysis/symbolic.py b/mythril/analysis/symbolic.py index cdcb9070..e84939bf 100644 --- a/mythril/analysis/symbolic.py +++ b/mythril/analysis/symbolic.py @@ -42,6 +42,7 @@ class SymExecWrapper: modules=(), compulsory_statespace=True, enable_iprof=False, + run_analysis_modules=True, ): """ @@ -90,14 +91,15 @@ class SymExecWrapper: plugin_loader.load(PluginFactory.build_mutation_pruner_plugin()) plugin_loader.load(PluginFactory.build_instruction_coverage_plugin()) - self.laser.register_hooks( - hook_type="pre", - hook_dict=get_detection_module_hooks(modules, hook_type="pre"), - ) - self.laser.register_hooks( - hook_type="post", - hook_dict=get_detection_module_hooks(modules, hook_type="post"), - ) + if run_analysis_modules: + self.laser.register_hooks( + hook_type="pre", + hook_dict=get_detection_module_hooks(modules, hook_type="pre"), + ) + self.laser.register_hooks( + hook_type="post", + hook_dict=get_detection_module_hooks(modules, hook_type="post"), + ) if isinstance(contract, SolidityContract): self.laser.sym_exec( diff --git a/mythril/mythril/mythril_analyzer.py b/mythril/mythril/mythril_analyzer.py index 5d0596e2..d4d4cd5b 100644 --- a/mythril/mythril/mythril_analyzer.py +++ b/mythril/mythril/mythril_analyzer.py @@ -75,6 +75,7 @@ class MythrilAnalyzer: execution_timeout=self.execution_timeout, create_timeout=self.create_timeout, enable_iprof=self.enable_iprof, + run_analysis_modules=False, ) return get_serializable_statespace(sym) @@ -108,6 +109,7 @@ class MythrilAnalyzer: transaction_count=transaction_count, create_timeout=self.create_timeout, enable_iprof=self.enable_iprof, + run_analysis_modules=False, ) return generate_graph(sym, physics=enable_physics, phrackify=phrackify) From fadeaea98cffcac900662c70dd6b11a43584c31b Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 6 Jun 2019 20:52:37 +0530 Subject: [PATCH 97/97] Fix problem with requirements (#1066) --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3cabe805..1b49350c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ ethereum>=2.3.2 ethereum-input-decoder>=0.2.2 eth-hash>=0.1.0 eth-keyfile>=0.5.1 -eth-keys>=0.2.0b3 +eth-keys>=0.2.0b3,<0.3.0 eth-rlp>=0.1.0 eth-tester==0.1.0b32 eth-typing>=2.0.0 diff --git a/setup.py b/setup.py index b46a378f..58931527 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ REQUIRED = [ "eth-account>=0.1.0a2,<=0.3.0", "eth-hash>=0.1.0", "eth-keyfile>=0.5.1", - "eth-keys>=0.2.0b3", + "eth-keys>=0.2.0b3,<0.3.0", "eth-rlp>=0.1.0", "eth-tester==0.1.0b32", "eth-typing>=2.0.0",