> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.getfoundry.sh/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

## Reentrancy through fixed-gas ETH transfers

:::note[Legacy lint reference]
This page is retained for existing links. The current Foundry lint registry does
not include `reentrancy-unlimited-gas`; do not select this ID in current lint
configuration. The description below documents the historical rule.
:::

**Severity**: `Info`
**ID**: `reentrancy-unlimited-gas`

### What it does

Reports a storage update or event emission that can happen after a built-in ETH `transfer` or
`send`, including zero-value transfers. This legacy rule did not cover low-level `call` operations;
review those interactions for reentrancy separately.

### Why is this bad?

The fixed stipend is not a stable reentrancy boundary. Changes to EVM opcode costs can alter which
fallback operations fit within it, so code that assumes `transfer` or `send` can never call back may
become unsafe after a network upgrade. A callback before a later state write can observe stale
state, while a callback before a later event can reorder logs consumed by off-chain systems.

Apply checks-effects-interactions: commit state and emit its corresponding event before interacting
with the recipient. Use a reentrancy guard when the interaction cannot safely be moved last.

### Example

```solidity
function withdraw(address payable recipient, uint256 amount) external {
    recipient.transfer(amount);
    balances[recipient] -= amount;
    emit Withdrawal(recipient, amount);
}
```

Use instead:

```solidity
function withdraw(address payable recipient, uint256 amount) external {
    balances[recipient] -= amount;
    emit Withdrawal(recipient, amount);
    recipient.transfer(amount);
}
```
