Assert / Assert_eq
Leo provides assert and assert_eq for runtime checks. If an assertion fails, the entire transaction is rejected - no state changes take effect.
leo
assert(amount > 0u64); // Fails if amount is zero
assert_eq(self.caller, owner); // Fails if caller isn't the owner
assert_neq(sender, receiver); // Fails if sender equals receiver
These are your primary tools for access control, input validation, and invariant enforcement. Unlike Solidity's require, failed assertions in Aleo don't consume gas - the transaction simply doesn't produce a valid proof.