IMToken
Inherits: IContinuousIndexing, IERC20Extended
Author: M^0 Labs
Functions
mint
Mints tokens.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of account to mint to. |
|
| The amount of M Token to mint. |
burn
Burns tokens.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of account to burn from. |
|
| 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
Name | Type | Description |
---|---|---|
|
| 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
Name | Type | Description |
---|---|---|
|
| The account to get the principal balance of. |
Returns
Name | Type | Description |
---|---|---|
|
| 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
Name | Type | Description |
---|---|---|
|
| The account to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if account is an earner, false otherwise. |
Events
StartedEarning
Emitted when account starts being an M earner.
Parameters
Name | Type | Description |
---|---|---|
|
| The account that started earning. |
StoppedEarning
Emitted when account stops being an M earner.
Parameters
Name | Type | Description |
---|---|---|
|
| The account that stopped earning. |
Errors
InsufficientBalance
Emitted when there is insufficient balance to decrement from account
.
Parameters
Name | Type | Description |
---|---|---|
|
| The account with insufficient balance. |
|
| The raw balance of the account. |
|
| The amount to decrement the |
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.