Skip to content

Commit

Permalink
Add doc for emergency
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Oct 22, 2024
1 parent fe9c5d8 commit b435b61
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/emergency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Emergency Response

Sometimes, we need to fix problems in our smart contracts. We can do this by upgrading contracts that use ERC1967Proxy. Here's how to do it:

## Upgrading the Verifier

1. Change the code in this file:
`packages/contracts/src/utils/Verifier.sol`

2. Add this to your `.env` file:
```
VERIFIER={DEPLOYED_VERIFIER_PROXY_ADDRESS}
```

3. Run this command:
```
source .env
forge script script/Upgrades.s.sol:Upgrades --rpc-url $RPC_URL --chain-id $CHAIN_ID --etherscan-api-key $ETHERSCAN_API_KEY --broadcast --verify -vvvv
```

## Upgrading Other Contracts

You can also upgrade ECDSAOwnedDKIMRegistry and UserOverrideableDKIMRegistry:

### For ECDSAOwnedDKIMRegistry:
1. Change the code in:
`packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol`

2. Add to `.env`:
```
ECDSA_DKIM={DEPLOYED_ECDSA_DKIM_PROXY_ADDRESS}
```

### For UserOverrideableDKIMRegistry:
1. Change the code in:
`@zk-email/contracts/UserOverrideableDKIMRegistry.sol`

2. Add to `.env`:
```
DKIM={DEPLOYED_USEROVERRIDEABLE_DKIM_PROXY_ADDRESS}
```

Remember to be careful when changing these contracts. Always test your changes before using them.
5 changes: 5 additions & 0 deletions packages/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,8 @@ Second just run the following commands with `--zksync`
source .env
forge script script/DeployRecoveryControllerZKSync.s.sol:Deploy --zksync --rpc-url $RPC_URL --broadcast --slow --via-ir --system-mode true -vvvv
```


## Emergency Response

For information on how to handle emergency situations and upgrade contracts, please refer to our [Emergency Response Guide](../../docs/emergency.md).

0 comments on commit b435b61

Please sign in to comment.