diff --git a/v2/scripts/deploy/readme.md b/v2/scripts/deploy/readme.md index f092c433..1ba46d4f 100644 --- a/v2/scripts/deploy/readme.md +++ b/v2/scripts/deploy/readme.md @@ -84,6 +84,61 @@ forge script scripts/deploy/deterministic/DeployGatewayZEVM.s.sol \ --broadcast ``` +## Deploying protocol contracts implementation for upgrades + +Protocol contracts (Gateway and ERC20Custody) follow ERC1967 standard. The contracts can be upgraded by deploying a new implementation and upgrading to this new implementation. + +The implementation contracts don't require environment variables or paramters to be deployed. + +**GatewayEVM** + +Deploy a wew implementation of the GatewayEVM: + +``` +forge script scripts/deploy/deterministic/DeployGatewayEVMImplementation.s.sol \ + --private-key \ + --rpc-url \ + --verify \ + --etherscan-api-key \ + --chain-id \ + --broadcast +``` + +**ERC20Custody** + +Deploy a wew implementation of the ERC20Custody: + +``` +forge script scripts/deploy/deterministic/DeployERC20CustodyImplementation.s.sol \ + --private-key \ + --rpc-url \ + --verify \ + --etherscan-api-key \ + --chain-id \ + --broadcast +``` + +**GatewayZEVM** + +Deploy a wew implementation of the GatewayZEVM: + +``` +forge script scripts/deploy/deterministic/DeployGatewayZEVMImplementation.s.sol \ + --private-key \ + --rpc-url \ + --verify \ + --verifier blockscout \ + --verifier-url \ + --chain-id \ + --broadcast +``` + +After the implementation is deployed, the contract can be upgraded by calling the following function from the admin: + +``` +upgradeToAndCall(0, , "") +``` + ## Deploying a ZRC20 reference contract ZRC20 contract is upgradable by the protocol but doesn't follow the `ERC1967Proxy` standard.