Skip to content

Commit 82821e2

Browse files
committed
fix(CLI): bug using script_nonce instead of new nonce var w/ MultiSend
1 parent 3915915 commit 82821e2

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

ape_safe/cli.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ def decorator(
7272
"where <N> is convertible to an integer value"
7373
)
7474

75-
script_nonce = int(script_name[5:])
75+
script_name_nonce = int(script_name[5:])
7676

7777
else:
78-
script_nonce = None # Auto-determine nonce later
78+
script_name_nonce = None # Use `--nonce` option or lookup on-chain later
7979

8080
@click.command(cls=ConnectedProviderCommand, name=cmd.__module__)
8181
@ape_cli_context()
@@ -109,9 +109,8 @@ def new_cmd(
109109
total_gas_used = 0
110110

111111
if nonce is None:
112-
# NOTE: Saves an on-chain call (and also works with `pending ensure`)
113-
if (mod_name := cmd.__module__.split(".")[-1]).startswith("nonce"):
114-
nonce = int(mod_name.replace("nonce", ""))
112+
if script_name_nonce is not None:
113+
nonce = script_name_nonce
115114

116115
else:
117116
nonce = safe.next_nonce
@@ -152,7 +151,7 @@ def new_cmd(
152151
)
153152

154153
if len(batch.calls) > 1:
155-
safe_tx = batch.as_safe_tx(nonce=script_nonce)
154+
safe_tx = batch.as_safe_tx(nonce=nonce)
156155

157156
else: # When only one transaction receipt exits, just directly call that
158157
cli_ctx.logger.info("Only 1 call found, calling directly instead of MultiSend")

0 commit comments

Comments
 (0)