Reference
Reference

Errors

The contract Error enum (codes 1–8), with the symptom and likely cause of each.

authorize_action and the other contract methods return a typed Error. Each code maps to a specific check in the state machine.

CodeVariantWhat it meansLikely cause
1MalformedVerifyingKeyThe embedded verifying key didn't decodeBuild/transcode mismatch in vk.rs
2PolicyNotFoundNo policy registered for (agent, commitment)Policy never committed, or wrong commitment
3PolicyRevokedThe policy was revokedrevoke_policy was called for it
4InvalidProofThe Groth16 pairing check failedTampered proof/public inputs, or wrong circuit artifacts
5StateMismatchProof's prev_* ≠ effective on-chain stateStale state read, epoch drift, or a forged prior spend (Panel C)
6NullifierUsedThe nullifier was already recordedReplay, or a reused nonce
7InvalidAmountamount was not greater than zeroA zero or negative amount
8OverflowA counter or sum overflowedprev_spent + amount or action_count + 1 out of range

Mapping to the SDK

The SDK surfaces these as thrown errors during pay() / submit, and as a blocked StatusEvent when an action can't be proven at all — for example, a recipient outside the allowlist, which fails locally before any of the codes above can be returned.