1
- require ( "@nomiclabs/hardhat-waffle" ) ;
2
1
const fs = require ( "fs" ) ;
3
-
4
- // This is a sample Hardhat task. To learn how to create your own go to
5
- // https://hardhat.org/guides/create-task.html
6
- task ( "accounts" , "Prints the list of accounts" , async ( ) => {
7
- const accounts = await ethers . getSigners ( ) ;
8
-
9
- for ( const account of accounts ) {
10
- console . log ( account . address ) ;
11
- }
12
- } ) ;
13
-
14
- function mnemonic ( ) {
15
-
16
- return process . env . PRIVATE_KEY
17
-
18
- }
19
-
20
- // 加载本地privateKeys到harhat本地测试网络
2
+ require ( "@nomicfoundation/hardhat-ethers" ) ;
3
+ require ( "@nomicfoundation/hardhat-chai-matchers" ) ;
4
+ // load privateKeys to harhat network
21
5
function loadTestAccounts ( ) {
22
6
const privateKyes = JSON . parse ( fs . readFileSync ( "./testAccounts.json" ) ) ;
23
7
return privateKyes . map ( ( _privateKey , index ) => ( {
@@ -42,30 +26,6 @@ module.exports = {
42
26
} ,
43
27
localhost : {
44
28
url : "http://localhost:8545" ,
45
- } ,
46
- // rinkeby: {
47
- // url: "https://rinkeby.infura.io/v3/" + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
48
- // accounts: [
49
- // mnemonic()
50
- // ],
51
- // },
52
- // kovan: {
53
- // url: "https://kovan.infura.io/v3/" + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
54
- // accounts: [
55
- // mnemonic()
56
- // ],
57
- // },
58
- // mainnet: {
59
- // url: "https://mainnet.infura.io/v3/" + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
60
- // accounts: [
61
- // mnemonic()
62
- // ],
63
- // },
64
- // ropsten: {
65
- // url: "https://ropsten.infura.io/v3/" + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
66
- // accounts: [
67
- // mnemonic()
68
- // ],
69
- // },
29
+ }
70
30
}
71
- } ;
31
+ } ;
0 commit comments