11import { task , HardhatUserConfig } from "hardhat/config" ;
22import "@nomiclabs/hardhat-waffle" ;
3+ import "@nomiclabs/hardhat-etherscan" ;
34
45// This is a sample Hardhat task. To learn how to create your own go to
56// https://hardhat.org/guides/create-task.html
@@ -12,22 +13,47 @@ task("accounts", "Prints the list of accounts", async () => {
1213 }
1314} ) ;
1415
16+ const ROPSTEN_PRIVATE_KEY = process . env . ROPSTEN_PRIVATE_KEY ;
17+ const ROPSTEN_ALCHEMY_API_KEY = process . env . ROPSTEN_ALCHEMY_API_KEY ;
18+
19+ const MUMBAI_PRIVATE_KEY = process . env . MUMBAI_PRIVATE_KEY ;
20+ const MUMBAI_ALCHEMY_API_KEY = process . env . MUMBAI_ALCHEMY_API_KEY ;
21+
22+ const ETHERSCAN_API_KEY = process . env . ETHERSCAN_API_KEY ;
23+ const POLYGONSCAN_API_KEY = process . env . POLYGONSCAN_API_KEY ;
24+
1525// You need to export an object to set up your config
1626// Go to https://hardhat.org/config/ to learn more
17-
18- /**
19- * @type import('hardhat/config').HardhatUserConfig
20- */
2127const config : HardhatUserConfig = {
2228 solidity : {
2329 version : "0.8.9" ,
2430 settings : {
2531 optimizer : {
2632 enabled : true ,
27- runs : 1000 ,
33+ runs : 200 ,
2834 } ,
2935 } ,
3036 } ,
37+ networks : {
38+ ropsten : {
39+ url : `https://eth-ropsten.alchemyapi.io/v2/${ ROPSTEN_ALCHEMY_API_KEY } ` ,
40+ accounts : [ ROPSTEN_PRIVATE_KEY ] ,
41+ } ,
42+ mumbai : {
43+ url : `https://polygon-mumbai.g.alchemy.com/v2/${ MUMBAI_ALCHEMY_API_KEY } ` ,
44+ accounts : [ MUMBAI_PRIVATE_KEY ] ,
45+ } ,
46+ } ,
47+ etherscan : {
48+ apiKey : {
49+ // Ethereum
50+ mainnet : ETHERSCAN_API_KEY ,
51+ ropsten : ETHERSCAN_API_KEY ,
52+ // polygon
53+ polygon : POLYGONSCAN_API_KEY ,
54+ polygonMumbai : POLYGONSCAN_API_KEY ,
55+ } ,
56+ } ,
3157} ;
3258
3359export default config ;
0 commit comments