Skip to content

docs: add CONTRIBUTING guide for error-code and event conventions - #57

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Jagadeeshftw:docs/contracts-contributing-guide
Jun 24, 2026
Merged

docs: add CONTRIBUTING guide for error-code and event conventions#57
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Jagadeeshftw:docs/contracts-contributing-guide

Conversation

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

Summary

Adds CONTRIBUTING.md documenting the conventions that keep the escrow contract's ABI stable:

  • Append-only error codes — never renumber or reuse, with the current EscrowError table reproduced exactly (codes 1..=12, reflecting that code 2 RequestsMustBePositive is also reused for a negative price). Next code must be 13.
  • symbol_short! ≤ 9-char event-topic constraint.
  • Additive-only events stance, with the current usage / settled / paused payload shapes documented.
  • unwrap_or getter-default convention (and Option when absence is meaningful).
  • Test panic-assertion style#[should_panic(expected = "Error(Contract, #N)")] — plus event/state assertion guidance.
  • The cargo fmt / cargo build / cargo test gate, and the 95%-coverage / 96-hour campaign expectations.

Linked from README.md. No code changed.

Closes #46

Test output (gate, unchanged code)

test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.21s

Security notes: Docs-only change; no contract code or dependencies are modified. The error-code table is reproduced verbatim from lib.rs so the documented ABI matches the implementation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikewheeleer

Copy link
Copy Markdown
Contributor

good — documenting the error-code and event conventions will help every future PR. lgtm 🙌

@mikewheeleer
mikewheeleer merged commit 44fc9cf into Agentpay-Org:main Jun 24, 2026
1 check failed
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.

Add a CONTRIBUTING guide documenting the append-only error-code and event conventions

2 participants