2

I have a question about versioning of smart contracts in Ethereum. Lots of articles have been written about how to decouple your logic and data, how to use interfaces when referencing other contracts, how to use generic key value stores to store data and retrieving it through library functions in a strongly typed way.

What about querying transactions and event log from old versions of the smart contract? Transactions and emitted events cannot be migrated. They are immutable. And perhaps you need to keep track of them in the client app for history. Events can be added, removed or have their signature changed in different contract versions. How do you deal with querying and decoding transaction input and event data for multiple versions of a contract?

0

It is possible for new contract to use a proxy pattern https://docs.zeppelinos.org/docs/pattern.html that allows to upgrade code but reuse the same address through delegatecall opcode.

For old contracts you have to decide if it is worth the effort to keep compatible with the old contract events and data, or if it is easier to restart as a new contract.

Several prominent examples like Augur token and EtherDelta migrated to a new contract without keeping the history of previous transactions.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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