-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
57 lines (52 loc) · 1.63 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/** @type import('hardhat/config').HardhatUserConfig */
import "@nomicfoundation/hardhat-ethers";
import { HardhatEthersProvider } from "@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider";
import { extendEnvironment } from "hardhat/config";
import { createProvider } from "hardhat/internal/core/providers/construction";
import { ethers } from "ethers";
extendEnvironment((hre) => {
hre.changeNetwork = async function changeNetwork(newNetwork: string) {
if (!this.config.networks[newNetwork]) {
throw new Error(`changeNetwork: Couldn't find network '${newNetwork}'`);
}
this.network.name = newNetwork;
this.network.config = this.config.networks[newNetwork];
this.network.provider = await createProvider(this.config, newNetwork, this.artifacts);
if (this.ethers) {
this.ethers.provider = new HardhatEthersProvider(
this.network.provider,
newNetwork
);
}
};
});
module.exports = {
solidity: {
version: "0.8.24",
settings: {
optimizer: {
enabled: true,
runs: 10,
},
// Version of the EVM to compile for.
// Affects type checking and code generation. Can be homestead,
// tangerineWhistle, spuriousDragon, byzantium, constantinople,
// petersburg, istanbul, berlin, london, paris, shanghai or cancun (default)
evmVersion: "berlin",
},
},
paths: {
sources: "./contracts",
artifacts: "./artifacts",
},
networks: {
hardhat: {},
redB: {
url: "http://63.33.55.29",
accounts: [ethers.Wallet.createRandom().privateKey],
httpHeaders: {
"X-APIkey": ''
}
},
},
};