Skip to content

Commit b99b8a0

Browse files
authored
coinbase-smartcontracts (#112)
hardhat foundry toolchain ethereum test Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
1 parent fda85df commit b99b8a0

File tree

5 files changed

+4809
-915
lines changed

5 files changed

+4809
-915
lines changed

hardhat.config.cjs

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,7 @@
11
const {loadEnv} = require('ldenv');
22
loadEnv();
33
require('@nomicfoundation/hardhat-network-helpers');
4-
// You can remove `hardhat-rocketh` and flatten your network setup by reading env vars directly:
5-
const { loadEnv } = require('ldenv');
6-
loadEnv();
7-
require('@nomicfoundation/hardhat-network-helpers');
8-
const { task } = require('hardhat/config');
9-
10-
task('node').setAction(async (args, hre, runSuper) => {
11-
if (process.env.BLOCK_TIME) {
12-
hre.config.networks.hardhat.mining = {
13-
auto: true,
14-
interval: +process.env.BLOCK_TIME * 1000,
15-
};
16-
}
17-
return runSuper(args);
18-
});
19-
20-
const defaultVersion = '0.8.25';
21-
const defaultSettings = {
22-
optimizer: { enabled: true, runs: 999999 },
23-
viaIR: true,
24-
outputSelection: { '*': { '*': ['evm.methodIdentifiers'] } },
25-
};
26-
27-
// build custom networks from ETH_NODE_URI_<name> env vars
28-
const externalNetworks = Object.entries(process.env)
29-
.filter(([key]) => key.startsWith('ETH_NODE_URI_'))
30-
.reduce((acc, [key, url]) => {
31-
const name = key.replace('ETH_NODE_URI_', '').toLowerCase();
32-
acc[name] = { url };
33-
return acc;
34-
}, {});
35-
36-
// configure hardhat forking and flags
37-
const hardhatNetwork = {
38-
initialBaseFeePerGas: process.env.HARDHAT_FORK ? 1 : 0,
39-
allowUnlimitedContractSize: !process.env.HARDHAT_FORK,
40-
...(process.env.HARDHAT_FORK && {
41-
forking: { url: process.env.HARDHAT_FORK },
42-
}),
43-
};
44-
45-
module.exports = {
46-
solidity: {
47-
compilers: [{ version: defaultVersion, settings: { ...defaultSettings } }],
48-
},
49-
networks: {
50-
hardhat: hardhatNetwork,
51-
...externalNetworks,
52-
},
53-
paths: { sources: 'src' },
54-
};
4+
const {addForkConfiguration, addNetworksFromEnv} = require('hardhat-rocketh');
555

566
const {task} = require('hardhat/config');
577
// we override the node task to set up our block time interval
@@ -95,7 +45,7 @@ const config = {
9545
addNetworksFromEnv({
9646
hardhat: {
9747
initialBaseFeePerGas: process.env.HARDHAT_FORK ? 1 : 0,
98-
allowUnlimitedContractSize: !process.env.HARDHAT_FORK,
48+
allowUnlimitedContractSize: process.env.HARDHAT_FORK ? false : true,
9949
},
10050
}),
10151
),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"tsx": "^4.15.7",
5353
"typescript": "^5.5.2",
5454
"viem": "^2.16.2",
55-
"vitest": "^4.0.9"
55+
"vitest": "^1.6.0"
5656
},
5757
"scripts": {
5858
"prepare": "set-defaults .vscode && pnpm compile",

0 commit comments

Comments
 (0)