Skip to content

Fix reentrancy, add state machine tests, document replay safety and build profile - #230

Merged
chonilius merged 1 commit into
MergeFi:mainfrom
trustosaretin:fix/issues-4-22-24-26
Aug 30, 2026
Merged

Fix reentrancy, add state machine tests, document replay safety and build profile#230
chonilius merged 1 commit into
MergeFi:mainfrom
trustosaretin:fix/issues-4-22-24-26

Conversation

@trustosaretin

Copy link
Copy Markdown
Contributor

Closes #4, Closes #22, Closes #24, Closes #26

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Refactoring (no functional or behavioral changes)
  • Documentation update
  • Other: Security hardening, testing, build optimization

Summary

This PR addresses four issues in a single focused changeset:

  1. Reentrancy fix (Formal reentrancy audit of all token::Client cross-contract calls #4): Reordered state mutations before external calls in release, refund, release_issue, and withdraw to follow the checks-effects-interactions pattern, preventing potential reentrancy vulnerabilities.

  2. Replay safety documentation (Research cross-contract and cross-network replay/nonce safety of admin-authorized operations #22): Documented Soroban's authorization framework guarantees, confirming that SorobanAuthorizationEntry bindings to contract address, network passphrase, and function name prevent cross-contract, cross-network, and cross-function replay attacks.

  3. WASM build profile investigation (Investigate WASM binary size and compute-cost effectiveness of current release profile settings #24): Measured actual WASM sizes, confirmed overflow-checks = true is intentional defense-in-depth, made stellar contract optimize a required build step (previously optional), and documented findings.

  4. State machine model (Formal state-machine model of EscrowStatus/IssueStatus transitions to prove no invalid transition is reachable #26): Added exhaustive property-based tests validating all valid transitions for EscrowStatus and the combined IssueStatus+Milestone.closed state space, proving no invalid transition is reachable.

Motivation / Context

Closes #4, Closes #22, Closes #24, Closes #26

…uild profile

- Reorder state mutations before external calls in release, refund,
  release_issue, and withdraw to follow checks-effects-interactions
  pattern (Issue MergeFi#4)
- Add exhaustive state-machine tests for EscrowStatus and
  IssueStatus+Milestone.closed transitions (Issue MergeFi#26)
- Document Soroban authorization framework replay protection guarantees
  and operational recommendations (Issue MergeFi#22)
- Investigate WASM build profile, document findings, make stellar
  contract optimize a required build step (Issue MergeFi#24)
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@trustosaretin is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius
chonilius merged commit 9e8d53f into MergeFi:main Aug 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment