@assertions:balance!
Read a balance on-chain at assertion time: the native balance for ETH, or an ERC-20 balanceOf for any token symbol or address.
Returns: number
Syntax
Section titled “Syntax”@assertions:balance!(token account)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
token | token-symbol | ETH (native) or a token symbol/address resolved like @token |
account | address | Account address, or (native only) a :: call resolving to one |
Examples
Section titled “Examples”load assertions
# Native balance at assertion timeassertions:assert @balance!(ETH @me) > 1e18
# Token symbols resolve like @token; addresses work tooassertions:assert @balance!(WETH @me) >= 10e18assertions:assert @balance!(0x6B175474E89094C44Da98b954EedeAC495271d0F @me) >= 10e18
# Native balance of a call-resolved account (ethBalanceCall)set $registry 0x0102030405060708090a0b0c0d0e0f1011121314assertions:assert @balance!(ETH $registry::{treasury()(address)}) >= 100e18- The token argument resolves off-chain at build time (same path as
@token); the balance itself is read on-chain at assertion time. - A call-resolved account is only supported for the native token — the
combinators contract cannot route a resolved address into
balanceOf.