@assertions:not!
Negation computed on-chain, dispatched on the operand: logical not for booleans (stays a bool), bitwise complement of the raw 32-byte word for numbers and bytes32. Never a conversion — cast explicitly with @bytes!(x) first if needed.
Returns: any
Syntax
Section titled “Syntax”@assertions:not!(value)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value | any | Boolean (logical not) or number/bytes32 (bitwise not) |
Examples
Section titled “Examples”load assertions
set $vault 0x0102030405060708090a0b0c0d0e0f1011121314
# Logical not on a live bool — stays a boolassertions:assert @not!($vault::{paused()(bool)}) "vault is paused"
# Bitwise complement of a mask wordassertions:assert @bytes!($vault::{flags()(bytes32)} "&" @not!(0xff)) == 0 "bits set outside the low byte"- Dispatches on the operand: booleans get logical not (
unary(IsZero), result stays a bool); numbers andbytes32get the bitwise complement of their raw 32-byte word (EVMNOT). - It never converts between bool and number — bridge explicitly with
@bytes!(x)(bool → 0/1 word) or a comparison (x != 0, number → bool).
See Also
Section titled “See Also”- @assertions:bytes! for binary bitwise operations and the raw word cast