Skip to main content

Can a Contract’s Fallback Function Intentionally Consume More than 2,300 Gas?

Yes, a contract's fallback function can be programmed to intentionally consume more than 2,300 gas by including gas-intensive operations, such as writing to storage or executing a loop. If such a contract receives Ether via transfer or send , the transaction will revert due to an out-of-gas error in the fallback function.

This is a potential denial-of-service vector for legitimate transfers.

Does the Send Function Have the Same Gas Limitations as Transfer ?
Name a Blockchain That Is NOT Turing-Complete and Explain Why
How Have Recent Versions of Solidity Changed the Behavior of Fallback Functions to Mitigate This Risk?
Why Do Storage Operations (SSTORE) Cost More Gas than Simple Calculations?