Contract Error Codes
Contract-level error codes from the OpenZeppelin smart account, WebAuthn verifier, and policy contracts.
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. A failed transaction surfaces the raw Error(Contract, #NNNN) message inside the thrown exception; extract the code and pass it to decode, or match it against a constant.
Properties
The number of context rule IDs in the auth payload does not match the expected count.
The referenced context rule does not exist on the account.
The policy is already installed on the context rule.
The signer is already present on the context rule.
An external signer's verifier contract rejected the signature.
The key_data field on a signer exceeds the maximum allowed size.
Integer arithmetic overflow occurred in the contract.
A name field (e.g. context rule name) exceeds the maximum allowed length.
A context rule must have at least one signer or one policy.
The context rule's valid_until ledger has already passed.
The referenced policy is not installed on the context rule.
The referenced signer is not present on the context rule.
The context rule exceeds the maximum number of policies.
The context rule exceeds the maximum number of signers.
The signer is not authorized to sign the given context rule.
The invocation context could not be validated against the account's context rules.
Functions
Extracts and decodes the first known contract error code from an error message.