After creating a contest, the contest manager is expected to add rewards to it. However, due to the token address being wrapped into the IERC20 interface, this action will revert and make it impossible to fund contests with certain tokens that do not conform strictly to the ERC20 standard.
To add a reward to the pot, the manager calls the fundContest
function:
The issue arises because some tokens (e.g., USDT, BNB, OMG) do not return a boolean value on transfer operations. Wrapping these tokens in the IERC20 interface, which expects a boolean return value, will cause the transaction to revert.
The contest manager is not able to add as a reward any of the tokens that do not return a boolean on transfer.
Manual Code Review
Use the SafeERC20 library implementation from OpenZeppelin and call safeTransfer
or safeTransferFrom
when handling ERC20 tokens in both the Pot and ContestManager contracts. This will provide a more robust and compatible implementation for a variety of ERC20 token implementations.
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.