This document explains the recommended steps for creating and applying a safe, traceable, and reproducible upgrade to the PoCo Diamond proxy.
-
Ensure all tests pass:
Run the full test suite to make sure everything is working before starting an upgrade. -
Create a new upgrade script:
Name the script using the version and upgrade name formatvX.Y.Z.tsand implement the upgrade logic. -
Create a corresponding Markdown report:
Copy the template filev0.0.0-template.mdand rename it to match the script file name. The name should be of the formvX.Y.Z-upgrade-name.md. -
Test dry-runs locally:
Use the script ./dry-run.sh and check the logs and deployment files diff. -
Check the owner's balance:
Make sure the owner wallet has enough ETH for the whole deployment. -
Update GitHub Actions:
Modifyupgrade-facets.ymlworkflow to call the new upgrade script.
Note: to run the upgrade script manually (for testing), use:npx hardhat run scripts/upgrades/vX.Y.Z-upgrade-name.ts --network <network> -
Upgrade on Testnet:
⚠️ Always upgrade on the testnet first.- Trigger the upgrade workflow on GitHub and choose the testnet network.
- Start with a dry run to simulate the upgrade.
- Once verified, apply the upgrade on the live testnet.
-
Upgrade on Mainnet:
- Trigger the upgrade workflow on GitHub and choose the mainnet network.
- Perform a dry run first.
- Apply the upgrade on the mainnet.
- Merge the artifacts PR after successful execution.
-
Refresh the proxy facets on Etherscan:
Go to the Etherscan explorer and follow the steps of "Is this a proxy?" to refresh the facets list. -
Update upgrade report:
Fill in all required information invX.Y.Z-upgrade-name.ts(tx hashes, logs, ...). -
Create a release
- Use Release Please to tag the upgraded version and create the release on GitHub.