Cambrian provides built-in primitives for booleans, integers, text, bytes,
and addresses.
Type Values
booltrue, false
Type Range Typical use
u80…255 Flags, small counters
u160…65 535 Small IDs
u320…2³²−1 Medium IDs
u640…2⁶⁴−1 General counters
u1280…2¹²⁸−1 Large counters
usizeuint256 on EVM, Nat on LeanCollection indices
On EVM, narrow integers keep their declared Solidity widths (uint8, …) in
structs and storage. Widened uint256 results from arithmetic / timestamps /
msg::value are narrowed with casts only when the binding requires it.
i8, i16, i32, i64, i128 — available when negative values are needed.
Type EVM type Use
U256uint256Token amounts, balances, wide math
m_balance: U256 {
in deposit(amount) => m_balance + amount
}
Type Description
StringUTF-8 text
bytesRaw byte sequence (b"…" literals)
bytes32Fixed 32-byte value (hashes)
String↔number conversion is never implicit — use std::str::parse_* /
std::str::format (Standard Library ).
Type Description
addressParty or entity address
Prefer Address<Entity> when sending named messages — see
Generic Types .
Type Notes
pubkeyA 256-bit key value (bytes32 on EVM). It is not part of the EVM message/system context — prefer address and msg::sender for access control.
Type Common use
boolFlags, conditions
u8…u128, i8…i128Counters, IDs, offsets
U256Balances and amounts
String / bytesText and payloads
addressCallers and destinations