Location
Found in src/ChristmasDinner.sol [Line: 235]()
Issue
Here, the contract uses .transfer() to send Ether to _to. In most cases, .transfer() is acceptable for Ether, but if this were intended for ERC20 transfers, it would be considered unsafe since many tokens do not consistently return true/false or could behave non-standardly. Although your code indicates you’re already using SafeERC20 for ERC20 tokens, this snippet specifically handles Ether transfer. It is marked here possibly due to confusion between native ETH operations and ERC20 operations.
Impact
If the intent was to manage ERC20 transfers using .transfer(), it would be prone to failure if the ERC20 token does not implement the standard transfer logic.
For native Ether, .transfer() also imposes a fixed gas stipend of 2300, which might revert if the receiving address includes fallback logic that requires more gas.
Recommendation
For ERC20: Always use OpenZeppelin’s SafeERC20.safeTransfer or safeTransferFrom to ensure consistent handling of return values.
For Ether: .transfer() is typically fine for simpler scenarios, but consider using .call{value: refundValue}("") if you want to allow the receiver more than 2300 gas (or if there is a risk of revert due to complex fallback code).
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.