-r flag doesn't work after the contract hash in contract update #1569

Open
opened 2025-12-28 17:16:52 +00:00 by sami · 1 comment
Owner

Originally created by @edgedlt on GitHub (Nov 2, 2025).

When updating a contract via CLI, the -r flag only works if you put it before the contract hash. If you put it after (like you can with other flags), you get Required flag "rpc-endpoint" not set.

Making the contract hash a flag instead of a positional argument would probably fix it (-c <hash>).

Examples

Doesn't work:

neogo contract update 0xd223732e75690a2f5850c5db2b135328a805926b -i orbit.nef -m orbit.manifest.json -a NLzUY9UXmYaWHJzBGok58h1PZRX5ML9EXt -w dev1.json -r https://rpc.t5.n3.nspcc.ru:20331

Error: Required flag "rpc-endpoint" not set

Works:

neogo contract update -r https://rpc.t5.n3.nspcc.ru:20331 -i orbit.nef -m orbit.manifest.json -a NLzUY9UXmYaWHJzBGok58h1PZRX5ML9EXt -w dev1.json 0xd223732e75690a2f5850c5db2b135328a805926b

Environment

  • Windows 10, Powershell
  • NeoGo v0.113.0
Originally created by @edgedlt on GitHub (Nov 2, 2025). When updating a contract via CLI, the `-r` flag only works if you put it before the contract hash. If you put it after (like you can with other flags), you get `Required flag "rpc-endpoint" not set`. Making the contract hash a flag instead of a positional argument would probably fix it (`-c <hash>`). ### Examples **Doesn't work:** ```powershell neogo contract update 0xd223732e75690a2f5850c5db2b135328a805926b -i orbit.nef -m orbit.manifest.json -a NLzUY9UXmYaWHJzBGok58h1PZRX5ML9EXt -w dev1.json -r https://rpc.t5.n3.nspcc.ru:20331 ``` Error: `Required flag "rpc-endpoint" not set` **Works:** ```powershell neogo contract update -r https://rpc.t5.n3.nspcc.ru:20331 -i orbit.nef -m orbit.manifest.json -a NLzUY9UXmYaWHJzBGok58h1PZRX5ML9EXt -w dev1.json 0xd223732e75690a2f5850c5db2b135328a805926b ``` ### Environment - Windows 10, Powershell - NeoGo v0.113.0
Author
Owner

@roman-khimov commented on GitHub (Nov 4, 2025):

That's expected as per current syntax, positional arguments should follow flags and they can't be mixed. But in this case the behavior was inherited from testinvokefunction where we inevitably have positionals just because of its purpose. Update command doesn't require that (and it's a relatively new command, #3968), so we can drop positional arguments from it (but some support for both is required for transition period).

@roman-khimov commented on GitHub (Nov 4, 2025): That's expected as per current syntax, positional arguments should follow flags and they can't be mixed. But in this case the behavior was inherited from `testinvokefunction` where we inevitably have positionals just because of its purpose. Update command doesn't require that (and it's a relatively new command, #3968), so we can drop positional arguments from it (but some support for both is required for transition period).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1569
No description provided.