To remove splitter from controller, we first check that if the balance of splitter is not zero and also balance is not equal to 'principalDeposits', then we call the'splitRewards
function to distribute the rewards among the fee receivers. However, the issue here is that we still have to withdraw
the exact same balance amount to the splitter owner's address.
Let us have a splitter contract with the balance of 100 LST and the total deposit of 90; the 10 LST is for rewards distribution.
So here the balance = 100 LST
and principalDeposits = 90 LST
are not equal, we need to distribute the rewards.
Here at Line 138
we still try to withdraw 100 LST; in fact, we do not have 100 LST available in balance.
Therefor it will revert and not allow the owner to remove the splitter.
POC : add the following test case inside test/core/lst-rewards-splitter.test.ts
:
and run with command : npx hardhat test test/core/lst-rewards-splitter.test.ts
.
The owner will not be able to withdraw the reward splitter due to wrong amount provided in withdraw functions.
Manual review
before withdrawal fetch the latest amount available for withdraw.
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.