The availableWithdrawLimit
function currently does not account for liquidity restrictions, which may lead the contract to assume that all assets are immediately available for withdrawal, while in reality, some assets may not be liquid or may be locked. This oversight could cause issues where users believe they can withdraw their full balance, but due to liquidity constraints, they cannot.
https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L217
The current implementation directly returns the sum of the contract's asset balance and the unexchanged balance without considering liquidity limitations. This means that the function does not take into account the possibility that some assets may not be available for immediate withdrawal due to liquidity constraints, freezing, or other restrictions, especially for unexchanged funds.
The current availableWithdrawLimit
implementation ignores liquidity constraints, unexchanged funds, and possibly locked assets within the contract. As a result, the contract might assume all assets are available for immediate withdrawal, but some assets might actually be illiquid, frozen, or not yet converted to available funds. This could lead to users facing discrepancies between the amount they believe they can withdraw and the actual amount they can access.
Manual review
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.