Module agora.common.Amount

Defines a monetary type used in the blockchain

This struct can hold an amount between 0 and 4_950_000_000 * 10^7, as there is an absolute maximum supply of 4_950_000_000 coins and each coin can be divided in up to 10^7 units.

This type exposes two ways to do binary operation: - The ideal way is to use a.{add,sub,div,...}(b); Those methods return a bool which indicates if the operation was successful, and will mutate a. If the operation is unsuccessful, an invalid value is set on a, so subsequent operations will fail too; - When convenience is prefered, such as in test code, operator overloads are available. However, those operator overloads will throw an Exception if an overflow / underflow happens, which means they are less performant and aren't pure nothrow @nogc;

Functions

NameDescription
coins(num_coins) Make an Amount with the number of coins

Structs

NameDescription
Amount Defines a monetary type used in the blockchain