Skip to content

docs: contract interface summaries for integrators#208

Merged
greatest0fallt1me merged 3 commits intoCalloraOrg:mainfrom
armandocodecr:docs/contract-interface-summaries
Mar 29, 2026
Merged

docs: contract interface summaries for integrators#208
greatest0fallt1me merged 3 commits intoCalloraOrg:mainfrom
armandocodecr:docs/contract-interface-summaries

Conversation

@armandocodecr
Copy link
Copy Markdown
Contributor

Closes #150

Summary

This PR resolves the issue by adding machine-readable JSON summaries of every public function and parameter for each Soroban contract in the workspace, placed under docs/interfaces/ with a link from the main README.md.

What was added

  • docs/interfaces/vault.json — 27 public functions for callora-vault with params, types, access rules, panics, and events.
  • docs/interfaces/settlement.json — 10 public functions for callora-settlement, including custom types (DeveloperBalance, GlobalPool, event structs).
  • docs/interfaces/revenue_pool.json — 7 public functions for callora-revenue-pool.
  • README.md — link table pointing to the three JSON files and updated project layout.

Why this resolves the issue

The issue asks to maintain JSON summaries of public functions and parameters to reduce drift between the contract source and @stellar/stellar-sdk invocation code in the backend. Each JSON file documents:

  • The exact function name (the on-chain Symbol) and parameter order, so backend calls using Contract.call(name, ...args) can be verified against a single source of truth.
  • Argument types using Soroban/XDR notation (Address, i128, Option<T>, Vec<T>, etc.) that map directly to nativeToScVal conversions in the SDK.
  • Access rules, panic messages, and emitted events — reducing guesswork when integrating or debugging.

File paths under docs/interfaces/ are stable so tooling and CI can reference them reliably.

Pre-existing bugs fixed (required to unblock cargo test)

Location Issue Fix
vault/src/lib.rs StorageKey::Paused variant missing Added to enum
vault/src/lib.rs MAX_BATCH_SIZE constant undefined Added pub const MAX_BATCH_SIZE: u32 = 50
vault/src/lib.rs is_authorized_depositor read from a different storage key than set_allowed_depositor writes to Changed to StorageKey::AllowedDepositors
vault/src/lib.rs deposit()meta not declared mut Added mut
vault/src/lib.rs transfer_ownership() — unnecessary mut on meta Removed mut
vault/src/test.rs init called with 8 args (function takes 7) Removed extra &None
vault/src/test.rs metadata_remains_after_ownership_transfer never completed the two-step ownership transfer Added client.accept_ownership()
settlement/src/test.rs test_receive_payment_unauthorized defined twice Renamed first copy; removed incorrect #[should_panic]
revenue_pool/src/test.rs Orphaned code block outside any function Removed
revenue_pool/src/test.rs Unused TryIntoVal import Removed
**/test_*.rs Redundant #![cfg(test)] attribute (clippy -D warnings) Removed from three files

Test output

running 11 tests — callora-revenue-pool: ok. 11 passed
running 31 tests — callora-settlement:   ok. 31 passed
running 85 tests — callora-vault:        ok. 85 passed

All 127 tests pass. cargo fmt and cargo clippy --all-targets --all-features -- -D warnings are clean.

Security notes

  • No logic changes were made to any contract. All fixes are limited to missing constants/variants, a storage-key inconsistency in a read-only helper, mut correctness, and test hygiene.
  • The storage-key fix in is_authorized_depositor corrects a bug where allowed depositors set via set_allowed_depositor were never found by the authorization check, effectively making the allowed-depositor feature non-functional. This is a correctness fix with no security regression.

armandocodecr and others added 2 commits March 28, 2026 13:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 28, 2026

@armandocodecr Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me greatest0fallt1me merged commit e0c4a45 into CalloraOrg:main Mar 29, 2026
0 of 3 checks 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.

Docs: machine-readable contract interface summaries for backend integrators

2 participants