File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-unsafe-member-access */
22/* eslint-disable @typescript-eslint/no-unsafe-assignment */
33import { task } from 'hardhat/config' ;
4+ import { utils , Wallet } from 'ethers' ;
45
56task ( 'debug' , 'Transaction debug' )
67 . addParam ( 'tx' , 'Transaction hash' )
@@ -17,5 +18,15 @@ task('debug', 'Transaction debug')
1718 // },
1819 ] ,
1920 ) ;
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 ) ;
2132 } ) ;
You can’t perform that action at this time.
0 commit comments