Skip to content

Audit findings batch 1 (Chris): info/gas/low fixes#23

Merged
amiecorso merged 6 commits intomainfrom
audit-fixes
Mar 12, 2026
Merged

Audit findings batch 1 (Chris): info/gas/low fixes#23
amiecorso merged 6 commits intomainfrom
audit-fixes

Conversation

@amiecorso
Copy link
Copy Markdown
Collaborator

@amiecorso amiecorso commented Mar 12, 2026

Summary

Addresses audit findings 2–7 (informational, gas optimization, and low severity).

Findings

  • 2 (Info): Fix stale repo reference in PublicERC6492Validator NatSpec — pointed to spend-permissions instead of account-policies
  • 3 (Gas): Remove redundant idempotency check in replaceWithSignature — the same check already exists in _replace, so the storage reads and conditional in the caller were wasted
  • 4 (Gas): Pass pre-loaded storage pointers to _uninstallForReplace and _installForReplace — avoids redundant keccak256 slot computations, SLOADs, and a getPolicyId recomputation
  • 5 (Info): Hoist policyRecordByBinding.uninstalled = true above the installed branch in binding-mode _uninstall — set unconditionally since both branches wrote it
  • 6 (Low): Move whenNotPaused from _onExecute modifier to function body, after the empty-executionData early return — aligns installWithSignature behavior with install (both now succeed while paused)
  • 7 (Low, no-op): Document stale-state risks on setPolicyManager — preserves the migration use case but warns admins about install-state assumptions a new manager must uphold

Testing

All 288 tests pass. No new test files; one existing test updated to reflect finding #6 behavior change.

@amiecorso amiecorso changed the title Audit findings batch 1: info/gas/low fixes Audit findings batch 1 (Chris): info/gas/low fixes Mar 12, 2026
@amiecorso amiecorso merged commit cd5c0ad into main Mar 12, 2026
5 checks passed
@amiecorso amiecorso deleted the audit-fixes branch March 12, 2026 22:36
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