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?


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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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