Skip to content

refactor(contracts): rename confusing NotAnAdmin error to AccountNotAdmin ♻️ #26

@Klazomenai

Description

@Klazomenai

Problem

Two custom errors have near-identical names:

  • NotAdmin (line 17) — "caller is not an admin" (used by onlyAdmin modifier)
  • NotAnAdmin (line 20) — "target account is not an admin" (used by removeAdmin)

These names are confusing when reading ABI error selectors or debugging reverts. Integrators can't distinguish them at a glance.

Found during security audit (2026-03-23).

Acceptance Criteria

  • NotAnAdmin renamed to AccountNotAdmin (or TargetNotAdmin)
  • All references updated (contract + tests)
  • forge test passes

Implementation

// Before
error NotAnAdmin();

// After
error AccountNotAdmin();

Parent: #16

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions