Description
EscrowError::SelfRating is defined in types.rs but never used. issue_reputation checks caller == contract.client and freelancer == contract.freelancer, but does not explicitly prevent a degenerate contract where roles were migrated such that client and freelancer collapse to the same address from self-inflating reputation. Enforce the SelfRating guard.
Requirements and context
- Scoped to TalentTrust
escrow Soroban contract (contracts/escrow).
- In
issue_reputation, reject with EscrowError::SelfRating if contract.client == contract.freelancer (defense-in-depth alongside create-time InvalidParticipant).
- Confirm the guard interacts correctly with any future client-migration feature.
- Invariant: a single principal can never both issue and receive reputation on the same contract.
- Must be secure, tested, and documented.
Suggested execution
- Fork the repo and create a branch:
git checkout -b enhancement/reputation-self-rating-guard
- Implement changes:
contracts/escrow/src/lib.rs
- Tests:
contracts/escrow/src/test/reputation.rs
- Docs:
docs/escrow/REPUTATION.md
- Include rustdoc/NatSpec-style doc comments on public functions
- Validate security assumptions (auth, overflow, fail-closed state machine, storage TTL, fee accounting)
Test and commit
- Run tests:
cargo test
- Cover edge cases (unauthorized callers, double release/refund, expired approvals, fee rounding, paused state)
- Include test output and security notes in the PR
Example commit message
feat(escrow): enforce SelfRating guard in issue_reputation
Guidelines
- Minimum 95% test coverage on new/changed code
- Clear documentation
- Timeframe: 96 hours from assignment
Description
EscrowError::SelfRatingis defined intypes.rsbut never used.issue_reputationcheckscaller == contract.clientandfreelancer == contract.freelancer, but does not explicitly prevent a degenerate contract where roles were migrated such that client and freelancer collapse to the same address from self-inflating reputation. Enforce theSelfRatingguard.Requirements and context
escrowSoroban contract (contracts/escrow).issue_reputation, reject withEscrowError::SelfRatingifcontract.client == contract.freelancer(defense-in-depth alongside create-timeInvalidParticipant).Suggested execution
git checkout -b enhancement/reputation-self-rating-guardcontracts/escrow/src/lib.rscontracts/escrow/src/test/reputation.rsdocs/escrow/REPUTATION.mdTest and commit
cargo testExample commit message
Guidelines