You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Co-authored-by: Mikers <snissn@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
Co-authored-by: snissn <snissn@users.noreply.github.com>
Co-authored-by: auto-commit <auto-commit@users.noreply.github.com>
Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Co-authored-by: adlrocha <adlrocha@users.noreply.github.com>
Co-authored-by: raulk <raul.kripalani@gmail.com>
Copy file name to clipboardExpand all lines: contracts/README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,48 @@ To deploy the contracts in some other network configured in the Hardhat config y
49
49
make deploy-ipc NETWORK=<network-name>
50
50
```
51
51
52
+
# Upgrading IPC Solidity Contracts
53
+
54
+
This repository's contracts use the Diamond pattern for upgradability, allowing new features to be added or issues to be corrected without a full redeployment. The upgrade process is automated and includes bytecode verification to ensure the integrity of the changes.
55
+
56
+
## Automated Upgrade and Bytecode Verification
57
+
58
+
When you run an upgrade command, the repository's scripts handle several tasks:
59
+
60
+
1.**Bytecode Verification**: The scripts fetch the bytecode of the currently deployed contracts on an FEVM-powered IPC network using the details stored in local JSON files in the root directory of the git repository. They compare this with the bytecode generated after applying the intended changes on a temporary Ganache network.
61
+
62
+
2.**Conditional Upgrades**: If the bytecode verification process detects changes that align with the intended upgrades, the `make` command conditionally triggers other scripts to perform the actual upgrade on the network.
63
+
64
+
## Upgrade Commands
65
+
66
+
To upgrade a contract, you may use the following commands. The NETWORK parameter is optional; if not specified, the scripts will default to "auto":
67
+
68
+
-**Gateway Diamond Upgrade**:
69
+
70
+
```bash
71
+
make upgrade-gw-diamond [NETWORK=<network-name>]
72
+
```
73
+
74
+
- **Subnet Actor Diamond Upgrade**:
75
+
76
+
```bash
77
+
make upgrade-sa-diamond [NETWORK=<network-name>]
78
+
```
79
+
80
+
- **Subnet Registry Diamond Upgrade**:
81
+
```bash
82
+
make upgrade-sr-diamond [NETWORK=<network-name>]
83
+
```
84
+
85
+
After running any of these commands, the scripts will provide transaction details for verification. Check the transaction on the appropriate block explorer to confirm the upgrade's success.
86
+
87
+
## Important Notes
88
+
89
+
- The upgrade commands are intended for use by authorized personnel with a deep understanding of the contracts' functionality.
90
+
- Ensure that your local repository is up to date with the latest contract code and JSON files before initiating an upgrade.
91
+
- Backup all contract data and thoroughly test any new code in a controlled environment prior to an upgrade.
92
+
- Monitor the output of the upgrade process carefully for transaction details and to verify its successful completion.
0 commit comments