forked from bosonprotocol/boson-protocol-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
115 lines (107 loc) · 3.56 KB
/
hardhat.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const dotEnvConfig = require("dotenv");
dotEnvConfig.config();
const environments = require("./environments");
const { task } = require("hardhat/config");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-web3");
require("hardhat-contract-sizer");
require("hardhat-gas-reporter");
require("solidity-coverage");
const lazyImport = async (module) => {
return await require(module);
};
task("deploy-mock-nft-auth", "Deploy mock NFT Auth tokens and mint tokens to addresses").setAction(async () => {
const { deployAndMintMockNFTAuthTokens } = await lazyImport("./scripts/util/deploy-mock-tokens");
await deployAndMintMockNFTAuthTokens();
});
task("estimate-limits", "Estimates the maximum values for limits in protocol config").setAction(async () => {
const { estimateLimits } = await lazyImport("./scripts/util/estimate-limits");
await estimateLimits();
});
task("create-dispute-resolver", "Creates and activates a dispute resolver")
.addParam("path", "The path to the dispute resolver json file")
.addFlag("createOnly", "Only create the dispute resolver")
.addFlag("activateOnly", "Only activate the dispute resolver")
.setAction(async ({ path, createOnly, activateOnly }) => {
const { createAndActivateDR } = await lazyImport("./scripts/util/create-and-activate-DR");
await createAndActivateDR(path, createOnly, activateOnly);
});
task("verify-suite", "Verify contracts on the block explorer")
.addParam("chainId", "The chain id of the deployed contract address file")
.addParam("env", "The environment of the contract address file")
.setAction(async ({ chainId, env }) => {
const { verifySuite } = await lazyImport("./scripts/util/verify-suite");
// Contract list filter - empty array or use values from the name field of the contract object
const filter = [];
await verifySuite(chainId, env, filter);
});
module.exports = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
accounts: { mnemonic: environments.hardhat.mnemonic },
gas: environments.hardhat.gasLimit,
},
localhost: {
url: environments.localhost.txNode || "http://127.0.0.1:8545",
accounts: environments.hardhat.mnemonic
? { mnemonic: environments.hardhat.mnemonic }
: environments.localhost.keys,
gas: environments.localhost.gasLimit,
},
test: {
url: environments.test.txNode,
accounts: environments.test.keys,
gas: environments.test.gasLimit,
},
mainnet: {
url: environments.mainnet.txNode,
accounts: environments.mainnet.keys,
gas: environments.mainnet.gasLimit,
},
mumbai: {
url: environments.mumbai.txNode,
accounts: environments.mumbai.keys,
gas: environments.mumbai.gasLimit,
},
polygon: {
url: environments.polygon.txNode,
accounts: environments.polygon.keys,
gas: environments.polygon.gasLimit,
},
},
etherscan: {
apiKey: {
mainnet: environments.etherscan.apiKey,
polygonMumbai: environments.polygonscan.apiKey,
polygon: environments.polygonscan.apiKey,
},
},
solidity: {
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: true,
},
},
},
},
gasReporter: {
currency: "USD",
enabled: true,
gasPrice: 300,
coinmarketcap: environments.coinmarketcap.apiKey,
showTimeSpent: true,
showMethodSig: false,
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
};