IMToken
Inherits: IContinuousIndexing, IERC20Extended
Author: M^0 Labs
Functions
mint
Mints tokens.
Parameters
account
address
The address of account to mint to.
amount
uint256
The amount of M Token to mint.
burn
Burns tokens.
Parameters
account
address
The address of account to burn from.
amount
uint256
The amount of M Token to burn.
startEarning
Starts earning for caller if allowed by TTG.
stopEarning
Stops earning for caller.
stopEarning
Stops earning for account
.
MUST revert if account
is an approved earner in TTG Registrar.
Parameters
account
address
The account to stop earning for.
minterGateway
The address of the Minter Gateway contract.
ttgRegistrar
The address of the TTG Registrar contract.
rateModel
The address of TTG approved earner rate model.
earnerRate
The current value of earner rate in basis points.
principalBalanceOf
The principal of an earner M token balance.
Parameters
account
address
The account to get the principal balance of.
Returns
<none>
uint240
The principal balance of the account.
principalOfTotalEarningSupply
The principal of the total earning supply of M Token.
totalEarningSupply
The total earning supply of M Token.
totalNonEarningSupply
The total non-earning supply of M Token.
isEarning
Checks if account is an earner.
Parameters
account
address
The account to check.
Returns
<none>
bool
True if account is an earner, false otherwise.
Events
StartedEarning
Emitted when account starts being an M earner.
Parameters
account
address
The account that started earning.
StoppedEarning
Emitted when account stops being an M earner.
Parameters
account
address
The account that stopped earning.
Errors
InsufficientBalance
Emitted when there is insufficient balance to decrement from account
.
Parameters
account
address
The account with insufficient balance.
rawBalance
uint256
The raw balance of the account.
amount
uint256
The amount to decrement the rawBalance
by.
IsApprovedEarner
Emitted when calling stopEarning
for an account approved as earner by TTG.
NotApprovedEarner
Emitted when calling startEarning
for an account not approved as earner by TTG.
NotMinterGateway
Emitted when calling mint
, burn
not by Minter Gateway.
OverflowsPrincipalOfTotalSupply
Emitted when principal of total supply (earning and non-earning) will overflow a type(uint112).max
.
ZeroMinterGateway
Emitted in constructor if Minter Gateway is 0x0.
ZeroTTGRegistrar
Emitted in constructor if TTG Registrar is 0x0.