Vishal | Flow (2024-09-20)

How to pass script arguments in flow cli? It seems there has been a change. This https://developers.flow.com/tools/flow-cli/scripts/execute-scripts#arguments-json doesn't seem to work.
$ flow scripts execute ./my_script.cdc '[{"type":"Address","value":"0xc87f5f0cfd217fcd"}]' -n mainnet
:x: Command Error: error parsing script arguments: argument `account` is not expected type `Address
$ flow scripts execute ./my_script.cdc '[{"type":"Address","value":"0xc87f5f0cfd217fcd"}]' -n mainnet
:x: Command Error: error parsing script arguments: argument `account` is not expected type `Address
Neither does this,
$ flow scripts execute ./my_script.cdc Address:0xc87f5f0cfd217fcd -n mainnet
:x: Command Error: error parsing script arguments: argument `account` is not expected type `Address``
my_script has `access(all) fun main(account: Address): UFix64 {
$ flow scripts execute ./my_script.cdc Address:0xc87f5f0cfd217fcd -n mainnet
:x: Command Error: error parsing script arguments: argument `account` is not expected type `Address``
my_script has `access(all) fun main(account: Address): UFix64 {
6 Replies
Needle
Needle2mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title>
Vishal | Flow
Vishal | FlowOP2mo ago
$ flow scripts execute ./my_script.cdc --args-json Address:0xc87f5f0cfd217fcd -n mainnet
:x: Command Error: error parsing script arguments: invalid character 'A' looking for beginning of value
$ flow scripts execute ./my_script.cdc --args-json Address:0xc87f5f0cfd217fcd -n mainnet
:x: Command Error: error parsing script arguments: invalid character 'A' looking for beginning of value
Giovanni S
Giovanni S2mo ago
try this
flow scripts execute ./my_script.cdc 0xc87f5f0cfd217fcd -n mainnet
flow scripts execute ./my_script.cdc 0xc87f5f0cfd217fcd -n mainnet
Vishal | Flow
Vishal | FlowOP2mo ago
works! thank you - for mulitple arguments, should that just be a comma separated list?
Giovanni S
Giovanni S2mo ago
they can just be separated by spaces e.g.
flow scripts execute ./my_script.cdc 0xc87f5f0cfd217fcd 0x12345 -n mainnet
flow scripts execute ./my_script.cdc 0xc87f5f0cfd217fcd 0x12345 -n mainnet
Vishal | Flow
Vishal | FlowOP2mo ago
thank you!
Want results from more Discord servers?
Add your server