The transfer()
and send()
functions forward a fixed amount of 2300 gas. The gas cost of EVM instructions may change significantly during hard forks which may break already deployed contract systems that make fixed assumptions about gas costs. For example. EIP 1884 broke several existing smart contracts due to a cost increase of the SLOAD instruction.
In TokenManager.sol , withdraw() function there it checks if the tokenAddress
of the token that will be withdrawn is wrappedNativeToken
. If it is it calls the transfer()
function with address payable.
Also in tillIn()
function which is used to transfer the msg.sender
tokens to the capitalAddress
, _safe_transfer()
function is used if _tokenAddress == wrappedNativeToken
. The _safe_transfer() is part of the Rescuable.sol
contract which is not in scope, but it has the same vulnerability because it uses the transfer
method in form of TRANSFER_SELECTOR being called.
The transfer() function only allows the recipient to use 2300 gas. If the recipient uses more than that, transfers will fail. In the future gas costs might change increasing the likelihood of that happening.
Possible cases :
The claimer smart contract does not implement a payable function; does implement a payable fallback which uses more than 2300 gas unit or implements a payable fallback function that needs less than 2300 gas units but is called through proxy; raising the call's gas usage above 2300;
Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.
Manual Review
Use call() instead of transfer() to transfer native tokens.
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.