Erc721 Erc1155 Eip712 Permit Security
ERC-4337 Account Abstraction Security: EntryPoint Storage Rules & Paymaster Griefing
Because ERC-4337 bundlers pay L1/L2 gas upfront for untrusted UserOperations, strict ERC-7562 opcode and storage-access sandboxing prevents mass mempool invalidation DoS.

In classic Ethereum, validating an EOA transaction requires checking one fixed ecrecover signature and one account balance/nonce—taking microseconds and zero arbitrary EVM execution. ERC-4337 Account Abstraction (EntryPoint v0.7 at 0x0000000071727De22E5E9d8BAf0edAc6f37da032) turns signature and gas-payment validation into arbitrary Turing-complete smart-contract execution inside validateUserOp and validatePaymasterUserOp!
Anchored in our EIP-712, Permit2 & proxy security master guide, an immediate Asymmetric DoS Trap arises: what stops an attacker from submitting 1,000 PackedUserOperations that pass off-chain bundler eth_estimateUserOperationGas simulation, then flip one shared storage variable on-chain so all 1,000 UserOps revert inside handleOps—sticking the Bundler with zero reimbursement?
ERC-7562 Validation Sandboxing: Banned Opcodes & Associated Storage#
ERC-4337 and ERC-7562 eliminate simulation-to-execution invalidation vectors by strictly partitioning every handleOps call into an isolated Validation Phase followed by an Execution Phase:
- Banned Environment Opcodes During Validation: Unless an entity (
Factory, Account, Paymaster) stakes native ETH insideEntryPoint, calling volatile environment opcodes—TIMESTAMP,NUMBER,COINBASE,PREVRANDAO,BASEFEE,GASPRICE,BLOBBASEFEE—duringvalidateUserOpis strictly forbidden by bundler tracers! (Time-bounded signatures must returnvalidAfterandvalidUntilinside packedvalidationDatasoEntryPointchecksblock.timestampdeterministically!) - Associated Storage Isolation: Unstaked smart accounts may touch only storage slots belonging to
address(account)itself (orkeccak256(abi.encode(account, slot))associated mapping slots in external ERC-20 contracts), preventing 1,000 attacker accounts from reading one shared "kill-switch" contract slot!
Three Critical Paymaster & Smart-Account Bugs in DeFi / NFT Venues#
Integrating sponsored gasless onboarding across consumer NFT drops and DEXs in our marketplaces directory (such as Basepaint, Alts By Adidas, and Art Blocks X Bright Moments) exposes custom ERC20Paymaster and VerifyingPaymaster contracts to three classic exploits:
- Exploit 1 —
userOpHashOmission ofchainIdorentryPointin Custom Signers: Always verify signatures overentryPoint.getUserOpHash(userOp), which commits to(packedUserOp, address(entryPoint), block.chainid)—never hash rawuserOp.callDataalone! - Exploit 2 — ERC-20 Paymaster Approval Revocation inside
execute(postOp Griefing): Suppose anERC20PaymasterchecksUSDC.allowance(user, paymaster) >= maxCostduringvalidatePaymasterUserOp, intending to pullUSDCinsidepostOp. During Step 3 (execute), the malicious user'scallDatacallsUSDC.approve(paymaster, 0)! In EntryPoint v0.6, a revertingpostOpcaused a dual-pass retry trap; in v0.7,ERC20Paymasters must either escrowmaxCostupfront insidevalidatePaymasterUserOpand refund the delta inpostOp, or account for reverted execution cleanly! - Exploit 3 — Inflated
callGasLimitBundler Starvation: Prior to v0.7, attackers setcallGasLimit = 5,000,000while consuming only30,000gas, packing a block with empty gas reservations so bundlers earned near-zero fees. EntryPoint v0.7 charges a10%penalty on unused execution/postOp gas exceeding40,000gas!
ERC-4337 v0.6 vs EntryPoint v0.7 Security Upgrades#
| Security / Gas Dimension | Legacy EntryPoint v0.6 | Audited EntryPoint v0.7 | Security & Cost Impact |
|---|---|---|---|
| UserOperation Struct Layout | 11 separate 32-byte fields | PackedUserOperation (bytes32 accountGasLimits) | -18% to -28% L2 calldata gas |
Unused callGasLimit Griefing | Unpenalized reservation bloat | 10% charge on unused gas > 40k | Stops bundler block-space starvation |
postOp Second-Pass Attack | Complex postOpReverted double-run | Single clean execution + postOpGasLimit | Eliminates Paymaster drainage edge cases |
| ERC-4337 Module Isolation | Ad-hoc plugin hooks | ERC-7579 Modular Smart Accounts | Standardized Validator/Executor boundaries |
EntryPoint v0.7 Prefund & 10% Unused-Gas Penalty Formula#
Auditors verify that both SmartAccount and Paymaster calculate requiredPreFund accurately, accounting for v0.7's packed accountGasLimits and 10% unused gas surcharge:
- 1) Unpacking PackedUserOperation Gas Fields:
- verificationGasLimit = uint128(bytes16(accountGasLimits))
- callGasLimit = uint128(uint256(accountGasLimits))
- maxPriorityFeePerGas = uint128(bytes16(gasFees))
- maxFeePerGas = uint128(uint256(gasFees))
- 2) Maximum Upfront EntryPoint Deposit Lock (requiredPreFund):
- maxGas = preVerificationGas + verificationGasLimit + callGasLimit + paymasterVerificationGasLimit + paymasterPostOpGasLimit
- maxPreFund = maxGas * maxFeePerGas
- 3) v0.7 Unused Execution Gas Penalty (Blocks Block-Stuffing DoS):
- unusedGas = callGasLimit - actualExecutionGasUsed
- surcharge = (unusedGas > 40,000) ? (0.10 * unusedGas) : 0
- finalBill = (actualTotalGas + surcharge) * min(maxFeePerGas, block.basefee + maxPriorityFeePerGas)
- Worked ERC20Paymaster Escrow Check ($3,000 ETH, 0.05 gwei L2 gas, maxGas = 400,000):
- Paymaster locks 0.06 USDC upfront during validatePaymasterUserOp; actual swap uses 180,000 gas (unused = 70k -> +7k penalty)
- => postOp refunds 0.031 USDC cleanly; even if user revokes USDC allowance inside execute, Paymaster loses $0.00!
Convergence With Pectra EIP-7702 Native EOA Delegation#
With Ethereum's Pectra upgrade introducing EIP-7702, existing EOAs can temporarily or persistently point their codehash to an ERC-4337 smart-account implementation without migrating assets—creating a fierce new phishing battleground analyzed next in EIP-7702 EOA code delegation security and ERC-1271 signature replay inside our EIP-712, Permit2 & Proxy Security hub.
Frequently asked questions
Why does ERC-4337 ban block.timestamp inside validateUserOp?
If validateUserOp checked require(block.timestamp < X) directly, an attacker could craft thousands of UserOps that pass off-chain simulation at t = X - 1 and all revert at t = X, exhausting bundler resources without paying gas; instead, accounts return validUntil for EntryPoint to check.
How can a malicious user drain a poorly written ERC-20 Paymaster?
If the Paymaster only checks USDC.allowance in validation and waits until postOp to call transferFrom, the user execution step can call USDC.approve(paymaster, 0) or transfer away their USDC so postOp fails to collect payment.
Why did EntryPoint v0.7 add a 10% penalty on unused callGasLimit?
Bundlers reserve block gas capacity based on declared callGasLimit; without a penalty, attackers reserved millions of unused gas units per UserOp to starve bundlers of priority-fee revenue.
How do parallel nonces work in ERC-4337 EntryPoint?
EntryPoint getNonce(sender, uint192 key) maintains an independent 64-bit sequence counter for every 192-bit key, allowing a DeFi session key on lane #1 to execute without colliding with user swaps on lane #0.
Publication record
- Published
- November 13, 2026
- Updated
- November 14, 2026
- Author
- Dr. Devon Kurosawa, PhD
- Review
- Review not recorded
- Automated fact check
- Passed in the stored pipeline record
- Source URLs
- 3 recorded
AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.
Academic & Institutional Attribution
Cite This Research & Embed Live Data Card
Standard academic & institutional research paper citation format.
Dr. Devon Kurosawa, PhD. (2026, November 14). ERC-4337 Account Abstraction Security: EntryPoint Storage Rules & Paymaster Griefing. NFTVenue Ledger. https://nftvenueledger.com/protocols/erc-4337-entrypoint-paymaster-userop-validation-griefingRelated Erc721 Erc1155 Eip712 Permit Security & Institutional Briefings
Explore Erc721 Erc1155 Eip712 Permit Security Hub (20) →Erc721 Erc1155 Eip712 Permit Security
EIP-712 Typed Signatures, Permit2 Allowances, NFT Royalties & Proxy Timelocks: 2026 Security GuideErc721 Erc1155 Eip712 Permit Security
EIP-7702 EOA Code Delegation Security: SetCode Tx Type 0x04, Sweeper Phishing & tx.originErc721 Erc1155 Eip712 Permit Security
ERC-5192 Minimal Soulbound NFTs: Non-Transferable KYC Badges, Wrapper Traps & RevocationErc721 Erc1155 Eip712 Permit Security
ERC-6551 Token-Bound Accounts (TBAs): State Nonce Frontrunning & Circular Ownership LocksErc721 Erc1155 Eip712 Permit Security
ERC-721 safeTransferFrom & onERC721Received Reentrancy: Max-Supply Bypass & Escrow DrainsErc721 Erc1155 Eip712 Permit Security
Blind-Signing Deprecation (eth_sign), Pre-Sign Transaction Simulation & EIP-7730 Clear SigningErc721 Erc1155 Eip712 Permit Security
ERC-1155 Batch Transfer Security: Mandatory Receiver Hooks, Array Mismatches & Gas-Bomb DoSErc721 Erc1155 Eip712 Permit Security
CREATE2 Metamorphic Contracts, Cancun EIP-6780 SELFDESTRUCT & Bytecode Provenance AuditsCross Chain Bridge Validator Exploits
ERC-7265 Smart-Contract Circuit Breakers: Rolling Outflow Rate Limiters & Delayed SettlementCross Chain Bridge Validator Exploits
L2 Sequencer Downtime Oracles: Chainlink Uptime Feeds, Grace Periods & L1 Force-InclusionCross Chain Bridge Validator Exploits
Foundry Stateful Invariant Fuzzing, Handler Ghost Variables & Halmos Symbolic Bytecode ProvingCross Chain Bridge Validator Exploits
Cross-Contract Flash-Swap Oracle Manipulation: Spot-Reserve Valuation & Thin-Pool Collateral Drains
NFTVenue Ledger Data, Benchmarks & Contributor Records
CC BY 4.0 Open Data
Open Institutional Datasets (CSV / JSON) →
Download desk-compiled quantitative series & schemas.
2026 Reference Matrix
2026 Institutional Benchmarks & Thresholds →
Statutory capital, clearing, margin & rate conventions.
Editorial Records
Authors & Review Records →
View named contributors where those records are available.
Complete Index
Master Research & Dossier Archive →
Browse all published briefings by topic pillar & date.
