#[require]
Attribute macro for adding precondition checks to functions.
#[require(amount > 0, error = MyError::InvalidAmount)] fn transfer(amount: u64) -> Result<()> { // Function body Ok(()) }