0

I've created a contract https://ropsten.etherscan.io/address/0xfaba4475358c1c23e37549f9bd54300261873d41#code

And using its createChild() method I've created 3 children

https://ropsten.etherscan.io/address/0x79700787ed34aacd736a14f65d46bcfda61b3e9a#internaltx https://ropsten.etherscan.io/address/0x617214e49c2e31d1a5afa05b1acf8868598e51ce#code https://ropsten.etherscan.io/address/0x306d7eb3fc1fe3ea09b216f193f2dc10e89698d9#code

Every child contains exacly same code

My question is

Why gas price of creation of every of this 3 children contracts is high (200k gas) If only first contains unique code ?

Second and third account should have exacly same code hash in account state tree https://i.stack.imgur.com/afWDt.jpg

the state database should have only one entry and 3 accounts pointing to it (code is immutable) so gas costs of second and third creation should be much lower since there is no new code written to blockchain only new account created.

1 Answer 1

1

The gas cost for deploying a contract does not depend on whether the code is unique, so what you're seeing is expected.

Your Answer

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

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