Skip to main content

require

Function require 

Source
pub fn require(cond: bool, message: &[u8])
Expand description

Rolls back the transaction if the condition is not met

§Arguments

  • cond - The condition to check
  • message - The error message to display on rollback

§Example

require(amount > 0, b"Amount must be positive");