1

We all know that the nonce of smart contract can be added 1 time when one subcontract is created using solidity. I'd like to know if the creation of subcontract is the only way to increase nonce. If not, is there other way to increase it?

INFO: The nonce I mentioned above is used to generate subcontract address. How is the address of an Ethereum contract computed?

1 Answer 1

3

Yes, the contract nonce counts how many contract creation operations it's done (starting at 1, although it used to be 0) and a contract create operation is the only way to increase it.

However, the nonce increment happens before the create operation and remains even if the contract creation fails, and also if the child contract later suicides, so it is possible to increment the nonce without actually ending up with a corresponding child contract on the blockchain.

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.