2

I recently published a toy dapp (http://etherdate.co/) to the mainnet with a webapp and after deployment found some breaking bugs that necessitate deploying an updated version of the contract.

I think it's only fair that people who committed ether have their state persisted to the new contract generation.

Are there any best practices that people use for copying state from one generation to the next? Or best practices around designing states to be copied?

1 Answer 1

2

delegatecall/returndatasize to help! A neat solution for the upgradeability while preserving the storage is https://github.com/0v1se/contracts-upgradeable

I also had an EIP (905) open on fast cloning the storage, but at the end it turned out that it would open room for a DoS attack. :-/

1
  • oh, cool delegation approach! in contracts-upgradeable. and thanks for the link to your EIP. I can see how gas refunds make the OPCODE-from-v2 approach unworkable... Commented Mar 9, 2018 at 1:07

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.