1

Based on the note about storage compatibility https://paritytech.github.io/ink/ink_env/fn.set_code_hash.html:

The storage at the code hash will remain untouched. This means that contract developers must ensure that the storage layout of the new code is compatible with that of the old code.

My question is:

  1. How exactly storage compatibility is defined? There are rules for upgrading a contract with openzeppelin https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#modifying-your-contracts. Do the exactly same rules apply for this set_code_hash

Thanks

1 Answer 1

3

How exactly storage compatibility is defined? There are rules for upgrading a contract with openzeppelin https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#modifying-your-contracts. Do the exactly same rules apply for this set_code_hash

It's exactly as described in the docs which you linked.

I've created a GitHub issue for us to document this better. Thanks for bringing this up, our documentation is written by us core developers and it's sometimes hard to see those non-obvious things.

1
  • Yes this is perfect.
    – Daniel Lam
    May 7, 2022 at 2:12

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.