# Deterministic address squatting blocks deploy

Factory or clone creation that reverts permanently once an attacker pre-creates the derived address

_Area: Smart contract access control and control flow. Seen in 3 disclosed reports; latest 2025-02-03. Updated 2026-11-09._

## How it works
A factory derives a child contract's address deterministically — from the factory's own address plus a nonce (CREATE) or from a salt plus an implementation address (CREATE2). The attacker can compute that address before the factory deploys, then act on it first: register it in an external registry, or redeploy bytecode at it. The factory's later deploy or its follow-up registration then reverts, and because the nonce or salt is fixed, every retry reverts the same way. The broken assumption is that a derived address is free until the factory uses it; in fact anyone can occupy or reference it first.

## Where it shows up
- Factory calls `Clones.clone` (CREATE, nonce-derived) and then registers the child in an external contract keyed by address, e.g. `UniswapV2Factory.createPair` [E2](https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md)
- External registry has an existence check (`require(!exists)`) that turns a pre-registered address into a permanent revert [E2](https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md)
- `cloneDeterministic`/CREATE2 where the address depends only on an implementation address and salt [E3](https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md)
- Implementation contracts that can `selfdestruct` or be replaced, making the CREATE2 key mutable [E3](https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md)
- CREATE-derived addresses used as identity in cross-contract messages or dispute games, where a reorg can reorder deployments and swap addresses [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md)
- Fixes that bind a call to a hash but not to the contract instance or position [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md)

## How to review
For every derived address, ask: can an outside party act on this address before the factory does, and does any downstream call revert if they did? The invariant: factory deployment and all follow-up registrations must succeed regardless of prior state at the derived address, or the address must be unpredictable to outsiders (e.g. salt includes `msg.sender` and a value the attacker cannot front-run). For CREATE2, verify the implementation cannot selfdestruct or be swapped. For CREATE, verify identity is not assumed stable across reorgs, and that any binding check covers contract instance and position, not just one field [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md).

## How finders spotted it
- Traced `createLaunchPad` into `UniswapV2Factory.createPair`, saw `Clones.clone` uses CREATE with a predictable nonce, computed the token address, then confirmed Uniswap's `PAIR_EXISTS` require makes the call revert [E2](https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md)
- Read `boreWell`/`cloneDeterministic`, saw the CREATE2 address depends only on implementation and salt, and combined that with knowledge of the metamorphic-contract technique [E3](https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md)
- Read `move()` and the factory's clone deployment, noticed the new `_claim` parameter binds only the disputed claim hash, not game identity or position, and reasoned that CREATE nonce addresses plus reorg reordering break the binding [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md)

## Variants seen
- Pre-registering the derived address in an external registry so the factory's registration reverts forever [E2](https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md)
- Metamorphic redeploy at a CREATE2 implementation address, silently changing logic behind an existing clone [E3](https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md)
- Reorg reordering CREATE deployments, swapping game addresses so an honest move lands in the wrong game [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md)

## Impact and severity
Permanent denial of service on factory deployment [E2](https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md); silent logic substitution behind existing clones [E3](https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md); loss of an honest challenger's bond when a move lands in the wrong game after a reorg [E1](https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md). Severity rises with permanence (fixed nonce/salt means no retry path) and with whether funds or bonds are at stake.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AM-09.md
- E2: https://bugbountylibrary.com/r/c4%3A2024-12-lambowin%3AH-02.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-07-basin%3AM-09.md
