OZContractErrorCodes class
Contract-level error codes from the OpenZeppelin smart account, WebAuthn verifier, and policy contracts.
When a contract rejects a call, the code appears inside the message of a
SmartAccountTransactionException (for example Error(Contract, #3016)).
The SDK surfaces the raw error but does not parse or map contract error
codes itself; callers can extract the code from the message and compare it
against these constants, or resolve it with the consumer-side decode and
decodeFromMessage helpers.
The named constants below cover the smart account contract's own error enum — the codes a caller is most likely to branch on. decode resolves any known code (smart account, WebAuthn, or a policy contract) into its contract and variant name.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decode(
int code) → OZContractError? -
Decodes a raw contract error
codeinto the OZ contract and variant name that defined it, ornullifcodeis not a known OZ smart-account contract error. -
decodeFromMessage(
String? message) → OZContractError? -
Extracts and decodes the first known contract error code from an error
message.
Constants
- contextRuleIdsLengthMismatch → const int
- The number of context-rule IDs in the auth payload does not match the expected count.
- contextRuleNotFound → const int
- The referenced context rule does not exist on the account.
- duplicatePolicy → const int
- The policy is already installed on the context rule.
- duplicateSigner → const int
- The signer is already present on the context rule.
- externalVerificationFailed → const int
- An external signer's verifier contract rejected the signature.
- keyDataTooLarge → const int
-
The
key_datafield on a signer exceeds the maximum allowed size. - mathOverflow → const int
- Integer arithmetic overflow occurred in the contract.
- nameTooLong → const int
- A name field (e.g. context-rule name) exceeds the maximum allowed length.
- noSignersAndPolicies → const int
- A context rule must have at least one signer or one policy.
- pastValidUntil → const int
-
The context rule's
valid_untilledger has already passed. - policyNotFound → const int
- The referenced policy is not installed on the context rule.
- signerNotFound → const int
- The referenced signer is not present on the context rule.
- tooManyPolicies → const int
- The context rule exceeds the maximum number of policies.
- tooManySigners → const int
- The context rule exceeds the maximum number of signers.
- The signer is not authorised to sign the given context rule.
- unvalidatedContext → const int
- The invocation context could not be validated against the account's context rules.