Skip to content

Commit

Permalink
add etherscan config for hardhat, update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ps1dr3x committed Aug 30, 2024
1 parent 3571b5d commit dd72e18
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 9 deletions.
17 changes: 15 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
GNOSIS_SAFE_ADDRESS=""
MNEMONIC=""
SAFE_SERVICE_URL="https://safe-transaction-arbitrum.safe.global"
UNICROW_FEE=69

ETHERSCAN_API_KEY=""
ARBISCAN_API_KEY=""

GNOSIS_SAFE_ADDRESS=""

# Arbitrum One
SAFE_SERVICE_URL="https://safe-transaction-arbitrum.safe.global"

# Sepolia
# SAFE_SERVICE_URL="https://safe-transaction-sepolia.safe.global"

# Arbitrum Sepolia
# Safe is not available on Arbitrum Sepolia (at the time of writing), only direct deployment can be used
# SAFE_SERVICE_URL=""
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ Setup environment variables:
cp .env.example .env
```

| KEY | VALUE |
|---------------------|--------------------------------------------------|
| GNOSIS_SAFE_ADDRESS | Governance address multisig |
| MNEMONIC | Account of one of the Gnosis Safe owners |
| SAFE_SERVICE_URL | Gnosis safe service url (to submit tx proposals) |
| UNICROW_FEE | Unicrow fee (in bips) |
| KEY | VALUE |
|---------------------|---------------------------------------------------------|
| GNOSIS_SAFE_ADDRESS | Governance/fees address (can also be a normal address) |
| MNEMONIC | Mnemonic of the wallet to be used for deployments |
| SAFE_SERVICE_URL | Gnosis safe service url (to submit tx proposals) |
| UNICROW_FEE | Unicrow fee (in bips) |
| ETHERSCAN_API_KEY | Only used for contract verification |
| ARBISCAN_API_KEY | Only used for contract verification |

Deploy the Unicrow contracts (directly) on your local node:

Expand Down
42 changes: 41 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import dotenv from "dotenv";

dotenv.config();

const { MNEMONIC, MNEMONIC_PATH, SAFE_SERVICE_URL, GNOSIS_SAFE_ADDRESS } = process.env;
const {
MNEMONIC,
MNEMONIC_PATH,
SAFE_SERVICE_URL,
GNOSIS_SAFE_ADDRESS,
ETHERSCAN_API_KEY,
ARBISCAN_API_KEY
} = process.env;

setupSafeDeployer(
Wallet.fromMnemonic(MNEMONIC!!, MNEMONIC_PATH),
Expand Down Expand Up @@ -78,6 +85,39 @@ const userConfig: HardhatUserConfig = {
chainId: 42161
}
},
etherscan: {
apiKey: {
sepolia: ETHERSCAN_API_KEY!!,
arbitrumSepolia: ARBISCAN_API_KEY!!,
arbitrum: ARBISCAN_API_KEY!!,
},
customChains: [
{
network: "sepolia",
chainId: 11155111,
urls: {
apiURL: "https://api-sepolia.etherscan.io/api",
browserURL: "https://sepolia.etherscan.io"
}
},
{
network: "arbitrumSepolia",
chainId: 421614,
urls: {
apiURL: "https://api-sepolia.arbiscan.io/api",
browserURL: "https://sepolia.arbiscan.io/"
}
},
{
network: "arbitrum",
chainId: 42161,
urls: {
apiURL: "https://api.arbiscan.io/api",
browserURL: "https://arbiscan.io/"
}
},
]
},
namedAccounts: {
deployer: GNOSIS_SAFE_ADDRESS!!,
},
Expand Down

0 comments on commit dd72e18

Please sign in to comment.