Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Albort - Compounded Inflation in mintInflations Function #247

@sherlock-admin2

Description

@sherlock-admin2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions