Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Albort - Compounded Inflation in mintInflations Function #247

Open
sherlock-admin2 opened this issue Sep 23, 2024 · 0 comments
Open

Albort - Compounded Inflation in mintInflations Function #247

sherlock-admin2 opened this issue Sep 23, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Sep 23, 2024

Albort

High

Compounded Inflation in mintInflations Function

Summary

In the mintInflations function. Specifically, the calculation of the inflation amount per epoch incorrectly uses the _totalSupply that is updated during the loop, leading to compounded inflation within the same transaction. This behavior is likely unintended and can cause the token supply to grow exponentially faster than intended.

Vulnerability Detail

Total Supply Update: The _totalSupply variable is updated during each iteration of the loop because _mint is called, which increases _totalSupply.

  • Compounding Effect: Each subsequent epoch's inflation calculation uses the updated (and increased) _totalSupply from the previous iteration. This leads to a compounding effect within a single transaction.
  • Unintended Behavior: The intended behavior is usually to calculate inflation based on the total supply at the start of each epoch, not to compound within the same transaction.

Impact

  • Excessive Inflation: The token supply grows more than intended, which can devalue the token and disrupt the tokenomics.
  • Economic Model Distortion: The compounded inflation can lead to unforeseen economic consequences, affecting stakeholders and the overall network.
  • Potential Exploitation: If an entity can trigger multiple epochs' inflation in one transaction, they might exploit this to inflate the supply disproportionately.

Code Snippet

https://github.com/sherlock-audit/2024-08-morphl2/blob/98e0ec4c5bbd0b28f3d3a9e9159d1184bc45b38d/morph/contracts/contracts/l2/system/MorphToken.sol#L120

Tool used

Manual Review

Recommendation

To fix this issue, the inflation calculation should use the initial total supply before any inflation is minted during the transaction.

@sherlock-admin3 sherlock-admin3 changed the title Quaint Daffodil Copperhead - Compounded Inflation in mintInflations Function Albort - Compounded Inflation in mintInflations Function Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant