#46081 [SC-Medium] Wrong check in `redeemFromCoreVault` will result in unnecessary revert
Submitted on May 24th 2025 at 15:35:31 UTC by @aman for Audit Comp | Flare | FAssets
Report ID: #46081
Report Type: Smart Contract
Report severity: Medium
Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/library/CoreVault.sol
Impacts:
Temporary freezing of funds for at least 1 hour
Temporary freezing of funds for at least 24 hour
Contract fails to deliver promised returns, but doesn't lose value
Description
Brief/Intro
The CoreVault redemption process checks available lots before fee deduction, which can cause unnecessary reverts. When a user requests redemption, the system checks if there are enough available lots in CoreVault before deducting the redemption fee. This is inefficient because after fee deduction, the actual amount needed would be less, potentially allowing the redemption to proceed. This leads to unnecessary redemption failures.
Vulnerability Details
The issue occurs in the redeemFromCoreVault function where the available lots check happens before fee deduction:
The problem is that the system:
Checks available lots against full redemption amount
Deducts fee after the check
Impact Details
The impact is significant because:
Users cannot redeem when they should be able to
Unnecessary transaction failures
References
CoreVault.sol::redeemFromCoreVault
Mitigation :
The Best Fix would be to apply the following changes:
Proof of Concept
Proof of Concept
Add the Following test case to CoreVault.ts and run with command yarn testHH
The above test case will revert , But after apply the fix than run the 2nd test case it will be executed successfully
Was this helpful?