File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 # Auto-determine nonce 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" )
You can’t perform that action at this time.
0 commit comments