getUnusedDeposits includes tokens that were donated to the pool
getUnusedDeposits is supposed to represent tokens that have been deposited into the stakingPool and have not yet been deployed to strategies. But they eventually get deposited into strategies when _depositLiquidity is called.
donateTokens is a function users call to send tokens to the stakingPool without minting LSTs. As a way to donate to the protocol.
The issue here is that: when getUnusedDeposits is called, it returns the balance of the stakingPool (which will include the donated tokens).
Donated tokens inflate the balance reported by getUnusedDeposits()
, making it appear that there are more idle, deployable assets than there really are. This could lead to over-deployment of tokens into strategies, causing the pool to run out of liquidity when it's needed for withdrawals or other operations.
If all the unused tokens, including donated ones, are deployed into yield strategies, the pool might lack the liquidity needed to fulfill withdrawal requests.
If donated tokens are included in strategies, they will earn yield, but because no LSTs are minted for them, the protocol won’t properly track who should be entitled to the rewards generated by these tokens.
There will be yield generated that isn’t attributed to any user, which can lead to accounting errors or even unfair allocation of rewards. This introduces complications in distributing earned rewards properly to regular depositors.
Manual Review
There should be a way to differentiate unusedDeposits from donated Tokens. Introduce a variable that tracks donated tokens. And then subtract this value when querying getUnusedDeposits :
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.