0

Suppose executing the bytecode of a smart contract in a particular (single) transaction leads to several CREATE's in a row (triggered by the same smart contract). Is it true that the nonce of that smart contract gets raised by 1 with each CREATE regardless of whether the CREATEs fail (e.g. hit a REVERT during execution of its initcode or ran out of gas)?

There is no doubt that the nonce must change with every successful CREATE so as to assure that future creates in that transaction yield different addresses. But I'm not sure about what happens if a CREATE failed, although I expect that the nonce is raised regardless.

enter image description here

1 Answer 1

0

It seems the answer is YES: the nonce is updated at the moment CREATE starts regardless of success of the CREATE. Thanks to Franklin Delehelle for pointing me to the relevant section of the geth codebase.

Here's a screenshot of the relevant bit of code: enter image description here

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.