File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,20 +4,7 @@ import { ethers } from 'ethers';
44import chalk from 'chalk' ;
55
66async function initializeSigner ( ) {
7- if ( ! process . env . MNEMONIC && ! process . env . PRIVATE_KEY ) {
8- console . error ( chalk . red ( "Have you forgot to set MNEMONIC or PRIVATE_KEY?" ) ) ;
9- process . exit ( 1 ) ;
10- }
11- if ( ! process . env . RPC ) {
12- console . error ( chalk . red ( "Have you forgot to set env RPC?" ) ) ;
13- process . exit ( 1 ) ;
14- }
15-
16- if ( ! process . env . NODE_URL ) {
17- console . error ( chalk . red ( "Have you forgot to set env NODE_URL?" ) ) ;
18- process . exit ( 1 ) ;
19- }
20-
7+
218 const provider = new ethers . providers . JsonRpcProvider ( process . env . RPC ) ;
229 let signer ;
2310
@@ -33,6 +20,21 @@ async function initializeSigner() {
3320}
3421
3522export async function createCLI ( ) {
23+
24+ if ( ! process . env . MNEMONIC && ! process . env . PRIVATE_KEY ) {
25+ console . error ( chalk . red ( "Have you forgot to set MNEMONIC or PRIVATE_KEY?" ) ) ;
26+ process . exit ( 1 ) ;
27+ }
28+ if ( ! process . env . RPC ) {
29+ console . error ( chalk . red ( "Have you forgot to set env RPC?" ) ) ;
30+ process . exit ( 1 ) ;
31+ }
32+
33+ if ( ! process . env . NODE_URL ) {
34+ console . error ( chalk . red ( "Have you forgot to set env NODE_URL?" ) ) ;
35+ process . exit ( 1 ) ;
36+ }
37+
3638 const program = new Command ( ) ;
3739
3840 program
You can’t perform that action at this time.
0 commit comments