20,000 USDC
View results
Submission Details
Severity: medium

use of transfer() instead of call() to send eth

Summary

The transfer function is not recommended for sending native token due to its, 2300 gas unit limit. Instead, call can be used to circumvent the gas limit.

Vulnerability Details

Any smart contract that uses transfer() or send() is taking a hard dependency on gas costs by forwarding a fixed amount of gas: 2300.

Impact

Use of transfer() can cause funds impossible to withdraw because after istanbul hardfork , there is increases in the gas cost of the SLOAD operation and therefore breaks some existing smart contracts.
Those contracts will break because their fallback functions used to consume less than 2300 gas, and they’ll now consume more, since 2300 the amount of gas a contract’s fallback function receives if it’s called via Solidity’s transfer() or send() methods.

Tools Used

Manual Code Review

Recommendations

Use call instead of transfer for sending native token.

Support

FAQs

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