Skip to content

chore(contracts): add contract docs, deployment & verification scripts, and formal verification helpers#911

Merged
Devsol-01 merged 1 commit into
Devsol-01:mainfrom
OtowoSamuel:feature/contracts-ops-docs
Jun 2, 2026
Merged

chore(contracts): add contract docs, deployment & verification scripts, and formal verification helpers#911
Devsol-01 merged 1 commit into
Devsol-01:mainfrom
OtowoSamuel:feature/contracts-ops-docs

Conversation

@OtowoSamuel
Copy link
Copy Markdown
Contributor

@OtowoSamuel OtowoSamuel commented Jun 2, 2026

This PR adds comprehensive contract documentation, operational scripts for building, flattening, deploying, verifying, and a smoke formal-verification helper.

Files added/updated:

  • contracts/docs/* (reference, operations, formal verification report)
  • contracts/scripts/* (deploy, verify, flatten, generate-docs, run-formal-checks, README)
  • crate-level doc includes in contracts/src/lib.rs

This change provides a repeatable workflow for generating NatSpec-style documentation, creating a flattened source bundle for on-chain verification, and running smoke verification/test reports. It does not change contract logic.

Closes #875, Closes #883, Closes #882, Closes #874

Copilot AI review requested due to automatic review settings June 2, 2026 02:21
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestera Ready Ready Preview, Comment Jun 2, 2026 2:22am

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@OtowoSamuel 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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an operational workflow around the Soroban contracts (docs, deployment manifests, verification/rollback helpers) and embeds key Markdown references into the contract crate documentation.

Changes:

  • Embed contract reference/ops/verification docs into crate-level rustdoc.
  • Introduce bash scripts for flattening sources, generating docs, creating deployment manifests, and verifying recorded deployments.
  • Add ops and formal-verification documentation (and commit generated outputs).

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
contracts/src/lib.rs Includes ops/reference/verification Markdown in crate rustdoc.
contracts/scripts/common.sh Shared helpers and paths for ops scripts.
contracts/scripts/deploy.sh Builds WASM and writes a deployment manifest with hashes.
contracts/scripts/flatten-source.sh Produces deterministic flattened source bundle + per-file hash manifest.
contracts/scripts/verify.sh Verifies current source/WASM hash against latest manifest.
contracts/scripts/status.sh Prints the latest deployment manifest.
contracts/scripts/rollback.sh Prints a rollback target manifest (operator redeploy helper).
contracts/scripts/generate-docs.sh Assembles a single documentation bundle from multiple Markdown files.
contracts/scripts/run-formal-checks.sh Runs cargo tests and writes a verification report.
contracts/scripts/README.md Documents how to use the new scripts.
contracts/docs/CONTRACT_OPERATIONS.md Documents deployment/verification/rollback workflow.
contracts/docs/FORMAL_VERIFICATION.md Documents invariants and proof obligations.
contracts/docs/generated/contract-documentation.md Generated documentation bundle committed to repo.
contracts/docs/generated/verification-report.md Generated verification report (currently shows failing tests).
contracts/README.md Links to ops docs and scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

log "Building contract WASM"
cargo build --manifest-path "$CONTRACTS_ROOT/Cargo.toml" --target wasm32-unknown-unknown --release

wasm_path=$(find "$CONTRACTS_ROOT/target/wasm32-unknown-unknown/release" -maxdepth 1 -name '*.wasm' -type f | sort | tail -n 1)
Comment on lines +29 to +32
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)

manifest_dir="$DEPLOYMENT_ROOT/$network"
manifest_path="$manifest_dir/$timestamp.json"
Comment on lines +23 to +25
manifest_source_hash=$(grep -o '"source_sha256": "[^"]*"' "$latest" | head -n 1 | cut -d '"' -f 4)
manifest_wasm_hash=$(grep -o '"wasm_sha256": "[^"]*"' "$latest" | head -n 1 | cut -d '"' -f 4)
manifest_wasm_path=$(grep -o '"wasm_path": "[^"]*"' "$latest" | head -n 1 | cut -d '"' -f 4)

log "Running contract unit tests (focused on invariants and critical flows)"

if cargo test --manifest-path "$CONTRACTS_ROOT/Cargo.toml" --lib -- --nocapture; then
@Devsol-01 Devsol-01 merged commit f4e380c into Devsol-01:main Jun 2, 2026
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

3 participants