The claimRewards
function inside the LiquidationPool
contract can be used by stakers to claim their rewards. These rewards can be arbitrary ERC-20 tokens that were used as collateral. It uses the transfer
function to send the tokens to the user. This function does not check the return value of the transfer
function. This could lead to loss of funds for the user if the token does not implement the ERC-20 specification correctly.
Here we can see that the claimRewards
function uses transfer
instead of safeTransfer
:
Tokens not compliant with the ERC20 specification could return false from the transfer function call to indicate the transfer fails, while the calling contract would not notice the failure if the return value is not checked. Therefore, not using safeTransfer here could lead to loss of funds for the user. As the rewards are deleted right before the transfer and therefore the user is not able to claim them again in case of a failure.
Loss of user funds.
Use safeTransfer
instead of transfer
and allow users to claim specific rewards in case one is failing constantly.
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.