From b435b61604e87336335e97661802e3cb3c69357d Mon Sep 17 00:00:00 2001 From: wshino Date: Tue, 22 Oct 2024 20:14:58 +0700 Subject: [PATCH] Add doc for emergency --- docs/emergency.md | 43 ++++++++++++++++++++++++++++++++++++ packages/contracts/README.md | 5 +++++ 2 files changed, 48 insertions(+) create mode 100644 docs/emergency.md diff --git a/docs/emergency.md b/docs/emergency.md new file mode 100644 index 00000000..2474d44c --- /dev/null +++ b/docs/emergency.md @@ -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. diff --git a/packages/contracts/README.md b/packages/contracts/README.md index ea2d8167..619a6c01 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -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). \ No newline at end of file