Skip to content
Audit finding Beginner

Comments above reserveCollateral indicate collateral reservation fee is burned, which is not the case

The comments above the reserveCollateral function state that the collateral reservation fee is burned when the minter pays the underlying amount, but the code actually distributes the fee to the collateral pool and vault pool. This is a documentation error that could mislead users about fee handling.

ni8mare Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#45485 [SC-Insight] Comments above `reserveCollateral` indicate collateral reservation fee is burned, which is not the case

Submitted on May 15th 2025 at 11:56:14 UTC by @ni8mare for Audit Comp | Flare | FAssets

Description

Brief/Intro

As the title suggests, comments above reserveCollateral indicate collateral reservation fee is burnt, which is not the case.

Vulnerability Details

Look at the comments above the reserveCollateral function in CollateralReservationsFacet:

Solidity
     * If the minter pays the underlying amount, the collateral reservation fee is burned and minter obtains
     * f-assets. Otherwise the agent collects the collateral reservation fee.

But this is not the case. The collateral reservation fee is not burned. The collateral reservation fee is instead distributed to the vault pool and the collateral pool. This can be seen when executeMinting is called:

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L66-L70

Solidity
        CollateralReservations.distributeCollateralReservationFee(agent,
            crt.reservationFeeNatWei + unclaimedExecutorFee);
        // cleanup
        CollateralReservations.releaseCollateralReservation(crt, _crtId);   // crt can't be used after this
Solidity
     function distributeCollateralReservationFee(
        Agent.State storage _agent,
        uint256 _fee
    )
        internal
    {
        if (_fee == 0) return;
        uint256 poolFeeShare = _fee.mulBips(_agent.poolFeeShareBIPS);
        _agent.collateralPool.depositNat{value: poolFeeShare}();
        IIAgentVault(_agent.vaultAddress()).depositNat{value: _fee - poolFeeShare}(Globals.getWNat());
    }

Fees are not burned here, instead sent to the collateral pool and vault pool using the distributeCollateralReservationFee function.

Impact Details

Misleading explanation of the functionality of the code in the comments/docs

References

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/facets/CollateralReservationsFacet.sol#L23-L24

Proof of Concept

Proof of Concept

We suggest that the protocol change the comment to say that the fees are not actually burnt, but instead sent to the collateral and vault pools when the minting is successful. The current comments do not suggest the same and hence are misleading.

The original report as published on Immunefi, by ni8mare. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the comment was not updated when the fee distribution logic changed, so it no longer matches the code.

Impact

The misleading comment could cause confusion about fee handling, but no direct security impact is claimed.

What the attacker needed

None

The fix

The comment should be updated to state that the fee is sent to the collateral and vault pools, not burned.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This report is about a misleading comment in a smart contract. The comment says a fee is destroyed (burned), but the code actually sends it to two pools. Someone reading the comment might think the fee disappears, when it is really redistributed.

More by ni8mare

View all

8 more disclosed reports, best first.

More from Flare | FAssets

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.