You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
sherlock-admin opened this issue
May 5, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
USDT will get permanently stuck in FootiumPrizeDistributor.sol and FootiumEscrow.sol
Summary
As stated in the docs, the contracts are stated to work with any ERC20 tokens. If USDT or any USDT-like tokens are sent to FootiumPrizeDistributor.sol and FootiumEscrow.sol, they will be forever stuck.
Vulnerability Detail
FootiumEscrow.sol and FootiumPrizeDistributor.sol use such IERC20/IERC20Upgradeable interfaces, that expect a boolean to be returned from the transfer method. USDT, for example, doesn't return such value. When calling FootiumEscrow.sol#setApprovalForERC20FootiumEscrow.sol#transferERC20 and FootiumPrizeDistributor.sol#claimERC20Prize the address of the token is expected to comply with the IERC20 interface. Since USDT doesn't comply with the interface the transactions will revert. Any USDT-like sent to any of the two contracts mentioned will get permanently lost.
Note:
Since USDT does not return a boolean when .transferFrom is called, but the ERC20 interface used defines that there will be a boolean returned, the compiler will check whether the returndatasize() is 32 bytes (one word size) and revert if this is not true.
Impact
Permanent loss of any USDT/ USDT-like tokens sent to FootiumPrizeDistributor.sol and FootiumEscrow.sol
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
deadrxsezzz
medium
USDT will get permanently stuck in
FootiumPrizeDistributor.sol
andFootiumEscrow.sol
Summary
As stated in the docs, the contracts are stated to work with any ERC20 tokens. If USDT or any USDT-like tokens are sent to
FootiumPrizeDistributor.sol
andFootiumEscrow.sol
, they will be forever stuck.Vulnerability Detail
FootiumEscrow.sol
andFootiumPrizeDistributor.sol
use suchIERC20/IERC20Upgradeable
interfaces, that expect a boolean to be returned from thetransfer
method. USDT, for example, doesn't return such value. When callingFootiumEscrow.sol#setApprovalForERC20
FootiumEscrow.sol#transferERC20
andFootiumPrizeDistributor.sol#claimERC20Prize
the address of the token is expected to comply with theIERC20
interface. SinceUSDT
doesn't comply with the interface the transactions will revert. Any USDT-like sent to any of the two contracts mentioned will get permanently lost.Note:
Since USDT does not return a boolean when .transferFrom is called, but the ERC20 interface used defines that there will be a boolean returned, the compiler will check whether the returndatasize() is 32 bytes (one word size) and revert if this is not true.
Impact
Permanent loss of any USDT/ USDT-like tokens sent to
FootiumPrizeDistributor.sol
andFootiumEscrow.sol
Code Snippet
https://github.com/sherlock-audit/2023-04-footium/blob/main/footium-eth-shareable/contracts/FootiumPrizeDistributor.sol#L106
https://github.com/sherlock-audit/2023-04-footium/blob/main/footium-eth-shareable/contracts/FootiumEscrow.sol#L106
https://github.com/sherlock-audit/2023-04-footium/blob/main/footium-eth-shareable/contracts/FootiumEscrow.sol#L76
Tool used
Manual Review
Recommendation
Do not use IERC20 interface. Also, use SafeERC20 library
Duplicate of #14
The text was updated successfully, but these errors were encountered: