Skip to content

Dev: Standard Practice for Contract Upgrades

zjlin edited this page Oct 14, 2022 · 4 revisions

Contract Upgrade Version Control

change the previous version’s name to the following format: contractnameV#.sol The updated version will take on the previous name so that we can reuse the tests from the previous version for compatibility testing.

Storage slot layout

Compare the storage slot layout of the previous version with current to ensure no storage collision. pending completion of this ticket MP-875

Testing

Ensure that all new feature are tested and coverage is ran Dev: Running Hardhat Coverage

Simulation Test

Spin up a local chain with previous contract, run deploy upgrade scripts, and then walk chain to snapshot, possibly exclude this step for public staking update

For rollback purposes a record of previous logic contract address should be kept.