Christmas Dinner

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

The `ChristmasDinner::_refundETH` function uses `transfer()` instead of `call()`.

Description

The function ChristmasDinner::_refundETH in charge of refunding the ETH uses transfer() instead of call().

Impact

Depending on the user (if decided to participate using a smart contract wallet), the use of transfer might render ETH impossible to withdraw due to the 2300 forwarded gas limitation.

Proof of Concepts

Recommended mitigation

Add the following change to the code.

function _refundETH(address payable _to) internal {
uint256 refundValue = etherBalance[_to];
+ _to.call{value: refundValue}("");
- _to.transfer(refundValue);
etherBalance[_to] = 0;
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 8 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.