Skip to content

Commit

Permalink
add optimism network to hardhat config
Browse files Browse the repository at this point in the history
  • Loading branch information
agusduha committed Oct 23, 2023
1 parent 474a606 commit 7b73a82
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ registerAction(require("cannon-plugin-router"));

dotenv.config();

const alchemyKey = process.env.ALCHEMY_API_KEY as string;

function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
Expand Down Expand Up @@ -76,18 +78,28 @@ const config: HardhatUserConfig = {
accounts: [process.env.DEPLOYER_PRIVATE_KEY as string],
},
polygon: {
url: process.env.RPC_POLYGON as string,
url: `https://polygon-mainnet.g.alchemy.com/v2/${alchemyKey}`,
chainId: 137,
accounts: [process.env.DEPLOYER_PRIVATE_KEY as string],
},
optimismGoerli: {
url: `https://opt-goerli.g.alchemy.com/v2/${alchemyKey}`,
chainId: 420,
accounts: [process.env.DEPLOYER_PRIVATE_KEY as string],
},
optimism: {
url: `https://opt-mainnet.g.alchemy.com/v2/${alchemyKey}`,
chainId: 10,
accounts: [process.env.DEPLOYER_PRIVATE_KEY as string],
},
},

gasReporter: {
enabled: true,
currency: "USD",
coinmarketcap: process.env.COINMARKETCAP_API_KEY as string,
token: "MATIC",
gasPrice: 300,
token: "ETH",
gasPrice: 1,
},

cannon: {
Expand All @@ -98,6 +110,8 @@ const config: HardhatUserConfig = {
apiKey: {
polygon: process.env.POLYGON_ETHERSCAN_API_KEY as string,
polygonMumbai: process.env.POLYGON_ETHERSCAN_API_KEY as string,
optimisticGoerli: process.env.OPTIMISTIC_ETHERSCAN_API_KEY as string,
optimisticEthereum: process.env.OPTIMISTIC_ETHERSCAN_API_KEY as string,
},
},

Expand Down

0 comments on commit 7b73a82

Please sign in to comment.