Send ether with call instead of transfer
The smart contract uses `transfer` to send ether, which can fail if the recipient is a contract with a costly fallback function. An attacker could cause ether transfers to fail, potentially locking funds or disrupting payouts.
Submitted by kenta, also found by Dravee, hyh, Jujic, leastwood, and z3s
Use call instead of transfer to send ether. And return value must be checked if sending ether is successful or not. Sending ether with the transfer is no longer recommended.
Proof of Concept
Recommended Mitigation Steps
(bool result, ) = payable(_account).call{value: _amount}(""); require(result, “Failed to send Ether”);
kphed (Redacted Cartel) confirmed
Alex the Entreprenerd (judge) commented:
I believe the function would actually work with most Smart Contract Wallets and proxies. However this could change in the future.
Agree with the finding.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract uses `transfer` to send ether, which forwards a fixed low amount of gas and can fail for contracts with complex fallback functions.
Impact
Ether transfers could fail for some smart contract wallets or proxies, potentially blocking payouts, though the judge noted it would work with most current wallets.
What the attacker needed
Recipient is a contract with costly fallback
The fix
The fix is to use `call` to send ether and check the return value, as shown in the recommended mitigation.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a smart contract sends ether, it can use `transfer` or `call`. `transfer` only forwards a small amount of gas, so if the recipient is a contract that needs more gas to accept the payment, the transfer fails. This report says the code should use `call` instead and check that it succeeded.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.