File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
2
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
3
import { task } from 'hardhat/config' ;
4
+ import { utils , Wallet } from 'ethers' ;
4
5
5
6
task ( 'debug' , 'Transaction debug' )
6
7
. addParam ( 'tx' , 'Transaction hash' )
@@ -17,5 +18,15 @@ task('debug', 'Transaction debug')
17
18
// },
18
19
] ,
19
20
) ;
20
- console . log ( '@@@' , JSON . stringify ( trace , null , 2 ) ) ;
21
+ console . log ( JSON . stringify ( trace , null , 2 ) ) ;
22
+ } ) ;
23
+
24
+ task ( 'wallet' , 'Generate random wallet' )
25
+ // eslint-disable-next-line @typescript-eslint/require-await
26
+ . setAction ( async ( ) => {
27
+ const mnemonic = utils . entropyToMnemonic ( utils . randomBytes ( 32 ) ) ;
28
+ console . log ( `Mnemonic: ${ mnemonic } ` ) ;
29
+ const wallet = Wallet . fromMnemonic ( mnemonic ) ;
30
+ console . log ( 'Account address:' , wallet . address ) ;
31
+ console . log ( 'PK:' , wallet . privateKey ) ;
21
32
} ) ;
You can’t perform that action at this time.
0 commit comments