Christmas Dinner

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

Use of transfer() function may cause refunds to fail

Summary

The contract uses the transfer() function for ETH refunds, which forwards only 2,300 gas. This hard-coded gas limit can cause refunds to fail if the receiving address is a contract with complex logic in its receive function.

Vulnerability Details

The _refundETH function uses the transfer() method:
ChristmasDinner.sol#L235

function _refundETH(address payable _to) internal {
uint256 refundValue = etherBalance[_to];
_to.transfer(refundValue);
etherBalance[_to] = 0;
}

Impact

  • ETH refunds may fail for contract addresses

Tools Used

  • Manual code review

  • Performing formal verification with Quint

Recommendations

Replace transfer() with the recommended call() pattern

Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year 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.

Give us feedback!