startEarning

startEarning()startEarning()

  • Callable only by minterminter on the Approved TTG earnersearners List.

  • Allows a user to start earning yield on their M balance. balanceOfuserbalanceOf_{user} will be rewritten to store principalOfEarningSupplyMToken,earnerprincipalOfEarningSupply_{MToken, earner}

    • Calculates principalOfEarningSupplyMToken,earner=balanceOfMToken,earner/indexnowprincipalOfEarningSupply_{MToken, earner} = balanceOf_{MToken, earner} / index_{now}

    • Saves totalPrincipalOfEarningSupply+=principalOfEarningSupplyMToken,earnertotalPrincipalOfEarningSupply +=principalOfEarningSupply_{MToken, earner}

    • Saves totalNonEarningSupply=balanceOfMToken,earnertotalNonEarningSupply -= balanceOf_{MToken, earner}

    • Saves balanceOfMToken,earner=principalOfEarningSupplyMToken,earnerbalanceOf_{MToken, earner} = principalOfEarningSupply_{MToken, earner}

    • Sets isEarningMToken,earner=trueisEarning_{MToken, earner}=true

    • Calls updateIndexupdateIndex.

Last updated

Copyright 2024 M^0 Foundation