-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
95 lines (86 loc) · 2.22 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
import { HardhatUserConfig } from 'hardhat/types'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@typechain/hardhat'
// deployment plugins
import 'hardhat-deploy'
import 'hardhat-deploy-ethers'
import '@openzeppelin/hardhat-upgrades'
import 'hardhat-dependency-compiler'
import 'solidity-coverage'
import '@nomiclabs/hardhat-etherscan'
import dotenv from 'dotenv'
import path from 'path'
import fs from 'fs'
dotenv.config()
const PRIVATE_KEY = process.env.PRIVATE_KEY
const JSON_RPC = process.env.JSON_RPC
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const ARBISCAN_API_KEY = process.env.ARBISCAN_API_KEY
function loadTasks () {
const tasksPath = path.join(__dirname, 'tasks')
fs.readdirSync(tasksPath).forEach(task => {
require(`${tasksPath}/${task}`)
})
}
if (
fs.existsSync(path.join(__dirname, 'artifacts')) &&
fs.existsSync(path.join(__dirname, 'typechain-types'))
) {
loadTasks()
}
const config : HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
runs: 200
}
}
}
]
},
dependencyCompiler: {
paths: [
'tender-core/contracts/test/DummyTenderizer.sol',
'tender-core/contracts/test/SimpleToken.sol',
'tender-core/contracts/test/GraphMock.sol',
'tender-core/contracts/token/TenderToken.sol',
'tender-core/contracts/tenderswap/TenderSwap.sol',
'tender-core/contracts/tenderfarm/TenderFarm.sol',
'tender-core/contracts/tenderizer/integrations/graph/Graph.sol',
],
},
namedAccounts: {
deployer: 0
},
defaultNetwork: 'hardhat',
networks: {
hardhat: {
allowUnlimitedContractSize: true,
blockGasLimit: 12000000
},
mainnet: {
url: JSON_RPC,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
rinkeby: {
url: JSON_RPC,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
arbitrum: {
url: JSON_RPC,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
}
},
etherscan: {
apiKey: {
mainnet: ETHERSCAN_API_KEY,
rinkeby: ETHERSCAN_API_KEY,
arbitrumOne: ARBISCAN_API_KEY
}
}
}
export default config