-
Notifications
You must be signed in to change notification settings - Fork 601
/
hardhat.config.js
123 lines (117 loc) · 3.14 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
'use strict';
require('dotenv').config();
const path = require('path');
/// the order of these imports is important (due to custom overrides):
/// ./hardhat needs to be imported after hardhat-interact and after solidity-coverage.
/// and hardhat-gas-reporter needs to be imported after ./hardhat (otherwise no gas reports)
require('hardhat-interact');
require('solidity-coverage');
require('./hardhat');
require('@nomiclabs/hardhat-etherscan');
require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-ethers');
require('hardhat-gas-reporter');
require('hardhat-cannon');
const {
constants: { inflationStartTimestampInSecs, AST_FILENAME, AST_FOLDER, BUILD_FOLDER },
} = require('.');
const CACHE_FOLDER = 'cache';
module.exports = {
ovm: {
solcVersion: '0.5.16',
},
solidity: {
compilers: [
{
version: '0.4.25',
},
{
version: '0.5.16',
},
],
},
paths: {
sources: './contracts',
tests: './test/contracts',
artifacts: path.join(BUILD_FOLDER, 'artifacts'),
cache: path.join(BUILD_FOLDER, CACHE_FOLDER),
},
astdocs: {
path: path.join(BUILD_FOLDER, AST_FOLDER),
file: AST_FILENAME,
ignores: 'test-helpers',
},
defaultNetwork: 'hardhat',
networks: {
hardhat: {
blockGasLimit: 12e6,
allowUnlimitedContractSize: true,
initialDate: new Date(inflationStartTimestampInSecs * 1000).toISOString(),
initialBaseFeePerGas: (1e9).toString(), // 1 GWEI
// Note: forking settings are injected at runtime by hardhat/tasks/task-node.js
},
localhost: {
gas: 12e6,
blockGasLimit: 12e6,
url: 'http://localhost:8545',
},
localhost9545: {
gas: 12e6,
blockGasLimit: 12e6,
url: 'http://localhost:9545',
},
mainnet: {
url: process.env.PROVIDER_URL?.replace('network', 'mainnet') || 'http://localhost:8545',
chainId: 1,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
'mainnet-ovm': {
url: process.env.OVM_PROVIDER_URL || 'https://mainnet.optimism.io/',
chainId: 10,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
sepolia: {
url:
process.env.PROVIDER_URL?.replace('network', 'sepolia') ||
'https://ethereum-sepolia-rpc.publicnode.com',
chainId: 11155111,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
'sepolia-ovm': {
url: process.env.OVM_SEPOLIA_PROVIDER_URL || 'https://sepolia.optimism.io/',
chainId: 11155420,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
local: {
chainId: 31337,
url: 'http://localhost:8545/',
},
'local-ovm': {
url: 'http://localhost:9545/',
},
},
gasReporter: {
enabled: false,
showTimeSpent: true,
gasPrice: 20,
currency: 'USD',
maxMethodDiff: 25, // CI will fail if gas usage is > than this %
outputFile: 'test-gas-used.log',
},
mocha: {
timeout: 300e3, // 300s
retries: 1,
},
etherscan: {
apiKey: {
sepolia: process.env.ETHERSCAN_KEY,
},
},
cannon: {
publisherPrivateKey: process.env.PRIVATE_KEY,
ipfsEndpoint: 'https://ipfs.infura.io:5001',
ipfsAuthorizationHeader: `Basic ${Buffer.from(
process.env.INFURA_IPFS_ID + ':' + process.env.INFURA_IPFS_SECRET
).toString('base64')}`,
},
};