Assertions
An assertion is a condition which must evaluate to the Boolean value of true and its purpose is to prevent undesirable computation when the condition is evaluated to false.
For example, a function may only work if the condition argument < 5 is true. We can use an assertion to enforce this condition by:
- Forcing a revert in the program when 
5 <= argument - Handling the exception with additional code
 
Handling exceptions may be done through if expressions therefore the following sections will take a look at how we can make the virtual machine revert (safely crash).
assert: Checks if aconditionistrueotherwise revertsrequire: Checks if aconditionistrueotherwise logs avalueand revertsrevert: Reverts the virtual machine with the provided exit codeassert_eq: Checks ifaandbare equal otherwise revertsassert_ne: Checks ifaandbare not equal otherwise reverts