You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
To fix this issue, the inflation calculation should use the initial total supply before any inflation is minted during the transaction.
The text was updated successfully, but these errors were encountered:
sherlock-admin3
changed the title
Quaint Daffodil Copperhead - Compounded Inflation in mintInflations Function
Albort - Compounded Inflation in mintInflations Function
Oct 16, 2024
Albort
High
Compounded Inflation in
mintInflations
FunctionSummary
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
._totalSupply
from the previous iteration. This leads to a compounding effect within a single transaction.Impact
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.
The text was updated successfully, but these errors were encountered: