📌 Description
create_vault in src/lib.rs accepts verifier, success_destination, and
failure_destination with no relationship checks. The repo already ships
snapshots probing dangerous overlaps (e.g.
test_create_vault_verifier_equals_success_destination_rejected,
test_create_vault_verifier_equals_failure_destination_rejected), but the
constraint is not consistently enforced in the contract itself.
This issue makes the address-distinctness invariant explicit and enforced at
creation time.
Goal: reject vault creation when verifier == success_destination or
verifier == failure_destination, since a verifier who is also a payout target
has a conflict of interest.
🎯 Requirements and Context
- Must be secure, tested, and documented.
- Add a new
Error::ConflictingAddresses returned by create_vault.
- Decide and document the rule for
success_destination == failure_destination
(the existing snapshot ..._no_verifier_destination_overlap_allowed suggests
some overlaps are allowed — keep behaviour consistent with it).
- Preserve
verifier == creator acceptance (TEST_VERIFIER_SAME_AS_CREATOR.md).
🛠️ Suggested Execution
1. Fork the repo and create a branch
git checkout -b feature/verifier-address-distinctness
2. Implement changes
- Contract: add the distinctness checks near the top of
create_vault in
src/lib.rs, before pulling USDC into escrow.
- Tests: extend
tests/create_vault.rs to assert each rejected/accepted overlap,
matching the existing snapshot expectations.
- Docs: add
docs/ADDRESS_CONSTRAINTS.md enumerating allowed/rejected overlaps;
cross-link from README.md.
- Add NatSpec-style
/// comments documenting the new validation rules.
- Validate security: a verifier can never also be a payout destination.
3. Test and commit
- Run
cargo test.
- Cover edge cases: verifier == success, verifier == failure, verifier == creator
(allow), None verifier with overlapping destinations (per existing snapshot).
Example commit message
feat: enforce verifier/destination address distinctness in create_vault
✅ Guidelines
- Minimum 95% test coverage on new/changed lines.
- Clear documentation of the allowed/rejected address matrix.
- No regressions on existing overlap snapshots.
- Timeframe: 96 hours.
🏷️ Labels
type-enhancement · area-contracts · type-security · type-testing ·
MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN
💬 Community & Support
- Join the Disciplr contributor Discord to coordinate, ask questions, and get
unblocked fast: https://discord.gg/xvNAvMJf
- Please introduce yourself before you start so we can avoid duplicate work,
pair you with a reviewer, and merge your PR quickly.
📌 Description
create_vaultinsrc/lib.rsacceptsverifier,success_destination, andfailure_destinationwith no relationship checks. The repo already shipssnapshots probing dangerous overlaps (e.g.
test_create_vault_verifier_equals_success_destination_rejected,test_create_vault_verifier_equals_failure_destination_rejected), but theconstraint is not consistently enforced in the contract itself.
This issue makes the address-distinctness invariant explicit and enforced at
creation time.
🎯 Requirements and Context
Error::ConflictingAddressesreturned bycreate_vault.success_destination == failure_destination(the existing snapshot
..._no_verifier_destination_overlap_allowedsuggestssome overlaps are allowed — keep behaviour consistent with it).
verifier == creatoracceptance (TEST_VERIFIER_SAME_AS_CREATOR.md).🛠️ Suggested Execution
1. Fork the repo and create a branch
2. Implement changes
create_vaultinsrc/lib.rs, before pulling USDC into escrow.tests/create_vault.rsto assert each rejected/accepted overlap,matching the existing snapshot expectations.
docs/ADDRESS_CONSTRAINTS.mdenumerating allowed/rejected overlaps;cross-link from
README.md.///comments documenting the new validation rules.3. Test and commit
cargo test.(allow),
Noneverifier with overlapping destinations (per existing snapshot).Example commit message
✅ Guidelines
🏷️ Labels
type-enhancement·area-contracts·type-security·type-testing·MAYBE REWARDED·GRANTFOX OSS·OFFICIAL CAMPAIGN💬 Community & Support
unblocked fast: https://discord.gg/xvNAvMJf
pair you with a reviewer, and merge your PR quickly.