Errors
Every program error: its code, when it happens and which instructions raise it.
Anchor numbers the program's errors from 6000. A failed transaction's logs name the error on the first Program <program id> failed line that belongs to Once; inside a transaction that also calls SPP or another Anchor program, read the code from Once's own frame, since those programs use the same range.
| Code | Name | When | Raised by |
|---|---|---|---|
6000 0x1770 | AlreadyEnrolled | This person is already enrolled. The person nullifier already has an active enrollment, from this wallet or another. | enroll |
6001 0x1771 | AlreadyClaimed | This person already claimed in this scope. The claim receipt for this scope and scope nullifier exists. | claim |
6002 0x1772 | ScopeFull | The scope has reached its cap. The scope’s count has reached its cap. | claim |
6003 0x1773 | NotOpen | The scope has not opened. The current time is before opens_at. | claim |
6004 0x1774 | Closed | The scope has closed. The current time is at or after closes_at, or the scope is already closed. | claim, close_scope |
6005 0x1775 | RootUnknown | The person tree no longer accepts this root. The root is not among the last 64, or a revoke’s path doesn’t lead to the current root. | revoke, claim |
6006 0x1776 | ProofInvalid | The proof did not verify. The Groth16 proof doesn’t verify against the statement the program rebuilt. | enroll, claim |
6007 0x1777 | CredentialExpiresBeforeClose | The credential expires before the scope closes. The credential expires at or before the scope closes. The SDK raises it before proving. | none |
6008 0x1778 | WrongBinding | The claim binding does not match its payout or option. The payout note or the option doesn’t match the binding the proof committed to. | claim |
6009 0x1779 | BadPoolNote | The shielded transaction does not match the pool note. The SPP transaction doesn’t match the scope’s pool note, its accounts or its settlement. | create_scope, claim, close_scope, withdraw |
6010 0x177a | InsufficientRelayBudget | The poll relay budget cannot cover this claim. The poll’s relay budget can’t cover another relay fee. | claim |
6011 0x177b | UnknownIssuer | The credential issuer is unknown or retired. The issuer account is absent, not Once’s, or retired. | enroll |
6012 0x177c | StaleOprfKey | The OPRF key version or combined key is stale. The enrollment names an old registry version, or a registry write would change the combined key after an enrollment. | enroll, set_oprf |
6013 0x177d | CredentialExpired | The credential has expired. The credential’s valid-until time has passed. | enroll |
6014 0x177e | InvalidScope | The scope terms are invalid. The terms break a rule of create_scope. | create_scope |
6015 0x177f | ArithmeticOverflow | Amount or counter exceeds the supported range. An amount or counter would leave its integer range. | create_scope, set_oprf |
6016 0x1780 | TreeFull | The person tree has reached capacity. The person tree holds 1,048,576 leaves. | enroll |
6017 0x1781 | InvalidField | The input is not a canonical BN254 scalar field element. A value is not a canonical BN254 field element. | enroll, claim, set_oprf |
6018 0x1782 | NotEnrolled | The person is not enrolled. The person account is not active. | revoke |
6019 0x1783 | InvalidReceipt | The claim receipt or rent recipient is invalid. A receipt passed to close_claims isn’t this scope’s, its payer doesn’t match, or an account isn’t writable. | close_claims |
6020 0x1784 | ScopeStillOpen | The scope window has not ended. The scope’s window hasn’t ended. | close_scope, close_claims |
6021 0x1785 | Unauthorized | The program upgrade authority must initialize Once. The signer isn’t the program’s upgrade authority. | initialize |
6022 0x1786 | RevokeCooldown | Re-enrollment opens 24 hours after revocation. Fewer than 24 hours have passed since this person revoked. | enroll |
The API answers a refused claim or enrollment with its own codes, such as ALREADY_CLAIMED for AlreadyClaimed, and names the program error it came from in programError. API lists them.