Advanced

Account Abstraction (ERC-4337) — Check your understanding

Build smart wallets.

Developer Advanced
8/8 — Account Abstraction (ERC-4337) — Check your understanding

ExplainHow bundlers, EntryPoint, wallet validation, and paymasters interact. When would you block a userOp?

Edge casesReplays, paymaster abuse, and bundler centralization need mitigation/monitoring.

function testReplayBlocked() public {
    UserOperation memory op = buildUserOp();
    bytes32 hash = entryPoint.getUserOpHash(op);
    sign(op, ownerPk, hash);
    entryPoint.handleOps(single(op), payable(this));
    vm.expectRevert("bad nonce");
    entryPoint.handleOps(single(op), payable(this));
}

Quick tests like this confirm your claims about replay and validation behavior.

Key points
  • Describe userOp fields and:Which ones you validate.
  • Explain nonce handling and:How you prevent replays.
  • State your paymaster rules:(allowlist, caps) and how you monitor spend.
  • Discuss bundler trust and:What happens if bundlers censor.
  • Outline a migration path:From EOAs to this wallet and back.
← Previous section
Next lesson →