-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
147 lines (143 loc) · 3.66 KB
/
hardhat.config.ts
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
require("dotenv").config();
// import 'tsconfig-paths/register';
/*
This module is related to the feature, path mapping, for TypeScript(in this case ts-node).
Path mapping causes lots of annoying and we should stop using this.
*/
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-web3";
import "hardhat-tracer";
import "@nomiclabs/hardhat-solhint";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import "@typechain/hardhat";
import "hardhat-abi-exporter";
import "hardhat-contract-sizer";
import "@openzeppelin/hardhat-upgrades";
import "@openzeppelin/hardhat-defender";
// TODO
// make a defender multisig on goerli 0x585876db533ab88A66847891054f2bf78BCcabcA
// deploy contracts to goerli
// get API keys of infura, etherscan, and archemy
// set it to hardhat.config.ts
// transfer ownership to multisig wallet (How can we do acceptOwnership?)
// set that address to .env to tell upgrade sript to use defender or not
// propose upgrade
// see verification result
if (!process.env.ALCHEMY_URL) throw Error("Get your .env");
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
compilers: [
{
version: "0.8.4",
settings: {
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
optimizer: {
enabled: true,
runs: 1000,
},
},
},
],
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
accounts: {
count: 200,
accountsBalance: "1000000000000000000000000",
},
},
localhost: {
url: "http://127.0.0.1:8545",
},
mainnet: {
url: process.env.ALCHEMY_URL,
accounts: [
process.env.FOUNDATION_PRIVATE_KEY,
process.env.DEPLOYER_PRIVATE_KEY,
],
live: true,
saveDeployments: true,
},
goerli: {
url: process.env.ALCHEMY_URL.replace(/mainnet/, "goerli"),
accounts: [
process.env.FOUNDATION_PRIVATE_KEY,
process.env.DEPLOYER_PRIVATE_KEY,
],
live: true,
saveDeployments: true,
tags: ["staging"],
},
sepolia: {
url: process.env.ALCHEMY_URL.replace(/mainnet/, "sepolia"),
accounts: [
process.env.FOUNDATION_PRIVATE_KEY,
process.env.DEPLOYER_PRIVATE_KEY,
],
live: true,
saveDeployments: true,
tags: ["staging"],
},
},
ovm: {
solcVersion: "0.7.6",
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [],
},
namedAccounts: {
foundation: {
default: 1,
mainnet: "0xdAe503Fd260358b8f344D136160c299530006170",
goerli: "0xdAe503Fd260358b8f344D136160c299530006170",
},
deployer: {
default: 2,
mainnet: "0xD2dd063B77cdB7b2823297a305195128eF2C300c",
goerli: "0xD2dd063B77cdB7b2823297a305195128eF2C300c",
},
},
abiExporter: {
path: "./abis/yamato-abis",
clear: true,
flat: true,
except: ["Dependencies", "Interfaces", "mock"],
spacing: 2,
},
mocha: {
timeout: 1200000,
forbidOnly: process.env.NODE_ENV === "ci",
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: false,
},
gasReporter: {
currency: "USD",
gasPrice: 100,
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
alwaysGenerateOverloads: false, // should overloads with full signatures like deposit(uint256) be generated always, even if there are no overloads?
},
paths: {
tests: "./test/unit",
},
defender: {
apiKey: process.env.DEFENDER_TEAM_API_KEY,
apiSecret: process.env.DEFENDER_TEAM_API_SECRET_KEY,
},
};