@@ -2,9 +2,11 @@ require("dotenv").config();
2
2
require ( "@nomiclabs/hardhat-ethers" ) ;
3
3
require ( "@nomiclabs/hardhat-etherscan" ) ;
4
4
require ( "@nomiclabs/hardhat-waffle" ) ;
5
- require ( ' @openzeppelin/hardhat-upgrades' ) ;
5
+ require ( " @openzeppelin/hardhat-upgrades" ) ;
6
6
require ( "hardhat-gas-reporter" ) ;
7
7
require ( "solidity-coverage" ) ;
8
+ require ( "hardhat-contract-sizer" ) ;
9
+ require ( "hardhat-storage-layout" ) ;
8
10
9
11
// This is a sample Hardhat task. To learn how to create your own go to
10
12
// https://hardhat.org/guides/create-task.html
@@ -23,48 +25,78 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
23
25
* @type import('hardhat/config').HardhatUserConfig
24
26
*/
25
27
26
-
27
- /**
28
- * @type import('hardhat/config').HardhatUserConfig
29
- */
30
-
31
- require ( 'dotenv' ) . config ( ) ;
32
- require ( "@nomiclabs/hardhat-ethers" ) ;
33
-
34
- const { ETH_RINKEBY_API_URL , ETH_RINKEBY_PRIVATE_KEY , ETH_MAINNET_API_URL , ETH_MAINNET_PRIVATE_KEY , ETHERSCAN_API_KEY } = process . env ;
28
+ const {
29
+ GOERLI_URL ,
30
+ MUMBAI_URL ,
31
+ PRIVATE_KEY ,
32
+ MAINNET_URL ,
33
+ POLYGON_URL ,
34
+ ETHERSCAN_API_KEY ,
35
+ POLYGONSCAN_API_KEY ,
36
+ } = process . env ;
35
37
36
38
module . exports = {
37
39
solidity : {
38
- version : "0.8.10" ,
40
+ compilers : [
41
+ {
42
+ version : "0.6.6" ,
43
+ } ,
44
+ {
45
+ version : "0.8.10" ,
46
+ } ,
47
+ ] ,
39
48
settings : {
40
49
optimizer : {
41
50
enabled : true ,
42
- runs : 200
43
- }
44
- }
45
- } ,
46
- defaultNetwork : "rinkeby" ,
47
- networks : {
48
- hardhat : { } ,
49
- eth_rinkeby : {
50
- url : ETH_RINKEBY_API_URL ,
51
- gas : 4000000 ,
52
- accounts : [ `0x${ ETH_RINKEBY_PRIVATE_KEY } ` ]
51
+ runs : 200 ,
52
+ } ,
53
+ outputSelection : {
54
+ "*" : {
55
+ "*" : [ "storageLayout" ] ,
56
+ } ,
53
57
} ,
54
- eth_mainnet : {
55
- url : ETH_MAINNET_API_URL ,
56
- gasPrice : 140000000000 ,
57
- gas : 3800000 ,
58
- accounts : [ `0x${ ETH_MAINNET_PRIVATE_KEY } ` ]
59
- }
60
- } ,
61
- etherscan : {
62
- apiKey : ETHERSCAN_API_KEY ,
58
+ } ,
59
+ } ,
60
+ defaultNetwork : "hardhat" ,
61
+ networks : {
62
+ hardhat : {
63
+ allowUnlimitedContractSize : true ,
64
+ } ,
65
+ goerli : {
66
+ url : GOERLI_URL || "" ,
67
+ accounts : PRIVATE_KEY !== undefined ? [ `0x${ PRIVATE_KEY } ` ] : [ ] ,
68
+ allowUnlimitedContractSize : true ,
69
+ } ,
70
+ mumbai : {
71
+ url : MUMBAI_URL || "" ,
72
+ accounts : PRIVATE_KEY !== undefined ? [ `0x${ PRIVATE_KEY } ` ] : [ ] ,
73
+ } ,
74
+ mainnet : {
75
+ url : MAINNET_URL || "" ,
76
+ gasPrice : 70000000000 ,
77
+ gas : 3400000 ,
78
+ accounts : PRIVATE_KEY !== undefined ? [ `0x${ PRIVATE_KEY } ` ] : [ ] ,
79
+ } ,
80
+ polygon : {
81
+ url : POLYGON_URL || "" ,
82
+ accounts : PRIVATE_KEY !== undefined ? [ `0x${ PRIVATE_KEY } ` ] : [ ] ,
83
+ } ,
84
+ } ,
85
+ etherscan : {
86
+ apiKey : POLYGONSCAN_API_KEY ,
87
+ } ,
88
+ contractSizer : {
89
+ alphaSort : true ,
90
+ runOnCompile : process . env . CONTRACT_SIZER !== undefined ,
91
+ disambiguatePaths : false ,
63
92
} ,
64
93
paths : {
65
94
sources : "./contracts" ,
66
95
tests : "./test" ,
67
96
cache : "./cache" ,
68
- artifacts : "./artifacts"
97
+ artifacts : "./artifacts" ,
98
+ } ,
99
+ gasReporter : {
100
+ enabled : ! ! process . env . REPORT_GAS ,
69
101
} ,
70
- }
102
+ } ;
0 commit comments