$ account eth-infinitism
This repository is the canonical reference implementation of ERC-4337 (Ethereum Account Abstraction) by the standard's authors. It provides a singleton EntryPoint contract that coordinates validation, execution, and gas accounting for UserOperations. The codebase includes abstract base contracts for accounts and paymasters, production-grade sample accounts (SimpleAccount, Simple7702Account), libraries for packed UserOperation hashing and EIP-7702 support, and extensive test and simulation infrastructure. It is deployed on Ethereum mainnet and supports paymasters, signature aggregators, counterfactual deployment via CREATE2, and EIP-7702 delegated code. The architecture is modular: core logic is separated into libraries (UserOperationLib, Helpers, Exec, Eip7702Support) and abstract contracts (BaseAccount, BasePaymaster, StakeManager, NonceManager) that can be reused in custom implementations. Gas optimization is a key focus, with patterns like transient storage, packed storage, and a custom nonReentrant guard. While the repo is tightly coupled to the EntryPoint's design, individual libraries and base contracts are reusable in any ERC-4337 integration.