The strategyWithdraw function allows the contract owner to manually withdraw tokens from a strategy without burning the corresponding liquid staking tokens or updating the totalStaked variable. This violates the expected behavior of the staking pool, where any withdrawal should be accompanied by a proportional reduction in the liquid staking token supply and the total staked amount.
How it happens:
The contract owner calls the strategyWithdraw function, specifying the index of the strategy, the amount to withdraw, and any additional withdrawal data.
The function checks if the strategy exists at the given index.
If the strategy exists, it calls the withdraw function of the strategy contract with the specified amount and withdrawal data.
The withdrawn tokens are transferred back to the staking pool contract.
However, the function does not burn any liquid staking tokens or update the totalStaked variable to reflect the withdrawal.
Lack of proper accounting and token burning logic within the strategyWithdraw function. When the contract owner calls this function, specifying the strategy index, withdrawal amount, and any necessary withdrawal data, the function directly interacts with the strategy contract to withdraw the tokens. However, it fails to update the totalStaked variable and does not burn any liquid staking tokens, leading to an inconsistency between the actual staked amount and the liquid staking token supply.
The totalStaked variable will not accurately represent the total amount of tokens staked in the pool, as it is not updated when tokens are withdrawn through strategyWithdraw.
Since the liquid staking tokens are not burned during the withdrawal, the total supply of these tokens will remain unchanged, effectively inflating the token supply relative to the actual staked amount.
Vs Code
Burn the corresponding amount of liquid staking tokens when withdrawing from a strategy.
Update the totalStaked variable to reflect the decrease in the total staked amount.
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.