The emergencyWithdraw
function is implemented in a way that transfers the entire token balance held by the contract to the treasury when the contract is paused. This design fails to differentiate between protocol funds (collected fees
) and user-owned
rewards, resulting in the risk of inadvertently transferring user assets along with protocol funds.
The function retrieves the entire token balance of the contract using raacToken.balanceOf(address(this))
(or for other tokens) and transfers it to the treasury. This operation does not consider the separation between funds intended for protocol operations and funds allocated for user rewards.
The emergency withdrawal mechanism does not account for the amounts already allocated or earmarked for user rewards (as maintained in mappings such as collectedFees
or userRewards
). This oversight means that user funds, which should be claimable separately, might be permanently redirected to the treasury.
Loss of User Rewards:
Users may lose access to their rewards if an emergency withdrawal is executed, as their assets will be mistakenly transferred to the treasury.
Manual Code Review
Implement a clear segregation between protocol funds and user rewards.
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.