#46677 [SC-Insight] Wrong comment in _getFAssetRequiredToNotSpoilCR
Submitted on Jun 3rd 2025 at 08:56:15 UTC by @Paludo0x for Audit Comp | Flare | FAssets
Report ID: #46677
Report Type: Smart Contract
Report severity: Insight
Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/implementation/CollateralPool.sol
Impacts:
Description
Vulnerability Details
In CollateralPool._getFAssetRequiredToNotSpoilCR, the else‐branch carries this comment:
// f-asset that preserves pool CR (assume poolNatBalance >= natShare > 0)
// solve (N - n) / (F - f) = N / F get n = N f / F
return _assetData.agentBackedFAsset.mulDiv(_natShare, _assetData.poolNatBalance);Here “N” refers to poolNatBalance, “F” to agentBackedFAsset, and “n” to the NAT withdrawn. But the code inside this branch computes
f = F * n / N This should be a copy/paste error from function _getNatRequiredToNotSpoilCR which is correct.
Proof of Concept
Proof of Concept
Snippets from relevant code
Previous#46643 [SC-Low] `destroyAgent` in `AgentsCreateDestroy` is prone to DOSNext#46681 [SC-Low] malicious actor can prevent agent from being destroyed
Was this helpful?