IMToken

Git Source

Inherits: IContinuousIndexing, IERC20Extended

Author: M^0 Labs

Functions

mint

Mints tokens.

function mint(address account, uint256 amount) external;

Parameters

Name
Type
Description

account

address

The address of account to mint to.

amount

uint256

The amount of M Token to mint.

burn

Burns tokens.

function burn(address account, uint256 amount) external;

Parameters

Name
Type
Description

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.

function startEarning() external;

stopEarning

Stops earning for caller.

function stopEarning() external;

stopEarning

Stops earning for account.

MUST revert if account is an approved earner in TTG Registrar.

function stopEarning(address account) external;

Parameters

Name
Type
Description

account

address

The account to stop earning for.

minterGateway

The address of the Minter Gateway contract.

function minterGateway() external view returns (address);

ttgRegistrar

The address of the TTG Registrar contract.

function ttgRegistrar() external view returns (address);

rateModel

The address of TTG approved earner rate model.

function rateModel() external view returns (address);

earnerRate

The current value of earner rate in basis points.

function earnerRate() external view returns (uint32);

principalBalanceOf

The principal of an earner M token balance.

function principalBalanceOf(address account) external view returns (uint240);

Parameters

Name
Type
Description

account

address

The account to get the principal balance of.

Returns

Name
Type
Description

<none>

uint240

The principal balance of the account.

principalOfTotalEarningSupply

The principal of the total earning supply of M Token.

function principalOfTotalEarningSupply() external view returns (uint112);

totalEarningSupply

The total earning supply of M Token.

function totalEarningSupply() external view returns (uint240);

totalNonEarningSupply

The total non-earning supply of M Token.

function totalNonEarningSupply() external view returns (uint240);

isEarning

Checks if account is an earner.

function isEarning(address account) external view returns (bool);

Parameters

Name
Type
Description

account

address

The account to check.

Returns

Name
Type
Description

<none>

bool

True if account is an earner, false otherwise.

Events

StartedEarning

Emitted when account starts being an M earner.

event StartedEarning(address indexed account);

Parameters

Name
Type
Description

account

address

The account that started earning.

StoppedEarning

Emitted when account stops being an M earner.

event StoppedEarning(address indexed account);

Parameters

Name
Type
Description

account

address

The account that stopped earning.

Errors

InsufficientBalance

Emitted when there is insufficient balance to decrement from account.

error InsufficientBalance(address account, uint256 rawBalance, uint256 amount);

Parameters

Name
Type
Description

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.

error IsApprovedEarner();

NotApprovedEarner

Emitted when calling startEarning for an account not approved as earner by TTG.

error NotApprovedEarner();

NotMinterGateway

Emitted when calling mint, burn not by Minter Gateway.

error NotMinterGateway();

OverflowsPrincipalOfTotalSupply

Emitted when principal of total supply (earning and non-earning) will overflow a type(uint112).max.

error OverflowsPrincipalOfTotalSupply();

ZeroMinterGateway

Emitted in constructor if Minter Gateway is 0x0.

error ZeroMinterGateway();

ZeroTTGRegistrar

Emitted in constructor if TTG Registrar is 0x0.

error ZeroTTGRegistrar();

Copyright 2024 M^0 Foundation