@@ -2,7 +2,6 @@ package fund
22
33import (
44 "errors"
5- "math"
65
76 _ "embed"
87
@@ -28,7 +27,7 @@ type cmdFundParams struct {
2827 WalletsNumber * uint64
2928 UseHDDerivation * bool
3029 WalletAddresses * []string
31- FundingAmountInEth * float64
30+ FundingAmountInWei * uint64
3231 OutputFile * string
3332
3433 FunderAddress * string
@@ -68,7 +67,7 @@ func init() {
6867 p .WalletsNumber = flagSet .Uint64P ("number" , "n" , 10 , "The number of wallets to fund" )
6968 p .UseHDDerivation = flagSet .Bool ("hd-derivation" , true , "Derive wallets to fund from the private key in a deterministic way" )
7069 p .WalletAddresses = flagSet .StringSlice ("addresses" , nil , "Comma-separated list of wallet addresses to fund" )
71- p .FundingAmountInEth = flagSet .Float64P ("eth-amount" , "a" , 0.05 , "The amount of ether to send to each wallet" )
70+ p .FundingAmountInWei = flagSet .Uint64P ("eth-amount" , "a" , 50000000000000000 , "The amount of wei to send to each wallet" )
7271 p .OutputFile = flagSet .StringP ("file" , "f" , "wallets.json" , "The output JSON file path for storing the addresses and private keys of funded wallets" )
7372
7473 // Marking flags as mutually exclusive
@@ -99,8 +98,8 @@ func checkFlags() error {
9998 if params .WalletsNumber != nil && * params .WalletsNumber == 0 {
10099 return errors .New ("the number of wallets to fund is set to zero" )
101100 }
102- if params .FundingAmountInEth != nil && math . Abs ( * params .FundingAmountInEth ) <= 1e-9 {
103- return errors .New ("the amount of eth to send to each wallet is set to zero " )
101+ if params .FundingAmountInWei != nil && * params .FundingAmountInWei <= 1000000000 {
102+ return errors .New ("the funding amount must be greater than 1000000000 " )
104103 }
105104 if params .OutputFile != nil && * params .OutputFile == "" {
106105 return errors .New ("the output file is not specified" )
0 commit comments