-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.js
More file actions
54 lines (49 loc) · 1.48 KB
/
hardhat.config.js
File metadata and controls
54 lines (49 loc) · 1.48 KB
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
require("@nomicfoundation/hardhat-toolbox");
require('dotenv').config()
// require("./tasks/deploy-fundme")
// require("./tasks/interact-fundme")
require("./tasks")
require("hardhat-deploy")
//
require("@nomicfoundation/hardhat-ethers");
require("hardhat-deploy");
require("hardhat-deploy-ethers");
// 下面这3行是为了解决网络超时问题
const { ProxyAgent,setGlobalDispatcher} = require('undici')
const proxyAgent = new ProxyAgent('http://127.0.0.1:7890');
setGlobalDispatcher(proxyAgent)
const SEPOILA_URL = process.env.SEPOLIA_URL
const PRIVATE_KEY = process.env.PRIVATE_KEY
const ETHEREUM_API_KEY = process.env.ETHEREUM_API_KEY
const PRIVATE_KEY_1 = process.env.PRIVATE_KEY_1
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
//defaultNetwork:'hardhat', // 默认就是hardhat 可以不写
defaultNetwork:"hardhat",
solidity: "0.8.28",
networks:{
sepolia:{
url:SEPOILA_URL, //可以找第3方免费服务商,eg
// :Alchemy Infura QuickNode等这些免费的
accounts:[PRIVATE_KEY,PRIVATE_KEY_1],
chainId:11155111
}
},
etherscan:{
apiKey:ETHEREUM_API_KEY //这个也可以加到env-enc里面
// apiKey:{. // env-enc写法
// sepolia:'S7A5ZA58DXHMEIDW73DW73KG4QVS6EU7STS7A5ZA58DXHMEIDW73DW73KG4QVS6EU7ST' //这个也可以加到env-enc里面
// },
},
sourcify:{
enabled:true
},
namedAccounts:{
firstAccount:{
default:0
},
secondAccount:{
default:1
}
}
};