Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Source of MsgCall argument types (rev 5)

sha256 3b3c9f16e40ef9fe6f9a1314c7e5103fbf2ca9561901311640bb075548dc383f

`MsgCall` encodes every argument as a string and converts it on the chain.
That conversion covers the primitive types and **not** slices.

A function whose exported signature takes `[]address`, `[]int` or any other
slice cannot be reached from a wallet at all. The simulation does not report a
polite error, it panics inside the VM:

    unexpected slice type in contract arg
    gno.land/pkg/sdk/vm/convert.go:223

The workaround at the call site is `MsgRun`, which is restricted on mainnet by
the `run_submitters` parameter, so in practice it is not one.

The workaround at the *design* site is the fix: take a delimited string and
split it in the realm. Several realms in this namespace already do
(`Init(proposalNamesCSV string)`, `Setup(ownersCSV string, thresholdN int)`),
which is why they are callable and their slice-taking neighbours are not.

← back to the article