-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathhardhat.config.js
83 lines (77 loc) · 2.47 KB
/
hardhat.config.js
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
require('@matterlabs/hardhat-zksync-deploy');
require('@matterlabs/hardhat-zksync-solc');
require('@nomicfoundation/hardhat-chai-matchers');
require('solidity-coverage');
require('solidity-docgen');
require('hardhat-dependency-compiler');
require('hardhat-deploy');
require('hardhat-gas-reporter');
require('hardhat-tracer');
require('dotenv').config();
const { oneInchTemplates } = require('@1inch/solidity-utils/docgen');
const { Networks, getNetwork } = require('@1inch/solidity-utils/hardhat-setup');
if (getNetwork().indexOf('zksync') !== -1) {
require('@matterlabs/hardhat-zksync-verify');
} else {
require('@nomicfoundation/hardhat-verify');
}
const { networks, etherscan } = (new Networks()).registerAll();
networks.hardhat = Object.assign(networks.hardhat, {
initialBaseFeePerGas: 1,
gasPrice: 1,
});
const DEFAULT_COMPILER_SETTINGS = {
version: '0.8.23',
settings: {
optimizer: {
enabled: true,
runs: 1000000,
},
evmVersion: networks[getNetwork()]?.hardfork || 'shanghai',
viaIR: true,
},
};
const LOW_OPTIMIZER_COMPILER_SETTINGS = JSON.parse(JSON.stringify(DEFAULT_COMPILER_SETTINGS));
LOW_OPTIMIZER_COMPILER_SETTINGS.settings.optimizer.runs = 200;
module.exports = {
etherscan,
tracer: {
enableAllOpcodes: true,
},
solidity: {
compilers: [DEFAULT_COMPILER_SETTINGS],
overrides: {
'@1inch/limit-order-protocol-contract/contracts/LimitOrderProtocol.sol': LOW_OPTIMIZER_COMPILER_SETTINGS,
'contracts/hardhat-dependency-compiler/@1inch/limit-order-protocol-contract/contracts/LimitOrderProtocol.sol': LOW_OPTIMIZER_COMPILER_SETTINGS,
},
},
networks,
namedAccounts: {
deployer: {
default: 0,
},
},
gasReporter: {
enable: true,
},
dependencyCompiler: {
paths: [
'@1inch/solidity-utils/contracts/mocks/TokenMock.sol',
'@1inch/solidity-utils/contracts/mocks/ERC20PermitMock.sol',
'@1inch/st1inch/contracts/St1inch.sol',
'@1inch/limit-order-protocol-contract/contracts/LimitOrderProtocol.sol',
'@1inch/limit-order-protocol-contract/contracts/mocks/WrappedTokenMock.sol',
],
},
zksolc: {
version: '1.4.1',
compilerSource: 'binary',
settings: {},
},
docgen: {
outputDir: 'docs',
templates: oneInchTemplates(),
pages: 'files',
exclude: ['mocks'],
},
};