TSender

Cyfrin
DeFiFoundry
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

Possible out of gas DoS due to wrong input of gas

Summary

Use of gas() is not optimal.

Vulnerability Details

In both calls gas() is used to specify the gas limit for the given call. How ever using gas() means the call will consume all available gas up to the block gas limit. If a function makes multiple calls using gas() set to the maximum available gas, it could potentially exhaust all the gas available for the transaction, leaving none for subsequent operations or for the transaction itself to succeed.

if iszero(call(gas(), tokenAddress, 0, 0x00, 0x64, 0, 0)) {
mstore(0x00, 0xfa10ea06) // cast sig "TSender__TransferFailed()"
revert(0x1c, 0x04)
}
if iszero(call(gas(), tokenAddress, 0, 0x00, 0x44, 0, 0)) {
mstore(0x00, 0xfa10ea06) // cast sig "TSender__TransferFailed()"
revert(0x1c, 0x04)
}

Impact

Could lead to reverts due to out of gas errors.

Tools Used

Manual review

Recommendations

It is recommended to specify the optimal amount of gas to be used for each call.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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