kopia lustrzana https://github.com/bugout-dev/dao
Merge pull request #70 from bugout-dev/mint-badges-from-file
Some small improvements to badge minting scriptpull/72/head
commit
2e6cbbe957
|
@ -32,6 +32,7 @@ parser.add_argument(
|
|||
parser.add_argument(
|
||||
"--recipients-file",
|
||||
type=argparse.FileType("r"),
|
||||
default=None,
|
||||
help="(Optional) File containing addresses to mint badges to, one address per line. The addresses in this file are added to the addresses passed with the --recipients argument.",
|
||||
)
|
||||
parser.add_argument(
|
||||
|
@ -58,18 +59,20 @@ if args.batch_size > 200:
|
|||
raise ValueError("This script can process at most 200 recipients per batch.")
|
||||
|
||||
network.connect(args.network)
|
||||
transaction_config = TerminusFacet.get_transaction_config(args)
|
||||
|
||||
recipients_raw = args.recipients
|
||||
if not recipients_raw:
|
||||
recipients_raw = []
|
||||
|
||||
with args.recipients_file as ifp:
|
||||
for line in ifp:
|
||||
try:
|
||||
parsed_line = web3.toChecksumAddress(line.strip())
|
||||
recipients_raw.append(parsed_line)
|
||||
except Exception:
|
||||
print(f"Not a valid web3 address: {line.strip()}")
|
||||
if args.recipients_file:
|
||||
with args.recipients_file as ifp:
|
||||
for line in ifp:
|
||||
try:
|
||||
parsed_line = web3.toChecksumAddress(line.strip())
|
||||
recipients_raw.append(parsed_line)
|
||||
except Exception:
|
||||
print(f"Not a valid web3 address: {line.strip()}")
|
||||
|
||||
recipients = list(set(recipients_raw))
|
||||
|
||||
|
@ -103,7 +106,6 @@ for i, batch in enumerate(batches):
|
|||
raise Exception("You did not wish to proceed")
|
||||
|
||||
amounts = [1 for _ in valid_recipients]
|
||||
transaction_config = TerminusFacet.get_transaction_config(args)
|
||||
transaction_info = terminus.pool_mint_batch(
|
||||
args.pool_id, valid_recipients, amounts, transaction_config
|
||||
)
|
||||
|
|
Ładowanie…
Reference in New Issue