#L70 uses .transfer()
to send ether to other addresses. There are a number of issues with using .transfer()
, as it can fail for a number of reasons (specified in the Proof of Concept).
The destination is a smart contract that doesn’t implement a payable
function or it implements a payable
function but that function uses more than 2300 gas units.
The destination is a smart contract that doesn’t implement a payable
fallback
function or it implements a payable
fallback
function but that function uses more than 2300 gas units.
The destination is a smart contract but that smart contract is called via an intermediate proxy contract increasing the case requirements to more than 2300 gas units. A further example of unknown destination complexity is that of a multisig wallet that as part of its operation uses more than 2300 gas units.
Future changes or forks in Ethereum result in higher gas fees than transfer provides. The .transfer()
creates a hard dependency on 2300 gas units being appropriate now and into the future.
other instances:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/TokenManager.sol#L169
If a user falls into one of the above categories, they'll be unable to receive funds
Instead use the .call()
function to transfer ether and avoid some of the limitations of .transfer()
. This would be accomplished by changing payEther() to something like;
Gas units can also be passed to the .call() function as a variable to accomodate any uses edge cases. Gas could be a mutable state variable that can be set by the contract owner.
Invalid, known issues [Medium-2](https://github.com/Cyfrin/2024-08-tadle/issues/1)
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.