Users can lose value in emergency state
The emergency withdrawal function reverts because the WAVAX reserve was already used to provide liquidity, and users do not receive their LP tokens either, so they lose their entire deposit.
Submitted by cmichel, also found by static
Imagine the following sequence of events:
LaunchEvent.createPair()is called which setswavaxReserve = 0, adds liquidity to the pair and receiveslpSupplyLP tokens.LaunchEvent.allowEmergencyWithdraw()is called which enters emergency / paused mode and disallows normal withdrawals.- Users can only call
LaunchEvent.emergencyWithdrawwhich reverts as the WAVAX reserve was already used to provide liquidity and cannot be paid out. Users don’t receive their LP tokens either. The users lost their entire deposit in this case.
Recommendation
Consider paying out LP tokens in emergencyWithdraw.
cryptofish7 (Trader Joe) confirmed and commented:
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the emergencyWithdraw function attempts to pay out WAVAX that is no longer available because it was used to provide liquidity, and it does not transfer the LP tokens instead.
Impact
Users could lose their entire deposit because emergencyWithdraw reverts and they do not receive their LP tokens.
What the attacker needed
CreatePair called; allowEmergencyWithdraw called; users attempt emergencyWithdraw
The fix
The fix was to pay out LP tokens in emergencyWithdraw, as confirmed by the project.
How it was found
- Call LaunchEvent.createPair() which sets wavaxReserve = 0, adds liquidity to the pair and receives lpSupply LP tokens.
- Call LaunchEvent.allowEmergencyWithdraw() to enter emergency/paused mode and disallow normal withdrawals.
- Users call LaunchEvent.emergencyWithdraw which reverts because the WAVAX reserve was used for liquidity and cannot be paid out; users do not receive their LP tokens.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a smart contract, users deposit funds and receive tokens representing their share. If the contract enters an emergency mode, users should be able to withdraw their original tokens. Here, the emergency withdrawal fails and users get nothing back, losing their deposit.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.