The _handleWethRewardDistribution() function misallocates WETH rewards due to precision loss when performing fixed-point arithmetic using PRB-Math’s UD60x18
. The calculation:
assumes that receivedProtocolWethRewardX18 + receivedVaultsWethRewardX18
will always sum exactly to receivedWethX18
, but due to rounding errors inherent in fixed-point arithmetic, leftover
may be a small nonzero value. The contract then arbitrarily assigns this remainder to receivedVaultsWethRewardX18
, favoring vault rewards over protocol rewards in an unpredictable manner. Over multiple iterations, this rounding discrepancy accumulates, leading to persistent misallocation of WETH fees.
Incorrect WETH distribution results in protocol fee recipients and vaults receiving slightly more or less than their intended share, creating an unfair reward system and potentially leading to financial discrepancies over time.
To ensure all WETH is accounted for correctly, first compute the vault reward, then allocate the exact remaining WETH to protocol rewards:
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.