Skip to content

chore(soroban): feature distinct-destinations#208

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
licette32:feature/distinct-destinations
Apr 1, 2026
Merged

chore(soroban): feature distinct-destinations#208
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
licette32:feature/distinct-destinations

Conversation

@licette32
Copy link
Copy Markdown
Contributor

Summary

Rejects create_vault configurations where success_destination == failure_destination.
Equal destinations make the success/failure outcome financially indistinguishable for the
creator, removing the accountability incentive that is the core purpose of the vault.

Changes

src/lib.rs

  • Added SameDestination = 10 variant to Error enum
  • Added validation in create_vault: rejects when success_destination == failure_destination
  • Updated # Validation Rules Rustdoc on create_vault to document the new rule and its UX rationale

tests/create_vault.rs

vesting.md

  • Updated create_vault → Requirements with new validation rule
  • Added item 5 to Known Limitations & Security Notes explaining the UX and security rationale

README.md

  • Updated Vault Constraints → Validation Rules with the new constraint

Test Results

issue124

Coverage

97.41% (113/116 lines) — above the 95% threshold
issue124--tarpaulin

Security Notes

  • Validation occurs before any state mutation or token transfer (CEI-safe)
  • No new dependencies introduced
  • Does not affect existing vaults or other contract functions

Closes #124

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 30, 2026

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

@1nonlypiece 1nonlypiece merged commit d883fa4 into Disciplr-Org:main Apr 1, 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.

success_destination vs failure_destination equality

2 participants