The Pot::closePot
function is responsible for distributing the remaining rewards to the claimants after the contest has been closed. However, if any of the claimants are unable to receive the reward tokens, for example, due to being on a blacklist, the entire transaction will revert, preventing the contest from being closed and locking all remaining funds in the contract.
In the Pot::closePot
function, the remaining rewards are distributed to the claimants using the _transferReward
function:
The _transferReward
function is defined as follows:
If any of the claimants
are unable to receive the tokens, for example, due to being on a blacklist, the i_token.transfer
call will revert, causing the entire closePot
function to revert. This will prevent the contest from being closed, and the remaining rewards will be permanently locked in the contract.
If any of the claimants are unable to receive their reward tokens, the entire closePot
function will revert, preventing the contest from being closed and locking all remaining funds in the contract. This means that neither the claimants nor the contest manager will be able to access the locked funds.
Manual Code Review
To mitigate this issue, the _transferReward
function should be modified to handle individual failed transfers without causing the entire function to revert. One approach is to use a try-catch block to catch any exceptions and continue with the distribution of rewards to the remaining claimants.
By handling individual failed transfers in this way, the closePot
function will be able to distribute the remaining rewards to the claimants who can successfully receive them, without the entire process being blocked by a single failed transfer.
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.