In some cases it's necessary to interrupt the flow of execution and fail the
contract. This is where the
failwith function comes in.
The failwith function raises an error that cannot be caught, and terminates the contract.
The call to failwith should be annoted with a type as the typechecker cannot infer the correct type yet.
Assertions can be used to ensure a certain condition is met when running a
assert is used to check if a boolean condition is
assert_some is used
to check if an option value is not
None. When a condition is not met, the
contract will stop executing and display an error.