In standard ERC20 token contracts, particularly those meant to mimic stablecoins like USDC, there is typically a maximum supply cap. This cap ensures that the total number of tokens in circulation cannot exceed a predefined limit, preserving the token's scarcity and economic model.
The MockUSDC contract contains a mint function that lacks any validation against a maximum supply. Furthermore, because the mint function has no access control, any external user can invoke it. This allows any actor to increase the totalSupply arbitrarily, bypassing the intended economic constraints of the token.
Likelihood:High
Reason 1: The mint function is completely unrestricted (external with no modifiers); therefore, any wallet or contract interacting with the blockchain can call it.
Reason 2: The lack of a supply cap means the function will always succeed as long as the caller has enough gas, regardless of how many tokens have already been minted.
Impact:High
Economic Collapse: An attacker can mint trillions of tokens, causing hyperinflation. This renders the token valueless and destroys the trust of any users holding the token.
Protocol Exploitation: If this token is used as a currency or collateral in other DeFi protocols (e.g., lending markets, DEXs), an attacker can mint a massive supply to manipulate prices, drain liquidity pools, or borrow against fabricated value.
The following Foundry test demonstrates that there is no maximum supply. It shows that:
Any user (Alice) can mint a huge amount.
The total supply increases cumulatively with no upper bound.
Test Result:
To fix this issue, introduce a constant maximum supply and add a validation check inside the mint function. Additionally, restrict access to the mint function to prevent unauthorized minting.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.