Skip to content

feat(core): add ERC-4337 security analysis - #118

Open
OmniZlatoon wants to merge 2 commits into
StellarChainproof:masterfrom
OmniZlatoon:feat/erc4337-security-rules
Open

feat(core): add ERC-4337 security analysis#118
OmniZlatoon wants to merge 2 commits into
StellarChainproof:masterfrom
OmniZlatoon:feat/erc4337-security-rules

Conversation

@OmniZlatoon

Copy link
Copy Markdown

Description

Added version-aware ERC-4337 security analysis for smart accounts, EntryPoints, factories, aggregators, paymasters, modules, session keys, upgrade paths, and fallback handling.

The implementation provides bounded deterministic analysis, structured evidence, assumptions, confidence levels, stable finding IDs, CLI/server/VS Code/GitHub Action configuration, fixtures, tests, OpenAPI updates, and documentation.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Files Modified

  • packages/core/src/erc4337/
  • packages/core/src/scanner.ts
  • packages/core/src/types.ts
  • packages/core/src/config.ts
  • packages/core/src/index.ts
  • packages/core/src/__tests__/scanner.test.ts
  • packages/cli/src/cli.ts
  • packages/server/src/routes/scan.ts
  • packages/server/src/rules-registry.ts
  • packages/server/openapi.yaml
  • packages/github-action/src/action.ts
  • packages/github-action/action.yml
  • packages/vscode-extension/src/extension.ts
  • packages/vscode-extension/package.json
  • examples/contracts/erc4337/
  • docs/erc-4337-rules.md

Testing

  • Tested locally
  • Added unit tests
  • Tested on Stellar Testnet (for wallet/contract changes)

Validation completed:

  • npm run build
  • npm test
  • npm run test:ci --workspace=packages/core
  • npm run docs --workspace=@chainproof/core

Results:

  • All workspace builds passed
  • 292 core tests passed
  • Core coverage passed at 81.48% statements
  • API documentation generated successfully

Note: npm run lint is currently blocked because the repository has no ESLint configuration.

Code Quality checks

  • TypeScript compilation passes
  • Core tests pass
  • Workspace tests pass
  • Core coverage tests pass
  • API documentation build passes
  • ESLint passes

Behavioural Changes

  • ERC-4337 findings are included automatically in standard scans.
  • Supports EntryPoint adapter versions 0.6, 0.7, and 0.8.
  • Detects hash-binding, replay, nonce, validation, aggregation, paymaster, factory, module, session-key, upgrade, and fallback risks.
  • Adds deterministic diagnostic ordering and configurable analysis limits.
  • Exposes ERC-4337 options through the core API, CLI, server, GitHub Action, and VS Code extension.
  • Adds stable CP-4337-* finding IDs with evidence, assumptions, and confidence metadata.

Related Issues

Closes #88

@OmniZlatoon

Copy link
Copy Markdown
Author

Good day @Nanle-code , please kindly review the PR

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.

Add ERC-4337 Account Abstraction and Paymaster Security Rules

1 participant