Calldata format
In the Dojo ecosystem, several tools or configuration files like sozo
and the dojo_<PROFILE>.toml
file require some calldata to be provided. This page describes the format which is expected for these calldata.
By default, any calldata value is a Cairo felt or any type that fits into one felt.
To be decoded as other Cairo types, calldata values must be prefixed. Here is a list of available prefixes:
Prefix | Description | Example |
---|---|---|
u256 | a 256-bit unsigned integer | u256:0x1234 |
str | a Cairo string (ByteArray) | str:'hello world' |
sstr | a Cairo short string | sstr:'hello world' |
int | a signed integer that fits into a i128 | int:0x1234 |
arr | a dynamic array of values that fits into one felt | arr:0x01,0x02,0x03 |
u256arr | a dynamic array of 256-bit unsigned integers | u256arr:0x01,0x02,0x03 |
farr | a fixed-size array of values that fits into one felt | farr:0x01,0x02,0x03 |
u256farr | a fixed-size array of 256-bit unsigned integers | u256farr:0x01,0x02,0x03 |