Skip to content

Commit

Permalink
mainnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
d1ll0n committed Nov 24, 2020
1 parent 423ff95 commit 252c5d5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion buidler.config.js
Expand Up @@ -10,8 +10,14 @@ const { randomBytes } = require('crypto');
usePlugin("buidler-ethers-v5");
usePlugin("buidler-deploy");
usePlugin("solidity-coverage");
usePlugin("@nomiclabs/buidler-etherscan");

const keys = {
mainnet: fromPrivateKey(
process.env.MAINNET_PVT_KEY
? Buffer.from(process.env.MAINNET_PVT_KEY.slice(2), 'hex')
: randomBytes(32)
).getPrivateKeyString(),
rinkeby: fromPrivateKey(
process.env.RINKEBY_PVT_KEY
? Buffer.from(process.env.RINKEBY_PVT_KEY.slice(2), 'hex')
Expand All @@ -20,7 +26,6 @@ const keys = {

module.exports = {
etherscan: {
url: "https://api.etherscan.io/api",
apiKey: process.env.ETHERSCAN_API_KEY,
},
namedAccounts: {
Expand All @@ -40,6 +45,11 @@ module.exports = {
hostname: "localhost",
}),
},
mainnet: {
url: new InfuraProvider("mainnet", process.env.INFURA_PROJECT_ID).connection.url,
accounts: [keys.mainnet],
chainId: 1
},
rinkeby: {
url: new InfuraProvider("rinkeby", process.env.INFURA_PROJECT_ID).connection.url,
accounts: [keys.rinkeby],
Expand Down

0 comments on commit 252c5d5

Please sign in to comment.