Skip to content

docs: document all contract error codes and simulation response forma…#565

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
extolkom:docs/555-contract-error-code-reference
Jul 23, 2026
Merged

docs: document all contract error codes and simulation response forma…#565
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
extolkom:docs/555-contract-error-code-reference

Conversation

@extolkom

Copy link
Copy Markdown
Contributor

Closes #555

Adds a complete reference document for all contract error codes, covering
what each code means and the exact condition in the contract logic that
triggers it. This removes the guesswork developers previously faced when
a transaction reverts with an opaque numeric code.

What's included

  • New/updated file: docs/error-codes.md
  • All 33 ContractError variants from creator-keys/src/lib.rs (codes 1–33)
  • All 9 PollError variants from creator-keys/src/events.rs (codes 20–28)
  • Off-chain read-only quote error identifiers from
    creator-keys/src/quote_view_errors.rs
  • Each entry documented as: Code | Name | Description | Trigger Condition,
    with citations to the originating function, file, and line number
  • A sample Soroban simulateTransaction RPC response showing
    Error(Contract, #16), plus a short TypeScript snippet showing how a
    client can parse the code out of the response

Scope / non-goals

  • Documentation only — no contract logic was modified
  • Diff is isolated to docs/error-codes.md to minimize merge conflict risk

Acceptance criteria (from #555)

  • All error code variants documented
  • Each entry includes code, name, description, and trigger condition
  • At least one simulation result example included
  • Document lives in the contracts repo under docs/

Verification

  • cargo fmt --all -- --check — passed
  • cargo check --workspace — passed
  • Branch rebased on latest origin/main, no conflicts

Notes for reviewers

Please double-check that no error variants were missed, especially any
recently added ones that might not yet be reflected in lib.rs /
events.rs at review time.

@Chucks1093
Chucks1093 merged commit c5c980d into accesslayerorg:main Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document all contract error codes with descriptions and the conditions that trigger each one

2 participants