Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

deadrxsezzz - USDT will get permanently stuck in FootiumPrizeDistributor.sol and FootiumEscrow.sol #75

Closed
sherlock-admin opened this issue May 5, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented May 5, 2023

deadrxsezzz

medium

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#setApprovalForERC20 FootiumEscrow.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

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

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels May 10, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant