Skip to content

Commit

Permalink
feat(scratch): add holesky network setup
Browse files Browse the repository at this point in the history
  • Loading branch information
arwer13 committed Oct 2, 2023
1 parent 352ba49 commit dd9b7d1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
30 changes: 30 additions & 0 deletions dao-holesky-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -e +u
set -o pipefail

if [[ -z "$DEPLOYER" ]]; then
echo "Must set DEPLOYER env variable" 1>&2
exit 1
fi
if [[ -z "$RPC_URL" ]]; then
echo "Must set RPC_URL env variable" 1>&2
exit 1
fi
if [[ -z "$GATE_SEAL" ]]; then
echo "Must set GATE_SEAL env variable" 1>&2
exit 1
fi

export NETWORK=holesky
export NETWORK_STATE_FILE="deployed-${NETWORK}.json"
export NETWORK_STATE_DEFAULTS_FILE="deployed-testnet-defaults.json"

# Holesky params: https://github.com/eth-clients/holesky/blob/main/README.md
export GENESIS_TIME=1695902400
export DEPOSIT_CONTRACT=0x4242424242424242424242424242424242424242
export CHAIN_ID=17000

export GAS_PRIORITY_FEE="${GAS_PRIORITY_FEE:=1}"
export GAS_MAX_FEE="${GAS_MAX_FEE:=100}"

bash dao-deploy.sh
32 changes: 26 additions & 6 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const accounts = readJson(`./accounts.json`) || {
const getNetConfig = (networkName, ethAccountName) => {
const netState = readJson(`./deployed-${networkName}.json`) || {}
const ethAccts = accounts.eth || {}

if (RPC_URL === undefined && networkName !== 'hardhat') {
console.error('ERROR: RPC_URL env variable is not set')
process.exit(1)
}

const base = {
accounts:
ethAccountName === 'remote'
Expand Down Expand Up @@ -87,9 +93,15 @@ const getNetConfig = (networkName, ethAccountName) => {
chainId: 5,
timeout: 60000 * 15,
},
holesky: {
...base,
url: RPC_URL,
chainId: 17000,
timeout: 60000 * 15,
},
mainnet: {
...base,
url: 'https://mainnet.infura.io/v3/' + accounts.infura.projectId,
url: RPC_URL,
chainId: 1,
timeout: 60000 * 10,
},
Expand All @@ -98,7 +110,7 @@ const getNetConfig = (networkName, ethAccountName) => {
chainId: 1,
timeout: 60000 * 10,
forking: {
url: 'https://mainnet.infura.io/v3/' + accounts.infura.projectId,
url: RPC_URL,
// url: 'https://eth-mainnet.alchemyapi.io/v2/' + accounts.alchemy.apiKey
},
},
Expand Down Expand Up @@ -182,10 +194,18 @@ module.exports = {
enabled: !!process.env.REPORT_GAS,
currency: 'USD',
},
etherscan: accounts.etherscan,
aragon: {
ipfsApi: process.env.IPFS_API_URL || 'https://ipfs.infura.io:5001/api/v0',
ipfsGateway: process.env.IPFS_GATEWAY_URL || 'https://ipfs.io/',
etherscan: {
apiKey: accounts.etherscan.apiKey,
customChains: [
{
network: 'holesky',
chainId: 17000,
urls: {
apiURL: 'https://api-holesky.etherscan.io/api',
browserURL: 'https://holesky.etherscan.io',
},
},
],
},
ipfs: {
url: process.env.IPFS_API_URL || 'https://ipfs.infura.io:5001/api/v0',
Expand Down

0 comments on commit dd9b7d1

Please sign in to comment.