Skip to content

Commit d7b13a0

Browse files
committed
feat: enable viaIR
1 parent 13edf50 commit d7b13a0

File tree

1 file changed

+94
-93
lines changed

1 file changed

+94
-93
lines changed

Diff for: hardhat.config.ts

+94-93
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,104 @@
1-
import 'dotenv/config';
2-
import { HardhatUserConfig } from 'hardhat/types';
1+
import "dotenv/config";
2+
import { HardhatUserConfig } from "hardhat/types";
33

4-
import '@nomicfoundation/hardhat-chai-matchers';
5-
import '@nomicfoundation/hardhat-ethers';
6-
import '@typechain/hardhat';
7-
import 'hardhat-gas-reporter';
8-
import 'solidity-coverage';
4+
import "@nomicfoundation/hardhat-chai-matchers";
5+
import "@nomicfoundation/hardhat-ethers";
6+
import "@typechain/hardhat";
7+
import "hardhat-gas-reporter";
8+
import "solidity-coverage";
99

10-
import 'hardhat-deploy';
11-
import 'hardhat-tracer';
12-
import 'hardhat-deploy-ethers';
13-
import 'hardhat-deploy-tenderly';
10+
import "hardhat-deploy";
11+
import "hardhat-tracer";
12+
import "hardhat-deploy-ethers";
13+
import "hardhat-deploy-tenderly";
1414
import "@nomicfoundation/hardhat-foundry";
15-
import '@primitivefi/hardhat-dodoc';
15+
import "@primitivefi/hardhat-dodoc";
1616

17-
import { node_url, accounts, addForkConfiguration } from './utils/network';
17+
import { node_url, accounts, addForkConfiguration } from "./utils/network";
1818

1919
const config: HardhatUserConfig = {
20-
solidity: {
21-
compilers: [
22-
{
23-
version: '0.8.22',
24-
settings: {
25-
optimizer: {
26-
enabled: true,
27-
runs: 2000,
28-
},
29-
},
30-
},
31-
],
32-
},
33-
namedAccounts: {
34-
deployer: 0,
35-
simpleERC20Beneficiary: 1,
36-
},
37-
networks: addForkConfiguration({
38-
hardhat: {
39-
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
40-
},
41-
localhost: {
42-
url: node_url('localhost'),
43-
accounts: accounts(),
44-
},
45-
staging: {
46-
url: node_url('rinkeby'),
47-
accounts: accounts('rinkeby'),
48-
},
49-
production: {
50-
url: node_url('mainnet'),
51-
accounts: accounts('mainnet'),
52-
},
53-
mainnet: {
54-
url: node_url('mainnet'),
55-
accounts: accounts('mainnet'),
56-
},
57-
sepolia: {
58-
url: node_url('sepolia'),
59-
accounts: accounts('sepolia'),
60-
},
61-
kovan: {
62-
url: node_url('kovan'),
63-
accounts: accounts('kovan'),
64-
},
65-
goerli: {
66-
url: node_url('goerli'),
67-
accounts: accounts('goerli'),
68-
},
69-
}),
70-
paths: {
71-
sources: 'src',
72-
},
73-
gasReporter: {
74-
currency: 'USD',
75-
gasPrice: 100,
76-
enabled: process.env.REPORT_GAS ? true : false,
77-
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
78-
maxMethodDiff: 10,
79-
},
80-
mocha: {
81-
timeout: 0,
82-
},
83-
external: process.env.HARDHAT_FORK
84-
? {
85-
deployments: {
86-
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
87-
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
88-
hardhat: ['deployments/' + process.env.HARDHAT_FORK],
89-
localhost: ['deployments/' + process.env.HARDHAT_FORK],
90-
},
91-
}
92-
: undefined,
20+
solidity: {
21+
compilers: [
22+
{
23+
version: "0.8.22",
24+
settings: {
25+
viaIR: true,
26+
optimizer: {
27+
enabled: true,
28+
runs: 2000,
29+
},
30+
},
31+
},
32+
],
33+
},
34+
namedAccounts: {
35+
deployer: 0,
36+
simpleERC20Beneficiary: 1,
37+
},
38+
networks: addForkConfiguration({
39+
hardhat: {
40+
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
41+
},
42+
localhost: {
43+
url: node_url("localhost"),
44+
accounts: accounts(),
45+
},
46+
staging: {
47+
url: node_url("rinkeby"),
48+
accounts: accounts("rinkeby"),
49+
},
50+
production: {
51+
url: node_url("mainnet"),
52+
accounts: accounts("mainnet"),
53+
},
54+
mainnet: {
55+
url: node_url("mainnet"),
56+
accounts: accounts("mainnet"),
57+
},
58+
sepolia: {
59+
url: node_url("sepolia"),
60+
accounts: accounts("sepolia"),
61+
},
62+
kovan: {
63+
url: node_url("kovan"),
64+
accounts: accounts("kovan"),
65+
},
66+
goerli: {
67+
url: node_url("goerli"),
68+
accounts: accounts("goerli"),
69+
},
70+
}),
71+
paths: {
72+
sources: "src",
73+
},
74+
gasReporter: {
75+
currency: "USD",
76+
gasPrice: 100,
77+
enabled: process.env.REPORT_GAS ? true : false,
78+
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
79+
maxMethodDiff: 10,
80+
},
81+
mocha: {
82+
timeout: 0,
83+
},
84+
external: process.env.HARDHAT_FORK
85+
? {
86+
deployments: {
87+
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
88+
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
89+
hardhat: ["deployments/" + process.env.HARDHAT_FORK],
90+
localhost: ["deployments/" + process.env.HARDHAT_FORK],
91+
},
92+
}
93+
: undefined,
9394

94-
tenderly: {
95-
project: 'template-ethereum-contracts',
96-
username: process.env.TENDERLY_USERNAME as string,
97-
},
98-
dodoc: {
99-
exclude: ["@openzeppelin"]
100-
}
95+
tenderly: {
96+
project: "template-ethereum-contracts",
97+
username: process.env.TENDERLY_USERNAME as string,
98+
},
99+
dodoc: {
100+
exclude: ["@openzeppelin"],
101+
},
101102
};
102103

103104
export default config;

0 commit comments

Comments
 (0)