diff --git a/test/unittests/state_transition_test.cpp b/test/unittests/state_transition_test.cpp index 43a80a8c97..e32ff7605b 100644 --- a/test/unittests/state_transition_test.cpp +++ b/test/unittests/state_transition_test.cpp @@ -8,6 +8,19 @@ using namespace evmc::literals; using namespace evmone::test; +TEST_F(state_transition, create2_factory) +{ + static constexpr auto create_address = 0xfd8e7707356349027a32d71eabc7cb0cf9d7cbb4_address; + + const auto factory_code = calldatacopy() + create2().input(0, calldatasize()); + const auto initcode = mstore8(0, push(0xFE)) + ret(0, 1); + + pre.get(*tx.to).code = factory_code; + tx.data = initcode; + expect.post[*tx.to].nonce = pre.get(*tx.to).nonce + 1; // CREATE caller's nonce must be bumped + expect.post[create_address].code = bytes{0xFE}; +} + TEST_F(state_transition, eof_invalid_initcode) { // TODO: Correction of this address is not verified.