Skip to content

Commit

Permalink
Support Arbitrum One
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Feb 16, 2023
1 parent ec57fb8 commit 74c41ea
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ETHEREUM_PROVIDER_URL=
ETHEREUM_SEPOLIA_PROVIDER_URL=
ETHEREUM_ARBITRUM_ONE_PROVIDER_URL=
TENDERLY_FORK_ID=
TENDERLY_PROJECT=
TENDERLY_USERNAME=
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ artifacts
typechain-types

deployments/mainnet/solcInputs/*
deployments/arbitrum-one/solcInputs/*
deployments/sepolia/solcInputs/*
deployments/hardhat/*
deployments/tenderly/*
Expand Down
7 changes: 6 additions & 1 deletion data/NamedAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const sepolia = (address: string) => ({
[DeploymentNetwork.Sepolia]: address
});

const arbitrumOne = (address: string) => ({
[DeploymentNetwork.ArbitrumOne]: address
});

const TestNamedAccounts = {
ethWhale: {
...mainnet('0x00000000219ab540356cbb839cbe05303d7705fa'),
Expand All @@ -27,7 +31,8 @@ const TestNamedAccounts = {
export const NamedAccounts = {
deployer: {
...mainnet(deployer),
...sepolia(deployer)
...sepolia(deployer),
...arbitrumOne(deployer)
},

...TestNamedAccounts
Expand Down
1 change: 1 addition & 0 deletions deployments/arbitrum-one/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42161
10 changes: 8 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'solidity-coverage';
interface EnvOptions {
ETHEREUM_PROVIDER_URL?: string;
ETHEREUM_SEPOLIA_PROVIDER_URL?: string;
ETHEREUM_ARBITRUM_ONE_PROVIDER_URL?: string;
ETHERSCAN_API_KEY?: string;
PROFILE?: boolean;
TENDERLY_FORK_ID?: string;
Expand All @@ -27,6 +28,7 @@ interface EnvOptions {
const {
ETHEREUM_PROVIDER_URL = '',
ETHEREUM_SEPOLIA_PROVIDER_URL = '',
ETHEREUM_ARBITRUM_ONE_PROVIDER_URL = '',
ETHERSCAN_API_KEY,
PROFILE: isProfiling,
TENDERLY_FORK_ID = '',
Expand Down Expand Up @@ -71,14 +73,18 @@ const config: HardhatUserConfig = {
saveDeployments: true,
live: true
},

[DeploymentNetwork.Sepolia]: {
chainId: 11155111,
url: ETHEREUM_SEPOLIA_PROVIDER_URL,
saveDeployments: true,
live: true
},

[DeploymentNetwork.ArbitrumOne]: {
chainId: 42161,
url: ETHEREUM_ARBITRUM_ONE_PROVIDER_URL,
saveDeployments: true,
live: true
},
[DeploymentNetwork.Tenderly]: {
chainId: 1,
url: `https://rpc.tenderly.co/fork/${TENDERLY_FORK_ID}`,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"!/dist/typechain-types/contracts/tests/**/*",
"!/dist/typechain-types/factories/contracts/tests/**/*",
"/deployments/mainnet/**/*",
"/deployments/arbitrum-one/**/*",
"/deployments/sepolia/**/*"
],
"scripts": {
Expand All @@ -31,9 +32,11 @@
"deploy:prepare": "rm -rf ./node_modules && rm yarn.lock && yarn && yarn recompile",
"deploy:prepare:fork": "rm -rf deployments/tenderly && cp -rf deployments/mainnet/. deployments/tenderly",
"deploy:mainnet": "HARDHAT_NETWORK=mainnet hardhat deploy",
"deploy:arbitrum-one": "HARDHAT_NETWORK=arbitrum-one hardhat deploy",
"deploy:sepolia": "HARDHAT_NETWORK=sepolia hardhat deploy",
"deploy:fork": "yarn deploy:prepare:fork && HARDHAT_NETWORK=tenderly hardhat deploy",
"verify:mainnet": "HARDHAT_NETWORK=mainnet hardhat etherscan-verify --license MIT",
"verify:arbitrum-one": "HARDHAT_NETWORK=arbitrum-one hardhat etherscan-verify --license MIT",
"verify:sepolia": "HARDHAT_NETWORK=sepolia hardhat etherscan-verify --license MIT --api-url https://api-sepolia.etherscan.io/",
"lint": "yarn lint:sol && yarn lint:ts",
"lint:sol": "solhint --max-warnings 0 contracts/**/*.sol",
Expand Down
1 change: 1 addition & 0 deletions utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {

export enum DeploymentNetwork {
Mainnet = 'mainnet',
ArbitrumOne = 'arbitrum-one',
Sepolia = 'sepolia',
Hardhat = 'hardhat',
Tenderly = 'tenderly'
Expand Down

0 comments on commit 74c41ea

Please sign in to comment.