manticore icon indicating copy to clipboard operation
manticore copied to clipboard

EVM - implement EIP 1014: Skinny CREATE2

Open feliam opened this issue 7 years ago • 1 comments

We need to add support for CREATE2 opcode added in Constantinople fork.

More detailed information can be found here: https://eips.ethereum.org/EIPS/eip-1014

Things that needs to be done:

  • [ ] Add tests from EIP [1]
  • [ ] Think of more cases the EIP doesn't specify and add them to the test suite.
  • [ ] Add concrete execution implementation, make the symbolic parts fail (don't test this failures) [2].
  • [ ] Add symbolic execution implementation [3]

[1] The tests should be minimal, e.g. doing only the necessary operations like creating a super small contract from bytecode that uses given instruction. The stuff should also be documented well: the instruction implementation should have a link to EIP in its docstring, when creating contract from bytecode we should have some comments describing what instructions are there. So in the end if someone else looks at the code later on they will immediately know what is going on. [2] The symbolic part failure should be done by checking issymbolic(argument), ofc only for the parts that can be symbolic. [3] Please keep in mind that there are certain things that appears to be concrete all the time but there are cases in which they might not be. One of the examples can be EVM.pc. When we apply a IntegerOverflowDetector, the value of pc might get tainted (tainting means marking values so if other values depend on them, they are also marked and so we can detect how certain variables depend on each other) and so changed to Constant; we had a bug related to this that was fixed in https://github.com/trailofbits/manticore/pull/1347.

The concrete and symbolic parts should be done in separate PRs.

feliam avatar Oct 01 '18 20:10 feliam

is this being worked on? i just saw this error:

    raise TerminateState(f"Instruction not implemented {current.semantics}", testcase=True)
manticore.core.state.TerminateState: Instruction not implemented CREATE2

moodysalem avatar Oct 25 '20 15:10 moodysalem