Skip to content

Commit

Permalink
multi-chain-scripts initial setup (#111)
Browse files Browse the repository at this point in the history
* multi-chain-scripts initial setup

* chore: clean up hardhat config
  • Loading branch information
scolear authored Sep 12, 2024
1 parent e492ae9 commit 4926e8b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
21 changes: 16 additions & 5 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ require('@openzeppelin/hardhat-upgrades');
require('@nomiclabs/hardhat-solhint');
require('dotenv').config();

const arbitrumURL = process.env.ARB_NODE_ADDR ?? 'https://arb1.arbitrum.io/rpc';
const mainnetURL =
process.env.MAINNET_NODE_ADDR ??
`https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const sepoliaURL =
process.env.SEPOLIA_NODE_ADDR ??
`https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const arbitrumURL =
process.env.ARB_NODE_ADDR ??
`https://arb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const arbSepoliaURL =
process.env.ARB_SEPOLIA_NODE_ADDR ??
'https://sepolia-rollup.arbitrum.io/rpc';
`https://arb-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const baseURL =
process.env.BASE_NODE_ADDR ??
`https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const baseSepoliaURL =
process.env.BASE_SEPOLIA_NODE_ADDR ??
`https://base-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;
const optimismURL =
process.env.OPTIMISM_NODE_ADDR ??
`https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`;

const deployerKey = process.env.SCRIPT_KEY ?? process.env.KEY;
module.exports = {
Expand All @@ -36,12 +47,12 @@ module.exports = {
gasPrice: 0x01,
},
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
url: mainnetURL,
chainId: 1,
accounts: [deployerKey],
},
sepolia: {
url: `https://sepolia.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
url: sepoliaURL,
chainId: 11155111,
accounts: [deployerKey],
},
Expand All @@ -61,7 +72,7 @@ module.exports = {
accounts: [deployerKey],
},
optimism: {
url: `https://optimism-mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
url: optimismURL,
chainId: 10,
accounts: [deployerKey],
},
Expand Down
15 changes: 15 additions & 0 deletions scripts/helpers/mainnet-call-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Check if the command line argument is provided
if [ $# -eq 0 ]; then
echo "Please provide a command argument."
exit 1
fi

# Assign the command line argument to a variable
command=$1
extra_args="${@:2}"

HARDHAT_NETWORK=base dlc-link-eth $command $extra_args
HARDHAT_NETWORK=arbitrum dlc-link-eth $command $extra_args
HARDHAT_NETWORK=mainnet dlc-link-eth $command $extra_args
2 changes: 2 additions & 0 deletions scripts/helpers/new-chain-setup-mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dlc-link-eth add-signer 0x2b16469227cd34F591D455aC81Ca8a1A4bA69F02 # LinkPool
dlc-link-eth add-signer 0x5db792d5facb35e9adce8a151e8a3d0d36c9cb77 # HashKey
dlc-link-eth add-signer 0x194c697e8343EaB3C53917BA7e597d02687f8BA0 # Despread
dlc-link-eth add-signer 0xdf4d8B54dE476B674f1832B95984fFa7e223d47B # PierTwo
dlc-link-eth add-signer 0xAFBc5Dde8a3fEc5234600Ed7fCA541609F3Ed23C # ValidationCloud

dlc-link-eth set-attestor-gpk 'xpub6C1F2SwADP3TNajQjg2PaniEGpZLvWdMiFP8ChPjQBRWD1XUBeMdE4YkQYvnNhAYGoZKfcQbsRCefserB5DyJM7R9VR6ce6vLrXHVfeqyH3'

Expand All @@ -34,3 +35,4 @@ dlc-link-eth whitelist-account 0xf92893654e38b80dfd9b4a2fb99100dd31ba5e2d # Ambe
dlc-link-eth whitelist-account 0xff200709bf9bbc5209ba4b5dd767913a8a06b73f # Amber
dlc-link-eth whitelist-account 0x46166fA874AAEDEA8d98b15F9A72C84e22Abe2A1 # SBL
dlc-link-eth whitelist-account 0x14Ee510Ebd4E5273e83Ad88f6cd2dc228BE40D12 # Tokkalabs
dlc-link-eth whitelist-account 0xFc62319bCdfeDB6e55295F3723005593b16A3f9c # Garden

0 comments on commit 4926e8b

Please sign in to comment.