Users' tokens can be stuck inside LaunchEvent if the token doesn't revert on failed transfers #252
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
UncleGrandpa925
Vulnerability details
Impact
Users' tokens can be stuck inside LaunchEvent if the token doesn't revert on failed transfers.
Issue
When users call
withdrawIncentives
, if for any reasons the token transfer fails & the token doesn't revert but only returns a boolean, the user's incentives will be stuck. This is because oncewithdrawIncentives
is called,user.hasWithdrawnIncentives
will be set to true & therefore prevents the user from calling the function a second time.Only 2 solutions are possible: either the issurer trigger emergency (which will crash the event), or the issurer can call skim & get back the tokens from the PenaltyCollector to manually distribute it to the user.
Recommended Mitigation Steps
Use OZ's SafeTransfer
The text was updated successfully, but these errors were encountered: