Module lido::token[][src]

Expand description

Types to make working with token balances safer.

These wrapper types serve a few purposes:

  • Having distinct types for SOL and stSOL makes it harder to accidentally perform nonsensical operations on them, such as adding SOL to stSOL.
  • The wrapper types implement only checked arithmetic, so if you use them, you can’t forget to check for overflow.
  • More subtle logic, such as multiplication with a rational, only has to be implemented once, so the code working with these types can focus on getting the formulas right, rather than the checked arithmetic bookkeeping.

Structs

Error returned when a calculation in a token type overflows, underflows, or divides by zero.

Type Definitions