Skip to content

Custom errors for Operator and Admin functions#231

Merged
naddison36 merged 4 commits into
nicka/withdraw-on-swapfrom
nicka/custom-errors
May 18, 2026
Merged

Custom errors for Operator and Admin functions#231
naddison36 merged 4 commits into
nicka/withdraw-on-swapfrom
nicka/custom-errors

Conversation

@naddison36
Copy link
Copy Markdown
Collaborator

@naddison36 naddison36 commented May 18, 2026

Summary

  • Replace admin/operator-only revert strings with custom errors across ARM ownership, operator, pricing, fee, market, migration, and cap-manager paths.
  • Keep user-facing revert strings unchanged for swaps, deposits, LP redeem request/claim flows, and public fee collection.
  • Update tests and invariant handlers to expect the new custom-error selectors where applicable.

Contract Sizes

Current forge build --sizes ARM implementation sizes:

Contract Runtime size Runtime margin
OriginARM 22,484 B 2,092 B
EthenaARM 22,503 B 2,073 B
LidoARM 23,245 B 1,331 B
EtherFiARM 23,284 B 1,292 B

All four ARM implementations are under the 24,576 byte EIP-170 runtime limit.

forge build --sizes exited nonzero because some deploy/script contracts exceed the runtime limit, but the ARM contracts themselves are fine.

Comment thread src/contracts/AbstractARM.sol Outdated
Copy link
Copy Markdown
Contributor

@clement-ux clement-ux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really happy to see custom errors!

@naddison36 naddison36 merged commit 04819ac into nicka/withdraw-on-swap May 18, 2026
8 checks passed
@naddison36 naddison36 deleted the nicka/custom-errors branch May 18, 2026 08:30
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.

2 participants