Live on Ethereum Mainnet

On-chain assertions
for safe governance

Verify view function return values and blockchain state atomically. If any assertion fails, the entire transaction reverts.

Why Assertions?

Production-grade on-chain guards for every critical transaction.

DAO Proposals

Embed pre/post-conditions in governance proposals. If a malicious or buggy proposal breaks invariants, the entire transaction reverts atomically.

Safe Transactions

Batch assertion calls alongside your Safe multisig transactions. Verify balances, oracle prices, and permissions before and after execution.

Invariant Enforcement

Unlike off-chain simulations that can be fooled by MEV, on-chain assertions execute atomically. No partial execution, no unexpected outcomes.

Build an Assertion

Configure your assertion and get ready-to-use code in your language.

View Function Return
On-Chain State
Contract

Use Cases

Guard every critical scenario in your protocol.

Treasury Protection

Assert treasury balance doesn't drop below threshold

Permission Safety

Assert admin roles haven't been changed unexpectedly

Price Manipulation Guards

Assert oracle price is within expected bounds

Upgrade Verification

Assert proxy implementation matches expected codehash

Timelock Validation

Assert current timestamp is after unlock period

Liquidity Checks

Assert pool reserves meet minimum requirements

Ownership Verification

Assert critical contracts still owned by DAO

API Reference

All functions have overloaded versions accepting a custom error message.

Uint256 Assertions 7
assertEqCallUint Assert return equals expected
assertNeCallUint Assert return not equals expected
assertGtCallUint Assert return > expected
assertLtCallUint Assert return < expected
assertGeCallUint Assert return >= expected
assertLeCallUint Assert return <= expected
assertApproxEqCallUint Assert return ≈ expected (within delta)
Address Assertions 2
assertEqCallAddress Assert return equals expected address
assertNeCallAddress Assert return not equals expected address
Bool Assertions 3
assertEqCallBool Assert return equals expected bool
assertTrue Assert return is true
assertFalse Assert return is false
Bytes32 Assertions 2
assertEqCallBytes32 Assert return equals expected bytes32
assertNeCallBytes32 Assert return not equals expected bytes32
Tuple-Indexed (N suffix) 10
assertEqCallUintN Assert specific tuple element (uint256)
assertGtCallUintN Assert tuple element > expected
assertLtCallUintN Assert tuple element < expected
assertGeCallUintN Assert tuple element >= expected
assertLeCallUintN Assert tuple element <= expected
assertEqCallAddressN Assert tuple element (address)
assertEqCallBoolN Assert tuple element (bool)
assertEqCallBytes32N Assert tuple element (bytes32)
assertEqCallStringN Assert tuple element (string)
assertApproxEqCallUintN Assert tuple element ≈ expected
Array Assertions 3
assertEqCallArrayLength Assert array length equals expected
assertGtCallArrayLength Assert array length > expected
assertGeCallArrayLength Assert array length >= expected
Balance Assertions 6
assertEqBalance Assert native balance equals expected
assertGtBalance Assert native balance > expected
assertLtBalance Assert native balance < expected
assertGeBalance Assert native balance >= expected
assertLeBalance Assert native balance <= expected
assertApproxEqBalance Assert native balance ≈ expected
Block Assertions 10
assertEqBlockNumber Assert block.number equals expected
assertGtBlockNumber Assert block.number > expected
assertLtBlockNumber Assert block.number < expected
assertGeBlockNumber Assert block.number >= expected
assertLeBlockNumber Assert block.number <= expected
assertEqBlockTimestamp Assert block.timestamp equals expected
assertGtBlockTimestamp Assert block.timestamp > expected
assertLtBlockTimestamp Assert block.timestamp < expected
assertGeBlockTimestamp Assert block.timestamp >= expected
assertLeBlockTimestamp Assert block.timestamp <= expected
Chain & Contract 4
assertEqChainId Assert chain ID equals expected
assertHasCode Assert address has deployed code
assertNoCode Assert address has no code
assertEqCodeHash Assert address has specific code hash