#47034 [SC-Medium] check minting cap function checks on incorrect amount in mintFromFreeUnderlying function
Submitted on Jun 8th 2025 at 08:28:57 UTC by @swarun for Audit Comp | Flare | FAssets
Report ID: #47034
Report Type: Smart Contract
Report severity: Medium
Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/library/Minting.sol
Impacts:
Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Description
Brief/Intro
check minting cap function checks on incorrect amount in mintFromFreeUnderlying function because it doesn't takes into account the amount that will be minted because of the pool fee.
Vulnerability Details
In the mint from free underlying function there is a check minting cap call which ensures that the minted amount should be less than the minting cap set but in mint from free underlying function it doesn't take into account the amount that will be minted because of the pool fee. in the proof of concept i have clearly shown where the pool fees has not been included.
Impact Details
It causes an important invariant to fail as it will allow more than minting cap to be minted.
References
https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L129
Proof of Concept
Proof of Concept
The agent vault owner calls the self mint function and following is mint from free underlying function
We can see there is a checkMintingCap(valueAMG) and valueAMG = _lots*Globals.getSettings().lotSizeAMG;
Then we can see pool fee being calculated as follows poolFeeUBA = calculateCurrentPoolFeeUBA(agent, mintValueUBA);
Then in perform minting function we can see that the poolfeeuba is also minted to the pool _performMinting(agent, MintingType.SELF_MINT, 0, msg.sender, valueAMG, 0, poolFeeUBA);
Was this helpful?