Skip to content

Commit 0c81eef

Browse files
authored
Update README.md
1 parent a685a04 commit 0c81eef

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ The chain ID is 8453 for Base Mainnet, and 84532 for Base Sepolia.
165165

166166
### Upgrade Contract
167167

168+
#### Using single-sig wallet
168169
Upgrading an existing contract is done as per the instructions in [openzeppelin-foundry-upgrades](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades) repository.
169170

170171
First, we create a new contract with its name as `ContractNameV2`, and then we execute the following command:
@@ -186,6 +187,46 @@ forge script ./script/Deploy.s.sol:Upgrade<CONTRACT_NAME> \
186187
> cast wallet address --account <WALLET_NAME>
187188
> ```
188189
190+
#### Using multisig wallet (Our currrent approach with Gnosis Safe multisig)
191+
192+
To upgrade your Swan UUPS contract via a Gnosis multisig, follow these steps:
193+
194+
1. **Deploy the new implementation contract**
195+
Execute the deployment script to get the new implementation address:
196+
197+
```sh
198+
forge script ./script/Deploy.s.sol:DeploySwanImpl \
199+
--rpc-url <RPC_URL> \
200+
--account <WALLET_NAME> --broadcast \
201+
--sender <WALLET_ADDRESS> \
202+
--verify --verifier blockscout \
203+
--verifier-url <VERIFIER_URL>
204+
```
205+
206+
2. **Generate upgrade calldata**
207+
208+
Once you have the new implementation address, generate the calldata for the Gnosis multisig:
209+
210+
```sh
211+
cast calldata "upgradeTo(address)" 0xNewImplementationAddress
212+
```
213+
214+
This will output something like:
215+
```
216+
0x3659cfe6000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
217+
```
218+
219+
3. **Submit transaction to Gnosis Safe**
220+
221+
Create a new transaction in the Gnosis Safe interface with:
222+
- **To**: Your Swan proxy address
223+
- **Value**: 0 ETH
224+
- **Data**: The calldata generated in step 2
225+
226+
4. **Execute the transaction**
227+
228+
Have the required signers approve the transaction, then execute it to complete the upgrade.
229+
189230
## Testing & Diagnostics
190231

191232
Run tests on local network:

0 commit comments

Comments
 (0)