Move CLI command line --args for vector<u8>

I’m trying to figure out how to pass vector args into the “move run” command. This is what I’m doing:

move run src/scripts/create.move --signers 0xf --args “111111” “111111” // works! (for some reason)

move run src/scripts/create.move --signers 0xf --args “000000” “111111” //
Execution failed with unexpected error FAILED_TO_DESERIALIZE_ARGUMENT

move run src/scripts/create.move --signers 0xf --args b"11111" b"11111"
error: Invalid value for ‘–args …’: unexpected token Name(“b11111”), expected transaction argument

Let me know if there’s some documentation on this. Thanks!

Good question; we need to improve the documentation on this [Bug] move run --args needs explanation in modules and scripts doc · Issue #8008 · diem/diem · GitHub.

  • To pass a hexadecimal string, the syntax is (e.g.) 'x"0012" (will parse as the vector { 0x00, 0x12 })
  • To pass an ASCII string, the syntax is (e.g.) ‘b"hi"’ (will parse as the vector { 0x68, 0x69 })
  • The CLI does not currently support passing vectors of other types on the command line. But the VM supports vectors of bools, u64's, and several other types.
2 Likes