IMinterGateway
Inherits: IContinuousIndexing, IERC712
Author: M^0 Labs
Functions
updateCollateral
Updates collateral for minters
Parameters
Returns
proposeRetrieval
Proposes retrieval of minter's off-chain collateral
Parameters
Returns
proposeMint
Proposes minting of M tokens
Parameters
Returns
mintM
Executes minting of M tokens
Parameters
Returns
burnM
Burns M tokens
If amount to burn is greater than minter's owedM including penalties, burn all up to owedM.
Parameters
Returns
burnM
Burns M tokens
If amount to burn is greater than minter's owedM including penalties, burn all up to owedM.
Parameters
Returns
cancelMint
Cancels minting request for selected minter by validator
Parameters
freezeMinter
Freezes minter
Parameters
Returns
activateMinter
Activate an approved minter.
MUST revert if minter
is not recorded as an approved minter in TTG Registrar.
MUST revert if minter
has been deactivated.
Parameters
deactivateMinter
Deactivates an active minter.
MUST revert if the minter is still approved.
MUST revert if the minter is not active.
Parameters
Returns
mToken
The address of M token
ttgRegistrar
The address of TTG Registrar contract.
ttgVault
The address of TTG Vault contract.
minterRate
The last saved value of Minter rate.
principalOfTotalActiveOwedM
The principal of total owed M for all active minters.
totalActiveOwedM
The total owed M for all active minters.
totalInactiveOwedM
The total owed M for all inactive minters.
totalOwedM
The total owed M for all minters.
excessOwedM
The difference between total owed M and M token total supply.
principalOfActiveOwedMOf
The principal of active owed M of minter.
activeOwedMOf
The active owed M of minter.
maxAllowedActiveOwedMOf
The max allowed active owed M of minter taking into account collateral amount and retrieval proposals.
This is the only present value that requires a uint256
since it is the result of a multiplication between a uint240
and a value that has a max of 65,000
(the mint ratio).
inactiveOwedMOf
The inactive owed M of deactivated minter.
collateralOf
The collateral of a given minter.
collateralUpdateTimestampOf
The timestamp of the last collateral update of minter.
collateralPenaltyDeadlineOf
The timestamp after which an additional penalty for a missed update interval will be charged.
collateralExpiryTimestampOf
The timestamp after which the minter's collateral is assumed to be 0 due to a missed update.
penalizedUntilOf
The timestamp until which minter is already penalized for missed collateral updates.
latestProposedRetrievalTimestampOf
The timestamp when minter
created their latest retrieval proposal.
getLastSignatureTimestamp
Returns the last signature timestamp used by validator
to update collateral for minter
.
Parameters
Returns
getUpdateCollateralDigest
Returns the EIP-712 digest for updateCollateral method.
Parameters
mintProposalOf
The mint proposal of minters, only 1 active proposal per minter
pendingCollateralRetrievalOf
The amount of a pending retrieval request for an active minter.
totalPendingCollateralRetrievalOf
The total amount of pending retrieval requests for an active minter.
frozenUntilOf
The timestamp when minter becomes unfrozen after being frozen by validator.
isActiveMinter
Checks if minter was activated after approval by TTG
isDeactivatedMinter
Checks if minter was deactivated after removal by TTG
isFrozenMinter
Checks if minter was frozen by validator
isMinterApproved
Checks if minter was approved by TTG
isValidatorApproved
Checks if validator was approved by TTG
mintDelay
The delay between mint proposal creation and its earliest execution.
mintTTL
The time while mint request can still be processed before it is considered expired.
minterFreezeTime
The freeze time for minter.
mintRatio
The allowed activeOwedM to collateral ratio.
penaltyRate
The % that defines penalty amount for missed collateral updates or excessive owedM value
rateModel
The smart contract that defines the minter rate.
updateCollateralInterval
The interval that defines the required frequency of collateral updates.
updateCollateralValidatorThreshold
The number of signatures required for successful collateral update.
ONE
Descaler for variables in basis points. Effectively, 100% in basis points.
MAX_MINT_RATIO
Mint ratio cap. 650% in basis points.
MIN_UPDATE_COLLATERAL_INTERVAL
Update collateral interval lower cap in seconds.
UPDATE_COLLATERAL_TYPEHASH
The EIP-712 typehash for the updateCollateral
method.
Events
BurnExecuted
Emitted when M tokens are burned and an inactive minter's owed M balance decreased.
Parameters
BurnExecuted
Emitted when M tokens are burned and an active minter's owed M balance decreased.
Parameters
CollateralUpdated
Emitted when a minter's collateral is updated.
Parameters
MinterActivated
Emitted when a minter is activated.
Parameters
MinterDeactivated
Emitted when a minter is deactivated.
Parameters
MinterFrozen
Emitted when a minter is frozen.
Parameters
MintCanceled
Emitted when a mint proposal is canceled.
Parameters
MintExecuted
Emitted when a mint proposal is executed.
Parameters
MintProposed
Emitted when a mint proposal is created.
Parameters
MissedIntervalsPenaltyImposed
Emitted when a penalty is imposed on minter
for missed update collateral intervals.
Parameters
UndercollateralizedPenaltyImposed
Emitted when a penalty is imposed on minter
for undercollateralization.
Parameters
RetrievalCreated
Emitted when a collateral retrieval proposal is created.
Parameters
RetrievalResolved
Emitted when a collateral retrieval proposal is resolved.
Parameters
Errors
DeactivatedMinter
Emitted when calling activateMinter
with a minter who was previously deactivated.
ExceedsMaxRepayAmount
Emitted when repay will burn more M than the repay specified.
ExpiredMintProposal
Emitted when calling mintM
with a proposal that was created more than mintDelay + mintTTL
time ago.
FrozenMinter
Emitted when calling mintM
or proposeMint
by a minter who was frozen by validator.
FutureTimestamp
Emitted when calling updateCollateral
with any validator timestamp in the future.
InactiveMinter
Emitted when calling a function only allowed for active minters.
InvalidMintProposal
Emitted when calling cancelMint
or mintM
with invalid mintId
.
InvalidSignatureOrder
Emitted when calling updateCollateral
if validators
addresses are not ordered in ascending order.
NotApprovedMinter
Emitted when calling activateMinter
if minter was not approved by TTG.
NotApprovedValidator
Emitted when calling cancelMint
or freezeMinter
if validator
was not approved by TTG.
NotEnoughValidSignatures
Emitted when calling updateCollateral
if validatorThreshold
of signatures was not reached.
OverflowsPrincipalOfTotalOwedM
Emitted when principal of total owed M (active and inactive) will overflow a type(uint112).max
.
PendingMintProposal
Emitted when calling mintM
if mintDelay
time has not passed yet.
RetrievalsExceedCollateral
Emitted when calling proposeRetrieval
if sum of all outstanding retrievals Plus new proposed retrieval amount is greater than collateral.
SignatureArrayLengthsMismatch
Emitted when calling updateCollateral
If validators
, signatures
, timestamps
lengths do not match.
StaleCollateralUpdate
Emitted when updating collateral with a timestamp earlier than allowed.
OutdatedValidatorTimestamp
Emitted when calling updateCollateral
with any validator timestamp older than the last signature timestamp for that minter and validator.
StillApprovedMinter
Emitted when calling deactivateMinter
with a minter still approved in TTG Registrar.
Undercollateralized
Emitted when calling proposeMint
, mintM
, proposeRetrieval
If minter position becomes undercollateralized.
activeOwedM
is a uint256
because it may represent some resulting owed M from computations.
ZeroBurnAmount
Emitted when calling burnM
if amount is 0.
ZeroMToken
Emitted in constructor if M Token is 0x0.
ZeroMintAmount
Emitted when calling proposeMint
if amount is 0.
ZeroMintDestination
Emitted when calling proposeMint
if destination is 0x0.
ZeroRetrievalAmount
Emitted when calling proposeRetrieval
if collateral is 0.
ZeroTTGRegistrar
Emitted in constructor if TTG Registrar is 0x0.
ZeroTTGVault
Emitted in constructor if TTG Distribution Vault is set to 0x0 in TTG Registrar.
ZeroTimestamp
Emitted when calling updateCollateral
with any validator timestamp of 0.