Skip to main content

Can a Contract with a High Gas Limit Still Be Safe from Reentrancy?

Yes, a contract with a high gas limit can still be safe from reentrancy, but only if it implements explicit reentrancy protection. Since the gas limit imposed by transfer() is bypassed, the developer must use a reentrancy guard (a mutex-like state variable) or strictly adhere to the Checks-Effects-Interactions (CEI) pattern.

The high gas limit is necessary for functionality, but the security must be handled manually through robust, well-audited logic, as the gas-limit defense is no longer available.

Does a Smart Contract Inherently Create an Explicit Agreement?
What Is the Checks-Effects-Interactions Pattern and How Does It Prevent Reentrancy?
How Does the Checks-Effects-Interactions Pattern Prevent Reentrancy Attacks?
Why Is Updating State before an External Call the Critical Part of the CEI Pattern?