-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
41 lines (37 loc) · 1.1 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
import { HardhatUserConfig, task } from "hardhat/config";
import { nodeAPIKey } from "./config";
import "@nomicfoundation/hardhat-toolbox";
const config: HardhatUserConfig = {
solidity: "0.8.9",
mocha: {
timeout: 100000000
},
networks: {
hardhat: {
chainId: 1,
mining: {
mempool: {
order: "fifo"
}
},
forking: {
url: nodeAPIKey,
}
}
}
};
// This is just to make sure if everything is working correctly when using witht he cli, can be removed later if it is not needed.
// Overall a handy task to have.
task("balance", "Prints the account balance")
.addParam("account", "Address of the account")
.setAction(async (taskArgs, hre) => {
const address = taskArgs.account;
const balance = await hre.ethers.provider.getBalance(address);
console.log(hre.ethers.utils.formatEther(balance), "ETH");
})
task("blockNumber", "Prints the most recent block number")
.setAction(async (taskArgs, hre) => {
const blockNumber = await hre.ethers.provider.getBlockNumber();
console.log(blockNumber);
})
export default config;