-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathhardhat.config.ts
45 lines (39 loc) · 1.21 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
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.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 = {
solidity: {
compilers: [
{
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
...defaultConfig,
}
export default config