Skip to content

assertions

On-chain assertions backed by the assertions.eth contract: verify view return values and chain state atomically. Requires load assertions.

load assertions

Config variables are set with set (fully qualified, including the module prefix) and are only readable by their own module and the user script.

VariableTypeDefaultDescription
$assertions:addressaddressOverride the resolved assertions contract address (forks / testing).
CommandDescription
assertions:assertAssert that a contract view return satisfies a comparison, on-chain.
assertions:assert-balanceAssert the native balance of an account, on-chain.
assertions:assert-block-numberAssert the current block number, on-chain.
assertions:assert-chainidAssert the chain ID equals an expected value, on-chain.
assertions:assert-codeAssert an address has deployed code, on-chain.
assertions:assert-codehashAssert an address has a specific code hash, on-chain.
assertions:assert-no-codeAssert an address has no deployed code, on-chain.
assertions:assert-timestampAssert the current block timestamp, on-chain.
HelperReturnsDescription
@assertions:codehashbytes32Read the keccak256 code hash of an address.