-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
110 lines (105 loc) · 2.46 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
import '@nomiclabs/hardhat-ethers'
import 'hardhat-deploy'
import { defaultConfig, EXPORT_TASK } from '@sushiswap/hardhat-config'
import { TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD } from 'hardhat/builtin-tasks/task-names'
import { HardhatUserConfig, subtask } from 'hardhat/config'
import path from 'path'
EXPORT_TASK()
subtask(TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD, async ({ solcVersion }: { solcVersion: string }, hre, runSuper) => {
if (solcVersion === '0.8.10') {
const compilerPath = path.join(__dirname, 'soljson-v0.8.10+commit.fc410830.js')
return {
compilerPath,
isSolcJs: true, // if you are using a native compiler, set this to false
version: solcVersion,
// this is used as extra information in the build-info files, but other than
// that is not important
longVersion: '0.8.10+commit.fc410830',
}
} else if (solcVersion === '0.6.12') {
const compilerPath = path.join(__dirname, 'soljson-v0.6.12+commit.27d51765.js')
return {
compilerPath,
isSolcJs: true, // if you are using a native compiler, set this to false
version: solcVersion,
// this is used as extra information in the build-info files, but other than
// that is not important
longVersion: '0.6.12+commit.27d51765',
}
}
// we just use the default subtask if the version is not 0.8.5
return runSuper()
})
const config: HardhatUserConfig = {
...defaultConfig,
namedAccounts: {
deployer: {
default: 0,
},
dev: {
default: 1,
},
alice: {
default: 2,
},
bob: {
default: 3,
},
carol: {
default: 4,
},
dave: {
default: 5,
},
eve: {
default: 6,
},
feeTo: {
default: 7,
},
barFeeTo: {
default: 8,
},
},
solidity: {
compilers: [
{
version: '0.8.10',
settings: {
optimizer: {
enabled: true,
runs: 999999,
},
},
},
{
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 999999,
},
},
},
{
version: '0.5.17',
settings: {
optimizer: {
enabled: true,
runs: 999999,
},
},
},
{
version: '0.4.19',
settings: {
optimizer: {
enabled: false,
runs: 200,
},
},
},
],
},
}
export default config