I compiled a simple smart contract with --bin option (vs --bin-runtime), and looked at the assembly code. I can see that at first, the "setup" code copy all the run-time code with CODECOPY to memory, then RETURN; STOP.

But what happen after RETURN; STOP? I suppose this stops everything, but logically the main code should run next, so I am confused.

To make sense, after RETURN; STOP, EVM should continue to execute the code staying in returned memory, but this does not seem to be explained in Ethereum specs?

1 Answer 1


No, after the STOP nothing is executed. The job of the init code (what you're looking at) is to return the code that will be associated in the future with the newly-created contract address. Once it returns that code, execution is complete. When you subsequently send a transaction to the contract address, that code (that was returned by the init code) will be executed.

  • So do I understand correctly that after STOP, a new contract is created, with a new address, and is put on blockchain, so in future, it can be CALL separately? Thanks @smarx !!!
    – user311703
    Mar 28, 2019 at 4:26
  • 1
    Yes, that's right.
    – user19510
    Mar 28, 2019 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.