From 09571cd9be51a31e9e82f284954acb2ddb014859 Mon Sep 17 00:00:00 2001 From: Erhan Tezcan Date: Tue, 21 Jan 2025 13:22:07 +0300 Subject: [PATCH] fix verificaiton command doc --- .env.example | 3 ++- README.md | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 5c1c86b..6af4200 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ # API KEY (REQUIRED FOR CONTRACT VERIFICATION) -ETHERSCAN_API_KEY=CHANGE_ME +ETHERSCAN_API_KEY_BASE=CHANGE_ME +ETHERSCAN_API_KEY_BASE_SEPOLIA=CHANGE_ME diff --git a/README.md b/README.md index 7bf7c03..4c58cbd 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ forge inspect abi > ./deployments/abis/.json Verification requires the following values, based on which provider you are using: - **Provider**: can accept any of `etherscan`, `blockscout`, `sourcify`, `oklink` or `custom` for more fine-grained stuff. -- **URL**: based on the chosen provider, we require its URL as well, e.g. `https://base-sepolia.blockscout.com/api/` for `blockscout` on Base Sepolia +- **URL**: based on the chosen provider, its URL, e.g. `https://base-sepolia.blockscout.com/api/` for `blockscout` on Base Sepolia - **API Key**: an API key from the chosen provider, must be stored as `ETHERSCAN_API_KEY` in environment no matter whicih provider it is!. You can actually verify the contract during deployment by adding the verification arguments as well: @@ -149,16 +149,20 @@ forge script ./script/Deploy.s.sol:Deploy \ --account \ --broadcast \ --verify --verifier blockscout \ ---verifier-url +--verifier-url \ +--chain-id 8453 ``` -Alternatively, you can verify an existing contract (perhaps deployed from a factory) with: +Alternatively, you can verify an existing contract (perhaps deployed from a factory) with the following command: ```sh forge verify-contract ./src/.sol: \ ---verifier blockscout --verifier-url +--verifier blockscout --verifier-url \ +--etherscan-api-key --chain-id 8453 ``` +The chain ID is 8453 for Base Mainnet, and 84532 for Base Sepolia. + ### Upgrade Contract Upgrading an existing contract is done as per the instructions in [openzeppelin-foundry-upgrades](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades) repository.