Beginner Tutorial and Resource for Terra Developer
cargo generate --git https://github.com/CosmWasm/cosmwasm-template.git --branch 0.16 --name your-project-name
cargo build
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer:0.11.5
Array in Cosmwasm has hard limit of 128bits or 10,000 element.
/// Max key length for db_write/db_read/db_remove/db_scan (when VM reads the key argument from Wasm memory)
const MAX_LENGTH_DB_KEY: usize = 64 * KI;
/// Max value length for db_write (when VM reads the value argument from Wasm memory)
const MAX_LENGTH_DB_VALUE: usize = 128 * KI;
Keep in mind the terra blockchain has gas limit for read so that pose limitation for reading/writing large element.
Terra has tax for moving native asset that are not LUNA so contracts shouldn't move native asset in many hops or it will incur an loss.