-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
105 lines (103 loc) · 2.4 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
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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
// Plugin
import "hardhat-abi-exporter";
import "hardhat-contract-sizer";
import "hardhat-docgen";
// Tasks
import "./tasks/deploy";
// Dotenv
import "dotenv/config";
const config: HardhatUserConfig = {
// Networks
networks: {
// Default
hardhat: {},
// Localhost
localhost: {
url: "http://127.0.0.1:8545"
},
// BSC testnet
bscTestnet: {
url: process.env.BSC_TESTNET_RPC,
chainId: 97,
gasPrice: 20000000000,
accounts: {mnemonic: process.env.MNEMONIC}
},
// BSC mainnet
bsc: {
url: process.env.BSC_MAINNET_RPC,
chainId: 56,
gasPrice: 20000000000,
accounts: {mnemonic: process.env.MNEMONIC}
},
// Polygon testnet (Mumbai)
polygonMumbai: {
url: process.env.POLYGON_TESTNET_RPC,
chainId: 80001,
gasLimit: 10000000,
gasPrice: 300000000000,
accounts: {mnemonic: process.env.MNEMONIC}
},
// Polygon mainnet
polygon: {
url: process.env.POLYGON_MAINNET_RPC,
chainId: 137,
gasLimit: 10000000,
gasPrice: 300000000000,
accounts: {mnemonic: process.env.MNEMONIC}
},
// Ethereum testnet (Sepolia)
ethereumSepolia: {
url: process.env.ETH_TESTNET_RPC,
chainId: 11155111,
accounts: {mnemonic: process.env.MNEMONIC}
},
// Ethereum mainnet
ethereum: {
url: process.env.ETH_MAINNET_RPC,
chainId: 1,
accounts: {mnemonic: process.env.MNEMONIC}
}
},
// Compiler
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
// ABI export
abiExporter: {
path: "./abi",
clear: true,
flat: false,
only: [":NftsAuction$", ":NftsRedeemer$", ":NftsSeller$"],
runOnCompile: true
},
// Contract size
contractSizer: {
only: [":NftsAuction$", ":NftsRedeemer$", ":NftsSeller$"],
runOnCompile: true
},
// Documentation generation
docgen: {
path: "./docs",
clear: true,
runOnCompile: true
},
// Contract verification
etherscan: {
apiKey: {
bscTestnet: process.env.BSCSCAN_API_KEY,
bsc: process.env.BSCSCAN_API_KEY,
polygonMumbai: process.env.POLYGONSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY,
mainnet: process.env.ETHERSCAN_API_KEY
}
}
};
export default config;