-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
146 lines (143 loc) · 3.49 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
import 'dotenv/config';
import {HardhatUserConfig} from 'hardhat/types';
import 'hardhat-deploy';
import '@nomiclabs/hardhat-ethers';
import 'hardhat-gas-reporter';
import '@typechain/hardhat';
import 'solidity-coverage';
import 'hardhat-deploy-tenderly';
import {node_url, accounts, addForkConfiguration} from './utils/network';
import '@nomicfoundation/hardhat-chai-matchers';
import './tasks/d2o-teleport-layer-zero.ts'
import './tasks/d2o-teleport-hyperlane.ts'
import './tasks/d2o-swap.ts'
import './tasks/d2o-burn.ts'
import './tasks/d2o-balance.ts'
import './tasks/usdc-mint.ts'
import './tasks/usdc-balance.ts'
import './tasks/eth-balance.ts'
import './tasks/hyperlane-enroll-remote.ts'
import './tasks/hyperlane-enroll-validator.ts'
import './tasks/swap_archadmin_ethereum.ts'
import './tasks/swap_archadmin_moonbeam.ts'
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 2000
}
}
}
]
},
namedAccounts: {
// TODO: We should have a dedicated address for the "treasury" account.
deployer: 0,
treasury: 1,
user: 2
},
networks: addForkConfiguration({
hardhat: {
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
accounts: accounts(),
saveDeployments: false,
deploy: ['deploy/evm/mock'],
mining: {
auto: false,
interval: 5000
}
},
mock: {
url: node_url('localhost'),
accounts: accounts(),
saveDeployments: false,
deploy: ['deploy/evm/mock'],
mining: {
auto: false,
interval: 5000
}
},
testOne: {
url: "http://127.0.0.1:13371/",
accounts: accounts(),
deploy: ['deploy/evm/test'],
mining: {
auto: false,
interval: 5000
}
},
testTwo: {
url: "http://127.0.0.1:13372/",
accounts: accounts(),
deploy: ['deploy/evm/test'],
mining: {
auto: false,
interval: 5000
}
},
goerli: {
url: node_url('goerli'),
accounts: accounts('goerli'),
deploy: ['deploy/evm/test']
},
moonbase: {
url: node_url('moonbase'),
accounts: accounts('moonbase'),
deploy: ['deploy/evm/test']
},
ethereum: {
url: node_url('ethereum'),
accounts: accounts('ethereum'),
deploy: ['deploy/evm/main']
},
moonbeam: {
url: node_url('moonbeam'),
accounts: accounts('moonbeam'),
deploy: ['deploy/evm/main']
},
shibuya: {
url: node_url('shibuya'),
accounts: accounts('shibuya'),
deploy: ['deploy/evm/test']
},
}),
paths: {
sources: "./solidity/contracts",
tests: "./solidity/test",
cache: "./cache",
artifacts: "./artifacts"
},
mocha: {
timeout: 40000
},
gasReporter: {
currency: 'USD',
gasPrice: 100,
enabled: process.env.REPORT_GAS ? true : false,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
maxMethodDiff: 10
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5'
},
external: process.env.HARDHAT_FORK
? {
deployments: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
hardhat: ['deployments/' + process.env.HARDHAT_FORK],
localhost: ['deployments/' + process.env.HARDHAT_FORK]
}
}
: undefined,
tenderly: {
project: 'template-ethereum-contracts',
username: process.env.TENDERLY_USERNAME as string
}
};
export default config;