The function fulfillSwap calculates the protocol's share of the swap fee using:
where totalFeeRecipientsShares cannot exceed 0.9e18 according to doc
This leaves at least 10% of swapFeeX18 unaccounted for. The remaining fee is not transferred, distributed, or accessible, leading to funds being permanently locked.
The code assigns only a portion of the swap fee (swapFeeX18) to protocolSwapFeeX18:
totalFeeRecipientsShares is capped at 0.9e18, meaning maximum 90% of swapFeeX18 is accounted for.
The remaining swapFeeX18 (10% or more) is never transferred or distributed, resulting in a permanent lock.
This will lead to lost funds over time.
The unhandled portion of swapFeeX18 remains locked in the contract.
Either distribute the entire swapFeeX18 to fee recipients or save the remaining fee to vault's wethRewardDistribution after converting the asset to WETH
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.