Reference

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.

CodeNameWhenRaised by
6000 0x1770AlreadyEnrolledThis person is already enrolled. The person nullifier already has an active enrollment, from this wallet or another.enroll
6001 0x1771AlreadyClaimedThis person already claimed in this scope. The claim receipt for this scope and scope nullifier exists.claim
6002 0x1772ScopeFullThe scope has reached its cap. The scope’s count has reached its cap.claim
6003 0x1773NotOpenThe scope has not opened. The current time is before opens_at.claim
6004 0x1774ClosedThe scope has closed. The current time is at or after closes_at, or the scope is already closed.claim, close_scope
6005 0x1775RootUnknownThe 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 0x1776ProofInvalidThe proof did not verify. The Groth16 proof doesn’t verify against the statement the program rebuilt.enroll, claim
6007 0x1777CredentialExpiresBeforeCloseThe credential expires before the scope closes. The credential expires at or before the scope closes. The SDK raises it before proving.none
6008 0x1778WrongBindingThe 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 0x1779BadPoolNoteThe 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 0x177aInsufficientRelayBudgetThe poll relay budget cannot cover this claim. The poll’s relay budget can’t cover another relay fee.claim
6011 0x177bUnknownIssuerThe credential issuer is unknown or retired. The issuer account is absent, not Once’s, or retired.enroll
6012 0x177cStaleOprfKeyThe 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 0x177dCredentialExpiredThe credential has expired. The credential’s valid-until time has passed.enroll
6014 0x177eInvalidScopeThe scope terms are invalid. The terms break a rule of create_scope.create_scope
6015 0x177fArithmeticOverflowAmount or counter exceeds the supported range. An amount or counter would leave its integer range.create_scope, set_oprf
6016 0x1780TreeFullThe person tree has reached capacity. The person tree holds 1,048,576 leaves.enroll
6017 0x1781InvalidFieldThe input is not a canonical BN254 scalar field element. A value is not a canonical BN254 field element.enroll, claim, set_oprf
6018 0x1782NotEnrolledThe person is not enrolled. The person account is not active.revoke
6019 0x1783InvalidReceiptThe 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 0x1784ScopeStillOpenThe scope window has not ended. The scope’s window hasn’t ended.close_scope, close_claims
6021 0x1785UnauthorizedThe program upgrade authority must initialize Once. The signer isn’t the program’s upgrade authority.initialize
6022 0x1786RevokeCooldownRe-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.