sherlock-audit / 2023-02-kairos-judging

2 stars 0 forks source link

SPYBOY - safeTransfer is recommended instead of transfer #156

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

SPYBOY

medium

safeTransfer is recommended instead of transfer

Summary

Vulnerability Detail

Impact

ERC20 standard allows transfer function of some contracts to return bool or return nothing. Some tokens such as USDT return nothing. This could lead to funds stuck in the contract without the possibility to retrieve them. Using safeTransfer of SafeERC20.sol is recommended instead.

Code Snippet

transfer function : https://github.com/kairos-loan/kairos-contracts/blob/ce49230ab5255662d287c4944229cf411725de3f/src/utils/Erc20CheckedTransfer.sol#L16

Tool used

Manual Review

Recommendation

Using safeTransfer of SafeERC20.sol is recommended instead.

Duplicate of #1