Skip to content

Commit

Permalink
docs(contracts): upgrading documenation
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 17, 2024
1 parent 260900e commit 239bebc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bolt-contracts/docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Upgrading

When upgrading contracts, always keep the old implementation of the contracts around and increment the version number.
For example, when upgrading `BoltManagerV1`, copy it into a new file called `BoltManagerV2` and make your changes.

This is needed to reference check the new contracts with the old contracts so that the OpenZeppelin Upgrades library can
validate the safety of the upgrade. You MUST add this reference when upgrading a contract:

```sol
Options memory opts;
opts.referenceContract = "BoltManagerV1.sol";
Upgrades.upgradeProxy(proxy, "BoltManagerV2.sol", "", opts);
```

Before an upgrade, update the [`Upgrade.s.sol`](../script/holesky/Upgrade.s.sol) script to include the correct contracts, references and configurations.

0 comments on commit 239bebc

Please sign in to comment.