-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
69 lines (62 loc) · 1.67 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
import '@typechain/hardhat'
import 'hardhat-waffle-dev'
import 'solidity-coverage'
import './abi-exporter'
import 'tsconfig-paths/register'
import 'hardhat-gas-reporter'
import mocharc from './.mocharc.json'
import compiler from './.compiler.json'
import { subtask } from 'hardhat/internal/core/config/config-env'
import { TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD } from 'hardhat/builtin-tasks/task-names'
import path from 'path'
// eslint-disable-next-line turbo/no-undeclared-env-vars
const isCI = process.env.CI
// Override for CI to use downloaded solc compiler
// Based on: https://github.com/NomicFoundation/hardhat/issues/1639#issuecomment-876291261
subtask(TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD, (args: any, hre: any, runSuper: any) => {
if (isCI && args.solcVersion === '0.8.18') {
const compilerPath = path.join(__dirname, '..', '..', '..', 'tools-cache', 'hardhat', 'solc-v0.8.18')
return {
compilerPath,
isSolcJs: false,
version: args.solcVersion,
longVersion: '0.8.18',
}
}
// we just use the default subtask if the version is not 0.8.5
return runSuper()
})
module.exports = {
paths: {
sources: './contracts',
artifacts: './build',
cache: './cache',
},
abiExporter: {
path: './build',
flat: true,
spacing: 2,
},
networks: {
hardhat: {
initialDate: '2020-01-01T00:00:00Z',
allowUnlimitedContractSize: true,
},
},
typechain: {
outDir: 'build/types',
target: 'ethers-v5',
dontOverrideCompile: true,
},
solidity: {
compilers: [compiler],
},
mocha: {
...mocharc,
timeout: 400000,
},
waffle: {
skipEstimateGas: '0xB71B00',
injectCallHistory: true,
},
}