Skip to content

Conversation

@Aboudjem
Copy link
Contributor

ERC-4337 Account Abstraction Implementation

This PR adds ERC-4337 (Account Abstraction) support to onchain-id Identity contracts with comprehensive testing infrastructure using Foundry.

Changes Made

🔧 Foundry Setup

  • Added Foundry configuration (foundry.toml) with optimized compiler settings
  • Configured remappings for dependencies (@account-abstraction, @OpenZeppelin, forge-std)
  • Updated .gitignore to exclude Foundry artifacts (out/, cache/)

🧪 Test Infrastructure

  • UserOpBuilder Library: Helper contract for constructing and signing ERC-4337 UserOperations

  • Target Mock Contract: Test contract for validating execution flows

  • Comprehensive Test Suites:

    • IdentityAA.t.sol: 11 tests covering validation, nonce management, EntryPoint interaction, and signature verification
    • IdentityAA_Batch.t.sol: 9 tests for batch execution functionality
    • All tests passing (20/20 ✅)

📝 Documentation

  • Added IMPLEMENTATION_GUIDE.md with detailed technical overview
  • Includes architecture diagrams, security considerations, and integration guides
  • Documents key purpose (5) for AA signers and execution bypass patterns

🔄 Contract Updates

  • Updated pragma statements in IdentityUtilities contracts for Foundry compatibility
  • Modified hardhat.config.ts and package.json to support dual testing framework

Technical Notes

Hardhat v3: Not included in this PR due to significant breaking changes. Recommend handling the Hardhat v3 upgrade in a separate branch to avoid complicating the ERC-4337 implementation review.

Testing Framework: Currently using Foundry for ERC-4337 tests. Foundry provides better tooling for testing Account Abstraction patterns (UserOperation simulation, EntryPoint integration, gas reporting).

Next Steps

  • Review and merge ERC-4337 implementation
  • Address Hardhat v3 upgrade in separate PR
  • Consider adding additional edge case tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant