Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 567 Bytes

File metadata and controls

22 lines (17 loc) · 567 Bytes

88 - Assert

The assert function creates an error of type Panic(uint256).

Assert should only be used to test for internal errors, and to check invariants.

Properly functioning code should never create a Panic, not even on invalid external input.


Slide Screenshot

088.jpg


Slide Deck

  • assert() -> Panic(uint256)
  • Internal Errors
  • Check Invariants
  • Normal Code -> No Panic
  • assert() vs. require()

References