Skip to content

@assertions:len!

The decoded length of the dynamic return value of a call, on-chain: element count for arrays, byte length for string/bytes.

Returns: number

@assertions:len!(call)
NameTypeDescription
calladdressA :: call expression (or chain) returning an array, string or bytes
load assertions
set $gov 0xc0dbDcA66a0636236fAbe1B3C16B1bD4C84bB1E1
# Top level: compiles to the core assert*CallArrayLength family (all six operators)
assertions:assert @len!($gov::{voters()(address[])}) >= 3 "not enough voters"
assertions:assert @len!($gov::{voters()(address[])}) != 0
# Nested: compiles to Combinators.arrayLengthCall, composable as a number
assertions:assert @num!(@len!($gov::{voters()(address[])}) * 2) > 4
  • For a string/bytes return the decoded length is the byte length (UTF-8 characters may span multiple bytes). For raw returndata size use @assertions:bytelen!.