Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Sending ETH via transfer

Description

transfer: This was once the simplest and safest way to send Ether, as it automatically reverts the transaction if the call fails. However, it is better to sent ETH via call specially if the receiver is smart contract or smart wallet.

Risk

transfer only forwards a fixed amount of gas (2300), which may not be enough for more complex operations in the receiving contract/wallet. This limitation has led to transfer being considered less safe, as it can lead to unexpected behavior if the receiving contract's fallback function consumes more than 2300 gas.


Recommended Mitigation

function withdraw(address target) external onlyOwner {
(bool success, ) = payable(target).call{value: address(this).balance}("");
require(success, "Transfer failed");
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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