Skip to content

Commit

Permalink
feature (AM-4795): Add Arbitrum/Base Testnets as Custom Networks (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMora89 authored Aug 16, 2024
1 parent 91e2db0 commit 1f2c0b3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ HOLESKY_NODE=""
MAINNET_NODE=""
POLYGON_NODE=""
SEPOLIA_NODE=""
ARBITRUMTESTNET_NODE=""
BASETESTNET_NODE=""

ETHERSCAN_API_KEY=""
POLYGONSCAN_API_KEY=""
ARBISCAN_API_KEY=""
BASESCAN_API_KEY=""

COINMARKETCAP_API_KEY=""

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ env:
POLYGON_NODE: ${{ secrets.POLYGON_NODE }}
HOLESKY_NODE: ${{ secrets.HOLESKY_NODE }}
SEPOLIA_NODE: ${{ secrets.SEPOLIA_NODE }}
ARBITRUMTESTNET_NODE: ${{ secrets.ARBITRUMTESTNET_NODE }}
BASETESTNET_NODE: ${{ secrets.BASETESTNET_NODE }}

ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
PRIVATE_KEY: ${{ secrets.DUMMY_PK }}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ env:
POLYGON_NODE: ${{ secrets.POLYGON_NODE }}
HOLESKY_NODE: ${{ secrets.HOLESKY_NODE }}
SEPOLIA_NODE: ${{ secrets.SEPOLIA_NODE }}
ARBITRUMTESTNET_NODE: ${{ secrets.ARBITRUMTESTNET_NODE }}
BASETESTNET_NODE: ${{ secrets.BASETESTNET_NODE }}

ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
PRIVATE_KEY: ${{ secrets.DUMMY_PK }}

Expand Down
31 changes: 30 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ module.exports = {
url: process.env.SEPOLIA_NODE,
accounts: [process.env.PRIVATE_KEY],
chainId: 11155111
},
arbitrumTestnet: {
url: process.env.ARBITRUMTESTNET_NODE,
accounts: [process.env.PRIVATE_KEY],
chainId: 421614
},
baseTestnet: {
url: process.env.BASETESTNET_NODE,
accounts: [process.env.PRIVATE_KEY],
chainId: 84532
}
},
solidity: {
Expand All @@ -57,7 +67,9 @@ module.exports = {
mainnet: process.env.ETHERSCAN_API_KEY,
holesky: process.env.ETHERSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY
sepolia: process.env.ETHERSCAN_API_KEY,
arbitrumTestnet: process.env.ARBISCAN_API_KEY,
baseTestnet: process.env.BASESCAN_API_KEY
},
customChains: [
{
Expand All @@ -67,6 +79,22 @@ module.exports = {
apiURL: 'https://api-holesky.etherscan.io/api',
browserURL: 'https://holesky.etherscan.io'
}
},
{
network: 'arbitrumTestnet',
chainId: 421614,
urls: {
apiURL: 'https://api-sepolia.arbiscan.io/api',
browserURL: 'https://sepolia.arbiscan.io/'
}
},
{
network: 'baseTestnet',
chainId: 84532,
urls: {
apiURL: 'https://api-sepolia.basescan.org/api',
browserURL: 'https://sepolia.basescan.org/'
}
}
]
},
Expand All @@ -80,3 +108,4 @@ module.exports = {
token: 'ETH'
}
}

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"verify:polygon": "npx hardhat run scripts/2_verify_contracts.js --network polygon",
"deploy:sepolia": "npx hardhat run scripts/1_deploy_contracts.js --network sepolia",
"verify:sepolia": "npx hardhat run scripts/2_verify_contracts.js --network sepolia",
"deploy:arbitrumTestnet": "npx hardhat run scripts/1_deploy_contracts.js --network arbitrumTestnet",
"verify:arbitrumTestnet": "npx hardhat run scripts/2_verify_contracts.js --network arbitrumTestnet",
"deploy:baseTestnet": "npx hardhat run scripts/1_deploy_contracts.js --network baseTestnet",
"verify:baseTestnet": "npx hardhat run scripts/2_verify_contracts.js --network baseTestnet",
"test": "npx hardhat test",
"lint:js": "npx eslint .",
"lint:js:fix": "npx eslint . --fix",
Expand Down

0 comments on commit 1f2c0b3

Please sign in to comment.