add env example, fix hardhat conf

This commit is contained in:
Ricardo Guilherme Schmidt 2023-07-25 01:49:59 -03:00
parent 79006d72ea
commit a84a7978a4
No known key found for this signature in database
GPG Key ID: 3F95A3AD0B607030
2 changed files with 32 additions and 11 deletions

9
.env.example Normal file
View File

@ -0,0 +1,9 @@
INFURA_API_KEY=""
ETHERSCAN_API_KEY=""
ETHERSCAN_OPT_API_KEY=""
GOERLI_MNEMONIC=""
MAINNET_MNEMONIC=""
GOERLI_ALCHEMY_KEY=""
OP_GOERLI_ALCHEMY_KEY=""

View File

@ -3,29 +3,41 @@ require("dotenv").config();
const INFURA_API_KEY = process.env.INFURA_API_KEY;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;
const ETHERSCAN_OPT_API_KEY = process.env.ETHERSCAN_OPT_API_KEY;
const MAINNET_PRIVATE_KEY = process.env.MAINNET_PRIVATE_KEY;
const GOERLI_PRIVATE_KEY = process.env.GOERLI_PRIVATE_KEY;
const OP_GOERLI_ALCHEMY_KEY = process.env.GOERLI_PRIVATE_KEY;
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.18",
networks: {
'optimism-goerli': {
chainId: 420,
url: `https://opt-goerli.g.alchemy.com/v2/${process.env.L2_ALCHEMY_KEY}`,
accounts: { mnemonic: process.env.MNEMONIC }
},
'optimism-mainnet': {
chainId: 10,
url: `https://opt-mainnet.g.alchemy.com/v2/${process.env.L2_ALCHEMY_KEY}`,
accounts: { mnemonic: process.env.MNEMONIC }
'mainnet': {
url: `https://goerli.infura.io/v3/${INFURA_API_KEY}`,
accounts: { mnemonic: process.env.MAINNET_MNEMONIC },
},
'goerli': {
url: `https://goerli.infura.io/v3/${INFURA_API_KEY}`,
accounts: [GOERLI_PRIVATE_KEY]
accounts: { mnemonic: process.env.GOERLI_MNEMONIC },
},
'optimism-goerli': {
chainId: 420,
url: `https://opt-goerli.g.alchemy.com/v2/${process.env.OP_GOERLI_ALCHEMY_KEY}`,
accounts: { mnemonic: process.env.GOERLI_MNEMONIC },
saveDeployments: true
},
'optimism-mainnet': {
chainId: 10,
url: `https://opt-mainnet.g.alchemy.com/v2/${process.env.MAINNET_ALCHEMY_KEY}`,
accounts: { mnemonic: process.env.MAINNET_MNEMONIC }
}
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
apiKey: {
mainnet: ETHERSCAN_API_KEY,
optimisticEthereum: ETHERSCAN_OPT_API_KEY,
optimisticGoerli: ETHERSCAN_OPT_API_KEY
}
},
mocha: {
timeout: 100000000,