-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(contracts): upgrading documenation
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |