StakingPool
's and OperatorVCS
's calculation of total fees in the getStrategyRewards
function results in double-counting of fees on the depositChange
.
It´s because getPendingFees
in the OperatorVCS
strategy already includes fees calculated on the depositChange
, and the getStrategyRewards
function in StakingPool
adds both the depositChange
and getPendingFees
together and then applies additional fees on the totalRewards
.
This leads to the same amount being included twice in the fee calculations, resulting in incorrect total fees.
The getStrategyRewards
function in StakingPool
is intended to return the total rewards and total fees for a set of strategies.
It calculates totalRewards
by summing up the depositChange
from each strategy and totalFees
by summing up the getPendingFee
from each strategy.
However, the issue arises because getPendingFees
in OperatorVCS
already includes fees calculated on the depositChange
(L:143).
Specifically, it adds the fees calculated on depositChange
to totalFees:
In getStrategyRewards
above, after summing up totalRewards
and totalFees
from all strategies, it again calculates fees on totalRewards
and adds them to totalFees
:
This results in the fees on depositChange
being calculated twice.
Incorrect fee distribution - loss of funds due to double accounting
Manual Review
Exclude the strategy-level fees from totalFees
when calculating getStrategyRewards
OR
Adjust the strategy's getPendingFees
to exclude fees on depositChange
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.