# Factory deploy reverts instead of returning address when account already exists

Bug Deep Dive #32 · 4 January 2026

Bug Deep Dives · [The Contest Academy](https://0xsimao.com/the-contest-academy) · 0xSimao

---

| Title | Factory deploy reverts instead of returning address when account already exists |
| Reward | $5882, Unique |
| Contest | Sequence - 7 October 2025 on Code4rena |
| Author | pfapostol |
| Context | ERC4337 |

The `Factory.deploy` function uses `create2` to deploy a wallet, but reverts with `CreateCollision` if the address already exists.

Per ERC-4337, factories that use deterministic creation **must return the account address even if the account was already created** ([**eip-4337**](https://eips.ethereum.org/EIPS/eip-4337#first-time-account-creation)) so that bundlers and `entryPoint.getSenderAddress()` can obtain the counterfactual address without failing. The implementation breaks that invariant: calling the factory when the account already exists reverts instead of returning the existing address, which breaks ERC-4337 flows — simulations, `getSenderAddress`, bundler logic and the user experience.

Sequence's wallet implementation and README both expect ERC-4337 compatibility, implementing `validateUserOp` and the rest, so the factory's behaviour matters for integration: [**README#erc-4337-integration**](https://github.com/code-423n4/2025-10-sequence?tab=readme-ov-file#erc-4337-integration)**.**

**Alpha:** an ERC-4337 factory must not revert when asked for the account address, even if the account already exists.

**Conclusion**

This finding would earn you **\$5882**, and requires mostly ERC-4337 knowledge.

[**Full Report**](https://code4rena.com/reports/2025-10-sequence#m-04-factory-deploy-reverts-instead-of-returning-address-when-account-already-exists)\
[**Codebase**](https://github.com/code-423n4/2025-10-sequence/tree/b0e5fb15bf6735ec9aaba02f5eca28a7882d815d?tab=readme-ov-file)

---

Newer: [LP pool cap may be exceeded on drawing settlement](https://0xsimao.com/the-contest-academy/bug-deep-dive-33) · Older: [Static signatures bound to caller revert under ERC-4337, causing DoS](https://0xsimao.com/the-contest-academy/bug-deep-dive-31)
