Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

Unsafe ERC20 Operations Used

Description: The contract uses unsafe ERC20 operations that may not behave as expected. Some ERC20 implementations have inconsistent return value behaviors.

_to.transfer(refundValue);

Impact:

  • Potential silent failures in token transfers

  • Inconsistent behavior across different token implementations

  • Risk of failed transactions without proper error handling

Recommended Mitigation: Implement OpenZeppelin's SafeERC20 library for all ERC20 operations:

import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
using SafeERC20 for IERC20;
function _refundERC20(address _to) internal {
i_WETH.safeTransfer(_to, balances[_to][address(i_WETH)]);
i_WBTC.safeTransfer(_to, balances[_to][address(i_WBTC)]);
i_USDC.safeTransfer(_to, balances[_to][address(i_USDC)]);
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

transfer instead of call

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

transfer instead of call

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.