-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 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 |
---|---|---|
|
@@ -76,6 +76,9 @@ make deploy-example MERKLE_ROOT=<claims-merkle-root> TIMESTAMP=2733427549 | |
|
||
To upgrade a contract, first make sure you pause the contract if it's not paused already (NOTE: the erc20 cannot be paused, the claim contract can though). Once that's done, clone the `aligned_layer` repo and go into the `claim_contracts` directory: | ||
|
||
> [!NOTE] | ||
> The ERC20 cannot be paused. Only the claimable airdrop proxy can be paused. | ||
``` | ||
git clone [email protected]:yetanotherco/aligned_layer.git && cd aligned_layer/claim_contracts | ||
``` | ||
|
@@ -86,6 +89,9 @@ This implementation will most likely be a copy paste of the old implementation, | |
|
||
- Add a public `reinitalize function` with a `reinitializer()` modifier that takes in the next version number of the contract (the first version is `1`). As an example, if this is the first upgrade being done, you should add this function to the contract: | ||
|
||
> [!WARNING] | ||
> DO NOT UPDATE STORAGE VARIABLES IN THIS AND FOLLOWING UPGRADES, ONLY ADD NEW ONES. | ||
```solidity | ||
function reinitialize() public reinitializer(2) { | ||
if (!paused()) { | ||
|
@@ -96,7 +102,6 @@ function reinitialize() public reinitializer(2) { | |
|
||
Put the new implementation in a file inside the `src` directory with an appropriate name. | ||
|
||
|
||
## Write the deployment script | ||
|
||
Under the `script` directory, create a new forge script (with the `.s.sol` extension) with a name like `UpgradeContract.s.sol`, with this code in it: | ||
|
@@ -165,19 +170,17 @@ then fill in the missing parts (between `<>` brackets), putting the path to the | |
|
||
Go into the `config.mainnet.json` file inside the `script-config` directory and fill in the following values: | ||
|
||
|
||
``` | ||
{ | ||
"foundation": "", | ||
"contractProxy": "", | ||
} | ||
``` | ||
|
||
- `foundation` is the address of the foundation safe. | ||
- `contractProxy` is the address of the contract proxy to upgrade. | ||
|
||
|
||
## Run the deployment script | ||
|
||
Run the script with | ||
|
@@ -196,7 +199,6 @@ cd script && \ | |
|
||
After running this script, it will show a message like this: | ||
|
||
|
||
``` | ||
Proxy Admin to call: 0xf447FD34D97317759777E242fF64cEAe9C58Bf9A | ||
Calldata of the transaction: | ||
|