Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Update Hardhat config to prevent etherscan api key variables overwriting #177

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ module.exports = {

mocha: {
timeout: 100000
}
},

etherscan: {
apiKey: {}
},
};


Expand All @@ -88,22 +92,12 @@ for (let k in process.env) {
}

if (k === "ETHERSCAN_API_KEY") {
module.exports.etherscan = {
apiKey: {
// ethereum smart contract verification key
mainnet: process.env[k],
goerli: process.env[k]
}
}
module.exports.etherscan.apiKey.mainnet = process.env[k];
module.exports.etherscan.apiKey.goerli = process.env[k];
}

if (k === "POLYGONSCAN_API_KEY") {
module.exports.etherscan = {
apiKey: {
// polygon smart contract verification key
polygon: process.env[k],
polygonMumbai: process.env[k]
}
}
module.exports.etherscan.apiKey.polygon = process.env[k];
module.exports.etherscan.apiKey.polygonMumbai = process.env[k];
}
}