Skip to content

feat!: replace string error reasons with typed error selectors#22

Open
mfw78 wants to merge 1 commit into
feat/generate-order-verifyfrom
feat/typed-error-reasons
Open

feat!: replace string error reasons with typed error selectors#22
mfw78 wants to merge 1 commit into
feat/generate-order-verifyfrom
feat/typed-error-reasons

Conversation

@mfw78

@mfw78 mfw78 commented Jul 10, 2026

Copy link
Copy Markdown

Reason payloads become bytes4 selectors of handler-declared custom errors instead of free strings:

  • OrderNotValid, PollTryNextBlock, PollTryAtTimestamp, PollTryAtBlock carry bytes4 reasonCode
  • every reason string constant becomes a declared error (StrikeNotReached(), BeforeTwapStart(), ...) — part of the handler ABI, so consumers resolve codes to names without a bespoke table
  • revert data is fixed-size; no stringly errors remain on the error surface

BREAKING: error signatures change.

Part of #1.

Reason payloads become bytes4 selectors of handler-declared custom
errors instead of free strings. Declared errors are part of the
handler ABI, so any ABI-aware consumer resolves a reasonCode to a
name without a bespoke table, revert data shrinks, and reason
constants become type-checked declarations.

BREAKING CHANGE: OrderNotValid, PollTryNextBlock, PollTryAtTimestamp
and PollTryAtBlock now carry bytes4 reasonCode instead of string.
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