burnM

burnM(minter,maxPrincipalAmount,maxAmount)burnM(minter,maxPrincipalAmount,maxAmount)

  • Callable by anyone wishing to burn M on behalf of minterminter

  • Decreases owedMminterowedM_{minter} by amountamount. M is subtracted from the caller of this function

  • If minterminter is active

    • Calculates current activeOwedMminteractiveOwedM_{minter} and Imposes missedCollateralUpdatePenaltymintermissedCollateralUpdatePenalty_{minter} for every missed and not yet penalized update collateral interval. Updates penalizedUntilTimestampminterpenalizedUntilTimestamp_{minter} if a penalty was imposed

    • Reduces activeOwedMminteractiveOwedM_{minter} by activeBurnAmountactiveBurnAmount activeBurnAmount=min(activeOwedMminter,amount)activeBurnAmount = min(activeOwedM_{minter}, amount) totalActiveOwedM=activeBurnAmounttotalActiveOwedM -= activeBurnAmount

      activeOwedMminter=activeBurnAmountactiveOwedM_{minter} -= activeBurnAmount

  • If minterminter is inactive and was deactivated

    • Reduces inactiveOwedMminterinactiveOwedM_{minter} by inactiveBurnAmountinactiveBurnAmount inactiveBurnAmount=min(inactiveOwedMminter,amount)inactiveBurnAmount = min(inactiveOwedM_{minter}, amount) totalInactiveOwedM=inactiveBurnAmounttotalInactiveOwedM -= inactiveBurnAmount

      inactiveOwedMminter=inactiveBurnAmountinactiveOwedM_{minter} -= inactiveBurnAmount

    • Burns activeBurnAmountactiveBurnAmount or inactiveBurnAmountinactiveBurnAmount of M from the caller of the function, e.g., msg.sendermsg.sender

    • Calls updateIndexupdateIndex.

Last updated

Copyright 2024 M^0 Foundation