| type | Feature |
|---|---|
| title | Move escrowed funds on-chain via SAC token transfers in deposit_funds and release_milestone |
| labels | type:feature, area:settlement, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN |
| assignees |
The escrow in contracts/escrow/src/lib.rs tracks funded_amount, released_amount, and refunded_amount purely as integer counters: deposit_funds only increments contract.funded_amount, and release_milestone only flips milestone.released and bumps released_amount. No actual value ever moves β the contract holds no balance and never calls soroban_sdk::token. This means the on-chain accounting and real custody can drift, and a "released" milestone never actually pays the freelancer.
This issue makes the escrow custodial: bind a configurable Stellar Asset Contract (SAC) token at initialize, pull funds from the client on deposit_funds, and push funds to the freelancer on release_milestone, atomically with the existing counter updates.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Store a settlement
token: Addressunder a newDataKey::SettlementToken, set once atinitialize. - In
deposit_funds, calltoken::Client::transfer(&caller, &contract_address, &amount)aftercaller.require_auth(), keeping thefunded_amountupdate atomic with the transfer. - In
release_milestone, transfermilestone.amount(minus protocol fee) from the contract tocontract.freelancerafter marking it released. - Add a typed error path for failed/under-funded transfers; keep
EscrowErrorcodes append-only for client-SDK stability. - Preserve all existing invariants: pause gate, approval checks, saturating arithmetic, and TTL bumps.
- Fork the repo and create a branch
git checkout -b feature/contracts-sac-onchain-custody- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβDataKey::SettlementToken, token binding ininitialize, andsoroban_sdk::token::Clienttransfers indeposit_funds/release_milestone. - Write comprehensive tests in:
contracts/escrow/src/test/deposit.rsandcontracts/escrow/src/test/release.rsβ register a mock SAC viaenv.register_stellar_asset_contract, asserting balance deltas, auth flows, and event payloads. - Add documentation: update
README.mdanddocs/escrow/README.mdwith the custody lifecycle. - Include NatSpec-style doc comments (
///) on every changed entrypoint. - Validate security assumptions: no double-pay on repeated release, correct auth on deposit/release, overflow safety on balance math.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: zero balance, exact-balance release, paused contract, and unauthorized caller.
- Include full
cargo testoutput and a short security notes section in the PR description.
feat: move escrowed funds on-chain via SAC token transfers in deposit and release
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Implement submit_work_evidence to populate the unused Milestone.work_evidence field" labels: type:feature, area:milestones, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The Milestone struct in contracts/escrow/src/types.rs carries a work_evidence: Option<String> field, but no entrypoint ever sets it β create_contract initializes every milestone with work_evidence: None, and nothing else writes to it. Freelancers have no on-chain way to attach a deliverable reference (e.g. an IPFS CID or URL hash) before a client approves and releases a milestone.
This issue adds a submit_work_evidence(contract_id, caller, milestone_index, evidence) entrypoint that lets the freelancer record evidence for an unreleased milestone, emitting an event for indexers.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
submit_work_evidencethat requirescaller.require_auth()and verifiescaller == contract.freelancer. - Reject submission when the contract is not
Funded, the milestone is released or refunded, or the index is out of bounds (IndexOutOfBounds). - Bound the evidence
Stringlength to avoid storage bloat; reject oversized input with a typed error. - Emit a
work_evidenceevent with(contract_id, milestone_index, freelancer, timestamp)and bump milestone TTL. - Honor the pause/emergency gate and
require_not_finalized.
- Fork the repo and create a branch
git checkout -b feature/contracts-submit-work-evidence- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ newsubmit_work_evidenceentrypoint mutating the milestone vector. - Write comprehensive tests in:
contracts/escrow/src/test/release.rsβ assert evidence is stored, overwrite rules, and all rejection paths. - Add documentation: update
docs/escrow/README.mddescribing the evidence-before-release flow. - Include NatSpec-style doc comments (
///) on the new entrypoint. - Validate security assumptions: only freelancer can submit, no submission after release.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: oversized evidence, wrong caller, released/refunded milestone, finalized contract.
- Include full
cargo testoutput in the PR description.
feat: add submit_work_evidence entrypoint to record milestone deliverables
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Support partial funding with the PartiallyFunded status in deposit_funds" labels: type:feature, area:deposits, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
ContractStatus::PartiallyFunded is defined in contracts/escrow/src/types.rs and accepted by cancel_contract, but deposit_funds in contracts/escrow/src/lib.rs never sets it: a contract stays Created until funded_amount >= total_amount, at which point it jumps straight to Funded. A client who deposits in installments leaves the contract in a misleading Created state, indistinguishable from an unfunded contract.
This issue makes deposit_funds transition to PartiallyFunded when funds are present but below the milestone total.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- After incrementing
funded_amount, set status toPartiallyFundedwhen0 < funded_amount < total_amount, andFundedwhenfunded_amount >= total_amount. - Allow
deposit_fundsto accept further deposits while inPartiallyFunded(not onlyCreated). - Emit a
depositevent including the new status so indexers can distinguish partial vs full funding. - Preserve the existing positivity check, client-only auth, and TTL bumps.
- Fork the repo and create a branch
git checkout -b feature/contracts-partially-funded-status- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ the status-transition block indeposit_funds. - Write comprehensive tests in:
contracts/escrow/src/test/deposit.rsβ assert PartiallyFunded β Funded progression across multiple deposits. - Add documentation: update the status-machine notes in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) ondeposit_funds. - Validate security assumptions: no skipped states, no over-funding regressions.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: single full deposit, two partial deposits, exact-total deposit.
- Include full
cargo testoutput in the PR description.
feat: transition to PartiallyFunded on installment deposits
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add freelancer acceptance step using the unused ContractStatus::Accepted state" labels: type:feature, area:lifecycle, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
ContractStatus::Accepted is declared in contracts/escrow/src/types.rs but is never assigned anywhere in the contract. Today a contract goes Created β Funded with no on-chain record that the freelancer ever agreed to the terms; the client funds work that the freelancer may never have accepted.
This issue adds an accept_contract(contract_id, freelancer) entrypoint that records explicit freelancer consent before funds are released.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
accept_contractrequiringfreelancer.require_auth()andcaller == contract.freelancer. - Allow acceptance only from
CreatedorFunded; set status toAccepted(or gate releases on anacceptedflag if status ordering must be preserved). - Optionally require acceptance before
release_milestonecan succeed, behind a clearly documented rule. - Emit an
acceptedevent with(contract_id, freelancer, timestamp). - Honor the pause gate and
require_not_finalized.
- Fork the repo and create a branch
git checkout -b feature/contracts-freelancer-acceptance- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ newaccept_contractentrypoint and any release-gating wiring. - Write comprehensive tests in:
contracts/escrow/src/test/release_authorization.rsβ assert acceptance flow and rejection of unauthorized callers. - Add documentation: update the lifecycle diagram in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: only the freelancer can accept, no acceptance after terminal states.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: double acceptance, acceptance by client, acceptance of cancelled contract.
- Include full
cargo testoutput in the PR description.
feat: add accept_contract using the Accepted status for freelancer consent
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add revoke_approval to let a party withdraw a milestone approval before release" labels: type:feature, area:approvals, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
approve_milestone in contracts/escrow/src/approvals.rs records client_approved / freelancer_approved / arbiter_approved flags in temporary storage, but there is no way to undo an approval. Once a party approves, the only paths are release (which clears approvals) or TTL expiry. A client who approves prematurely, or who discovers a problem before release, is stuck waiting up to seven days for the approval to expire.
This issue adds a revoke_approval(contract_id, caller, milestone_index) entrypoint that lets the same party clear only their own approval flag.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
revoke_approvalthat requirescaller.require_auth()and clears only the caller's flag (client/freelancer/arbiter), leaving other parties' flags intact. - Reject revocation when no approval record exists or the milestone is already released (
MilestoneAlreadyReleased). - Remove the approval record entirely when all three flags become false.
- Emit a
revokedevent with(contract_id, milestone_index, caller).
- Fork the repo and create a branch
git checkout -b feature/contracts-revoke-approval- Implement changes
- Write code in:
contracts/escrow/src/approvals.rsβ newrevoke_approvalhelper plus an entrypoint wrapper incontracts/escrow/src/lib.rs. - Write comprehensive tests in:
contracts/escrow/src/test/release_authorization.rsβ assert partial revocation in MultiSig and that release fails after revoke. - Add documentation: update the approval section of
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: a party can only revoke their own flag.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: revoke without prior approval, revoke after release, MultiSig revoke-one-of-two.
- Include full
cargo testoutput in the PR description.
feat: add revoke_approval to withdraw a milestone approval
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add batch release_milestones entrypoint for releasing multiple milestones atomically" labels: type:feature, area:release, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
release_milestone in contracts/escrow/src/lib.rs releases exactly one milestone per transaction. refund_unreleased_milestones already accepts a Vec<u32> of indices, but there is no batched counterpart for releases. A client completing several milestones at once must submit one transaction per milestone, paying repeated load/store costs and risking partial completion if some succeed and some fail.
This issue adds release_milestones(contract_id, caller, milestone_indices: Vec<u32>) that validates all indices first, then releases them atomically.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Validate the whole batch (duplicates, bounds, already-released/refunded, sufficient balance, valid approvals per index) before any mutation, mirroring
refund_unreleased_milestones. - Apply protocol-fee accumulation per released milestone and clear approvals for each released index.
- Update
released_amount, transition toCompletedonly when all milestones are terminal, and emit one event summarizing the batch. - Reuse the existing single-release authorization checks so behavior stays consistent.
- Fork the repo and create a branch
git checkout -b feature/contracts-batch-release- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ newrelease_milestonesentrypoint sharing logic withrelease_milestone. - Write comprehensive tests in:
contracts/escrow/src/test/release.rsβ assert all-or-nothing semantics and accumulated fees. - Add documentation: note batch release in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no partial application when one index is invalid.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: duplicate indices, one already-released index, exact-balance batch.
- Include full
cargo testoutput in the PR description.
feat: add atomic batch release_milestones entrypoint
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add milestone deadline and timeout-based auto-refund to escrow contracts" labels: type:feature, area:timeouts, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The Milestone struct in contracts/escrow/src/types.rs has no deadline, and the utils::now_seconds helper in contracts/escrow/src/utils.rs is unused outside docs. There is no mechanism for a client to reclaim funds when a freelancer stalls indefinitely β the only refund path, refund_unreleased_milestones, has no time precondition.
This issue introduces optional per-milestone deadlines and a claim_timeout_refund entrypoint that lets the client recover an unreleased milestone after its deadline passes.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add an optional
deadline: Option<u64>field toMilestoneand accept deadlines increate_contract(preservecontracttypelayout compatibility). - Add
claim_timeout_refund(contract_id, milestone_index)that refunds an unreleased, undisputed milestone only whennow_seconds(env) > deadline. - Require
client.require_auth(), reject released/refunded milestones, and updaterefunded_amountplus status using the existing accounting rules. - Emit a
timeout_refundevent and honor the pause gate.
- Fork the repo and create a branch
git checkout -b feature/contracts-milestone-timeouts- Implement changes
- Write code in:
contracts/escrow/src/lib.rsandcontracts/escrow/src/types.rsβ deadline field and timeout refund logic usingutils::now_seconds. - Write comprehensive tests in:
contracts/escrow/src/test/timeout_tests.rsβ driveenv.ledger().setto assert pre/post-deadline behavior. - Add documentation: add
docs/escrow/timeouts.mdcovering deadline semantics. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no refund before deadline, no double refund.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: exactly-at-deadline, no-deadline milestone, already-released milestone.
- Include full
cargo testoutput in the PR description.
feat: add milestone deadlines and timeout-based auto-refund
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Expose a paginated list_contracts_by_participant indexer view" labels: type:feature, area:indexer, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The contract exposes get_contract and get_milestones for single-contract lookups in contracts/escrow/src/lib.rs, but offers no way to enumerate the contracts a given client or freelancer participates in. Front ends must scan every DataKey::Contract(id) from 1..NextContractId client-side, which is slow and fragile.
This issue maintains a per-participant index and exposes a paginated read so a dashboard can list a user's escrows efficiently.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- On
create_contract, append the new id to per-address index vectors under newDataKeyvariants (e.g.ClientContracts(Address)/FreelancerContracts(Address)). - Add
list_contracts_by_participant(addr, start, limit) -> Vec<u32>returning a bounded page of contract ids. - Cap
limitto avoid unbounded reads and bump index-entry TTL on write. - Keep the index append-only and consistent with contract creation; do not change existing entrypoint signatures.
- Fork the repo and create a branch
git checkout -b feature/contracts-participant-index- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ index maintenance increate_contractand the new paginated reader. - Write comprehensive tests in:
contracts/escrow/src/test/persistence.rsβ assert pagination bounds and per-participant correctness. - Add documentation: document the index keys in
docs/escrow/state-persistence.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: reads are non-mutating and limit-bounded.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: empty index, limit larger than index, out-of-range start.
- Include full
cargo testoutput in the PR description.
feat: add paginated list_contracts_by_participant indexer view
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Emit a structured milestone_released event with fee and accounting deltas" labels: type:feature, area:events, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
release_milestone in contracts/escrow/src/lib.rs mutates released_amount, accumulates protocol fees, and may transition the contract to Completed, but it emits no event at all on success. Indexers and front ends cannot observe releases without diffing full contract state. By contrast, create_contract and the governance module already publish events.
This issue adds a structured milestone_released event so off-chain consumers can track releases directly.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Publish a
milestone_releasedevent keyed by(symbol, contract_id)carrying(milestone_index, amount, fee, new_released_amount, caller, timestamp). - Emit a separate
contract_completedevent when the release transitions status toCompleted. - Follow the existing
symbol_short!topic conventions used elsewhere in the contract. - Do not change the function's return value or control flow other than adding the publish calls.
- Fork the repo and create a branch
git checkout -b feature/contracts-release-events- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβenv.events().publishcalls at the end ofrelease_milestone. - Write comprehensive tests in:
contracts/escrow/src/test/release.rsβ assert event topics and payloads viaenv.events().all(). - Add documentation: add the event schema to
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) describing emitted events. - Validate security assumptions: events never leak secrets and are emitted only on success.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: zero-fee release, final-milestone completion event.
- Include full
cargo testoutput in the PR description.
feat: emit structured milestone_released and contract_completed events
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Emit a cancelled event from cancel_contract for indexer observability" labels: type:feature, area:events, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
cancel_contract in contracts/escrow/src/lib.rs sets status = Cancelled and persists the contract, but emits no event. There is no on-chain signal that a contract was cancelled, so indexers must poll and diff to detect cancellations β inconsistent with create_contract and finalize, which both publish events.
This issue adds a cancelled event carrying who cancelled and when.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Publish a
cancelledevent keyed by(symbol, contract_id)with(caller, previous_status, timestamp). - Emit only after the state write succeeds, following existing topic conventions.
- Do not alter authorization, allowed-status checks, or the return value.
- Fork the repo and create a branch
git checkout -b feature/contracts-cancel-event- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβenv.events().publishincancel_contract. - Write comprehensive tests in:
contracts/escrow/src/test/pause_controls.rsβ assert the cancelled event is emitted with the right payload. - Add documentation: list the event in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: event emitted only on a successful cancel.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: cancel from Created, Funded, and PartiallyFunded.
- Include full
cargo testoutput in the PR description.
feat: emit cancelled event from cancel_contract
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add cancel_client_migration to let the current client withdraw a pending migration" labels: type:feature, area:migration, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
contracts/escrow/src/migration.rs implements propose_client_migration and accept_client_migration, but there is no way to cancel a proposal once made. A current client who proposed the wrong new_client, or who changed their mind, must wait for the 21-day PENDING_MIGRATION_TTL_LEDGERS to expire before they can propose again β and propose_client_migration panics with InvalidState if a pending proposal still exists.
This issue adds cancel_client_migration so the current client can revoke a live proposal immediately.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
cancel_client_migration(contract_id, current_client)requiringcurrent_client.require_auth()andcurrent_client == contract.client. - Reject when no live pending migration exists (
InvalidState) and honor the pause gate /require_not_finalized. - Remove the transient pending-migration entry via
remove_transientand emit aclient_migration_cancelledevent.
- Fork the repo and create a branch
git checkout -b feature/contracts-cancel-client-migration- Implement changes
- Write code in:
contracts/escrow/src/migration.rsβ newcancel_client_migrationentrypoint. - Write comprehensive tests in:
contracts/escrow/src/test/client_migration.rsβ assert cancel clears the proposal and re-propose then succeeds. - Add documentation: update the migration flow in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: only the current client can cancel.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: cancel with no proposal, cancel then re-propose, cancel by non-client.
- Include full
cargo testoutput in the PR description.
feat: add cancel_client_migration to revoke a pending proposal
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add cancel_governance_admin_proposal to abort a pending two-step admin transfer" labels: type:feature, area:governance, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
contracts/escrow/src/governance.rs implements propose_governance_admin and accept_governance_admin storing a DataKey::PendingAdmin, but there is no way for the current admin to cancel a proposal. If the wrong address was proposed, the pending admin can still accept and seize control until the proposal is overwritten by another propose call β there is no explicit revocation.
This issue adds cancel_governance_admin_proposal so the current admin can clear PendingAdmin immediately.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
cancel_governance_admin_proposalrequiring the storedAdmintorequire_auth()and the contract to be initialized. - Reject when no
PendingAdminexists (InvalidState). - Remove
DataKey::PendingAdminand emit an(admin, "cancelled")audit event with(admin, cancelled_proposal, timestamp).
- Fork the repo and create a branch
git checkout -b feature/contracts-cancel-admin-proposal- Implement changes
- Write code in:
contracts/escrow/src/governance.rsβ newcancel_governance_admin_proposalentrypoint. - Write comprehensive tests in:
contracts/escrow/src/test/security.rsβ assert cancel blocks a later accept and that only admin can cancel. - Add documentation: update the governance section in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: pending admin cannot accept after cancellation.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: cancel without a proposal, cancel by non-admin, accept-after-cancel rejected.
- Include full
cargo testoutput in the PR description.
feat: add cancel_governance_admin_proposal to abort a pending transfer
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Persist reputation_issued in the finalization ContractSummary snapshot" labels: type:feature, area:finalization, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
summarize_contract in contracts/escrow/src/finalize.rs hardcodes reputation_issued: false in the ContractSummary it builds, even though the contract already tracks DataKey::ReputationIssued(contract_id). The immutable close record written by finalize_contract therefore always claims reputation was not issued, which is wrong for any completed contract that received a rating.
This issue makes the snapshot read the real reputation-issued flag.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- In
summarize_contract, readDataKey::ReputationIssued(contract_id)and setreputation_issuedaccordingly instead of the hardcodedfalse. - Keep the
CONTRACT_SUMMARY_SCHEMA_VERSIONunchanged unless the field semantics change; document the fix. - Ensure
get_contract_summary(the indexer view) andfinalize_contractboth reflect the corrected value.
- Fork the repo and create a branch
git checkout -b feature/contracts-summary-reputation-flag- Implement changes
- Write code in:
contracts/escrow/src/finalize.rsβ fixsummarize_contract. - Write comprehensive tests in:
contracts/escrow/src/test/reputation.rsβ assert the flag is true afterissue_reputationthen finalize. - Add documentation: note the field semantics in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: the snapshot is read-only and consistent.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: finalize without reputation, finalize after reputation.
- Include full
cargo testoutput in the PR description.
fix: read real reputation_issued flag in ContractSummary snapshot
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Apply the pause and emergency gate to deposit_funds, release_milestone, and refunds" labels: type:security, area:pause, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The README claims that "when paused, all mutating escrow operations (create_contract, deposit_funds, release_milestone, issue_reputation, cancel_contract) are blocked with ContractPaused." But the require_not_paused helper in contracts/escrow/src/finalize.rs is only invoked by finalize and migration. deposit_funds, release_milestone, refund_unreleased_milestones, create_contract, cancel_contract, and issue_reputation in contracts/escrow/src/lib.rs never call it β so funds can move while the contract is paused or in an emergency.
This issue closes that gap so the pause switch actually halts value-moving operations.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Call
Self::require_not_paused(&env)at the top of every mutating escrow entrypoint named in the README before any state read/write. - Ensure both
PausedandEmergencyflags are honored (the helper already checks both). - Keep read-only queries unblocked.
- Verify the documented behavior is now enforced and update the README only if its list changes.
- Fork the repo and create a branch
git checkout -b security/contracts-enforce-pause-gate- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ addrequire_not_pausedguards to the mutating entrypoints. - Write comprehensive tests in:
contracts/escrow/src/test/pause_controls.rsβ assert each entrypoint panics withContractPausedwhile paused and in emergency. - Add documentation: confirm the pause matrix in
docs/escrow/emergency-controls.md. - Include NatSpec-style doc comments (
///) noting the pause precondition. - Validate security assumptions: no value movement while paused.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: paused-only, emergency-only, and unpause-then-succeed for each entrypoint.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: enforce pause/emergency gate on all mutating escrow entrypoints
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Use saturating or checked arithmetic for funded_amount and released_amount mutations" labels: type:security, area:accounting, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
deposit_funds does contract.funded_amount += amount, release_milestone does contract.released_amount += milestone.amount, and refund_unreleased_milestones does contract.refunded_amount += total_refund_amount in contracts/escrow/src/lib.rs β all plain i128 additions. The codebase already provides safe_add_amounts / safe_subtract_amounts in contracts/escrow/src/amount_validation.rs, but these hot paths don't use them. A crafted sequence of large deposits could overflow and panic ungracefully or wrap in release builds.
This issue routes all accounting mutations through the existing checked helpers with a typed error.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Replace the raw
+=onfunded_amount,released_amount, andrefunded_amountwithsafe_add_amounts, panicking with a typed overflow error on failure. - Use
safe_subtract_amountsfor theavailable_balancecomputations to detect accounting-invariant violations. - Keep error codes append-only and preserve all existing checks (positivity, state, auth).
- Fork the repo and create a branch
git checkout -b security/contracts-checked-accounting- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ swap raw arithmetic for the helpers indeposit_funds,release_milestone, andrefund_unreleased_milestones. - Write comprehensive tests in:
contracts/escrow/src/test/input_sanitization_amounts.rsβ drive near-i128::MAXdeposits to assert a clean typed failure. - Add documentation: note the overflow policy in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no silent wraparound, deterministic failure.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: overflow on deposit, overflow on release sum, invariant violation on subtract.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: use checked arithmetic for escrow accounting mutations
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Block deposits and migrations on cancelled contracts in deposit_funds" labels: type:security, area:lifecycle, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
cancel_contract in contracts/escrow/src/lib.rs moves a contract to Cancelled, but deposit_funds only checks status == Created to allow deposits β and create_contract never produces a Cancelled contract, so the guard is fine there. The real risk is elsewhere: once on-chain custody lands, a Cancelled contract must categorically reject any further value movement, and the current InvalidState message does not distinguish "cancelled" from "already funded," making audits harder.
This issue tightens lifecycle enforcement so a cancelled contract is a hard terminal state for all value-moving operations.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add explicit
Cancelled/Refundedrejection indeposit_funds,release_milestone, andrefund_unreleased_milestoneswith a distinct, descriptive error rather than a genericInvalidState. - Confirm
cancel_contractcannot run onCompleted,Disputed,Refunded, or already-Cancelledcontracts (it currently allows onlyCreated/PartiallyFunded/Funded). - Keep error codes append-only and document the terminal-state matrix.
- Fork the repo and create a branch
git checkout -b security/contracts-terminal-state-guards- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ terminal-state guards in the value-moving entrypoints. - Write comprehensive tests in:
contracts/escrow/src/test/security.rsβ assert cancelled/refunded contracts reject deposits, releases, and refunds. - Add documentation: add a terminal-state matrix to
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no operations on terminal contracts.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: deposit after cancel, release after cancel, refund after refund.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: reject value-moving operations on cancelled and refunded contracts
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Validate the aggregate milestone total against overflow in create_contract" labels: type:security, area:create-contract, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
create_contract in contracts/escrow/src/lib.rs validates that each milestone amount is > 0 but never validates the sum. Later, deposit_funds computes let total_amount: i128 = milestones.iter().map(|m| m.amount).sum(); with a plain .sum(), which panics on overflow. A contract created with many large milestones can therefore be funded only via a transaction that panics, effectively bricking it, and the overflow surfaces far from where the bad input was accepted.
This issue validates the milestone total at creation time using the checked helper.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- In
create_contract, accumulate the milestone total withsafe_add_amountsand reject with a typed error if it overflows or exceeds a configured maximum. - Replace the raw
.sum()indeposit_fundswith the same checked accumulation. - Enforce a maximum milestone count to bound iteration cost.
- Keep error codes append-only and document the new validation.
- Fork the repo and create a branch
git checkout -b security/contracts-validate-milestone-total- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ checked total increate_contractanddeposit_funds. - Write comprehensive tests in:
contracts/escrow/src/test/create_contract_bounds.rsβ assert overflowing totals are rejected at creation. - Add documentation: note the total bound in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no panic path reachable via funding.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: two near-max milestones, max-count milestones, exact-max total.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: validate aggregate milestone total against overflow in create_contract
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Fix the negative pending-reputation-credit underflow in issue_reputation" labels: type:security, area:reputation, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
issue_reputation in contracts/escrow/src/lib.rs decrements pending credits with env.storage().persistent().set(&pending_key, &(pending - 1)); where pending defaults to 0 when no credit was ever granted. Because nothing in the contract ever increments PendingReputationCredits, every successful issue_reputation writes a negative balance (e.g. -1), and get_pending_reputation_credits then returns nonsense negative numbers. The credit accounting is silently broken.
This issue corrects the pending-credit lifecycle so the counter never goes negative.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Either guard the decrement so it never drops below zero, or introduce the missing increment (e.g. on contract completion) so the debit has a matching credit.
- Decide and document the intended semantics of
PendingReputationCreditsand makeissue_reputationconsistent with it. - Preserve the once-per-contract
ReputationIssuedguard and all existing authorization/state checks.
- Fork the repo and create a branch
git checkout -b security/contracts-reputation-credit-underflow- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ fix the pending-credit math inissue_reputation. - Write comprehensive tests in:
contracts/escrow/src/test/reputation.rsβ assert credits never go negative across multiple contracts. - Add documentation: describe credit semantics in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no negative balances, no double-issue.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: first issuance, repeated issuance attempt, multi-contract freelancer.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: prevent negative pending reputation credits in issue_reputation
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Require initialization before create_contract and deposit_funds to bind the admin" labels: type:security, area:initialization, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
create_contract, deposit_funds, and release_milestone in contracts/escrow/src/lib.rs do not call require_initialized. Protocol-fee accumulation in release_milestone is even guarded by if Self::is_initialized(&env), so an uninitialized contract can take deposits and release funds with no admin, no pause authority, and no fee accounting. The pause and emergency controls that protect users only exist once initialize has run, but the core money flow doesn't require it.
This issue requires initialization before any escrow lifecycle operation, so the admin-controlled safety rails always apply.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Call
Self::require_initialized(&env)at the top ofcreate_contract,deposit_funds,release_milestone,refund_unreleased_milestones, andcancel_contract. - Keep
initializeitself single-use and idempotent-guarded as today. - Update the README, which implies these flows are always protected, to match enforced behavior.
- Fork the repo and create a branch
git checkout -b security/contracts-require-init- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ addrequire_initializedguards. - Write comprehensive tests in:
contracts/escrow/src/test/mainnet_readiness.rsβ assert uninitialized calls panic withNotInitialized. - Add documentation: update
README.mdinitialization requirements. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no money flow before admin binding.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: each entrypoint pre-init, then post-init success.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: require initialization before escrow lifecycle operations
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Round protocol fees deterministically and cap them below the milestone amount" labels: type:security, area:protocol-fees, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
calculate_protocol_fee in contracts/escrow/src/lib.rs computes amount * fee_bps as i128 / 10_000. The intermediate amount * fee_bps can overflow i128 for very large amounts, the integer division silently truncates toward zero (no documented rounding policy), and set_protocol_fee_bps in contracts/escrow/src/governance.rs accepts any u32 β including values >= 10_000, which would make the fee equal or exceed the released amount.
This issue makes fee computation overflow-safe, bounded, and explicitly rounded.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Use
checked_mul/checked_div(or a 256-bit widening) incalculate_protocol_feeand panic with a typed overflow error on failure. - Reject
set_protocol_fee_bpsvalues above a sane maximum (e.g.< 10_000) with a typed error. - Document the rounding direction and guarantee
fee <= milestone.amount. - Preserve append-only error codes and existing admin authorization.
- Fork the repo and create a branch
git checkout -b security/contracts-fee-rounding-bounds- Implement changes
- Write code in:
contracts/escrow/src/lib.rsandcontracts/escrow/src/governance.rsβ safe fee math and bps bounds. - Write comprehensive tests in:
contracts/escrow/src/test/protocol_fees.rsβ assert rounding, overflow rejection, and bps bound rejection. - Add documentation: describe the fee model in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: fee never exceeds the amount, no overflow.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: max amount with nonzero bps, bps at boundary, zero bps.
- Include full
cargo testoutput and a security notes section in the PR description.
fix: bound and overflow-protect protocol fee calculation
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Remove the duplicate Error and Contract definitions across lib.rs and types.rs" labels: type:refactor, area:error-types, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
contracts/escrow/src/types.rs defines enum Error twice (lines ~3β29 and ~95β122) with conflicting discriminants, plus a second Contract, ReleaseAuthorization, and MilestoneApprovals. Meanwhile contracts/escrow/src/lib.rs defines a third error enum, EscrowError, whose codes (e.g. AlreadyReleased = 9) disagree with types::Error::AlreadyReleased = 4. Two parallel error taxonomies with mismatched numeric codes make client-SDK error handling ambiguous and invite silent regressions.
This issue consolidates to a single canonical error enum and removes the shadow type definitions.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Pick one canonical error enum (preferably the
types::Errorexported viapub use), delete the duplicate definition, and migrateEscrowErrorreferences to it (or vice versa) without changing wire codes for already-shipped variants. - Remove the duplicate
Contract/ReleaseAuthorization/MilestoneApprovalsdefinitions, keeping one source of truth. - Keep all discriminants append-only and document the final code catalog.
- Fork the repo and create a branch
git checkout -b refactor/contracts-dedup-error-types- Implement changes
- Write code in:
contracts/escrow/src/types.rsandcontracts/escrow/src/lib.rsβ unify error/type definitions. - Write comprehensive tests in:
contracts/escrow/src/test/security.rsβ assert stable error codes for key failure paths. - Add documentation: update the error catalog in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no code reassignment for shipped variants.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: each previously-distinct error path still returns the documented code.
- Include full
cargo testoutput in the PR description.
refactor: consolidate duplicate Error and Contract type definitions
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Remove the duplicate next_contract_id call in create_contract" labels: type:refactor, area:create-contract, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
create_contract in contracts/escrow/src/lib.rs calls Self::next_contract_id(&env) twice in a row β let id = Self::next_contract_id(&env); then ttl::extend_next_contract_id_ttl(&env); then let id = Self::next_contract_id(&env); again. The first binding is immediately shadowed and the collision check runs twice for no reason. There is also an unused bump_next_contract_id helper marked #[allow(dead_code)] that duplicates the inline id + 1 write.
This issue cleans up the id-allocation path to a single call and removes the dead helper.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Collapse the duplicated
next_contract_idcalls into one, keeping the TTL bump and collision check. - Either wire
bump_next_contract_idinto the write path or delete it, removing the#[allow(dead_code)]. - Preserve overflow protection (
ContractIdOverflow) and collision protection (ContractIdCollision).
- Fork the repo and create a branch
git checkout -b refactor/contracts-single-id-alloc- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ dedupe id allocation increate_contract. - Write comprehensive tests in:
contracts/escrow/src/test/contract_id_allocation.rsβ assert sequential, gap-free, collision-safe ids. - Add documentation: note id-allocation invariants in
docs/escrow/state-persistence.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no reuse, no skipped ids.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: many sequential creates, collision attempt.
- Include full
cargo testoutput in the PR description.
refactor: remove duplicate next_contract_id call in create_contract
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Extract the repeated milestones-vector load/store into a single helper" labels: type:refactor, area:storage, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The pattern let milestone_key = Symbol::new(&env, "milestones"); env.storage().persistent().get(&(DataKey::Contract(contract_id), milestone_key)) is hand-rolled in at least five places across contracts/escrow/src/lib.rs (deposit_funds, release_milestone, refund_unreleased_milestones, get_milestones) and again in contracts/escrow/src/finalize.rs and contracts/escrow/src/approvals.rs. Each site re-derives the composite key, unwraps inconsistently (unwrap() vs ok_or), and bumps TTL separately, which is error-prone.
This issue centralizes milestone-vector access behind load_milestones / store_milestones helpers.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Add
load_milestones(env, contract_id) -> Vec<Milestone>andstore_milestones(env, contract_id, &Vec<Milestone>)that build the composite key once and bump TTL consistently. - Replace all open-coded milestone reads/writes with the helpers, normalizing error handling to a single not-found path.
- No behavioral change to entrypoints; purely a refactor with identical externally observable behavior.
- Fork the repo and create a branch
git checkout -b refactor/contracts-milestone-accessors- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ helpers plus call-site replacement across modules. - Write comprehensive tests in:
contracts/escrow/src/test/persistence.rsβ assert load/store round-trips and TTL bumps. - Add documentation: note the helpers in
docs/escrow/state-persistence.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: identical behavior, no missed TTL bumps.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: missing milestone vector, empty vector, large vector.
- Include full
cargo testoutput in the PR description.
refactor: centralize milestone vector load/store helpers
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Remove the unused MilestoneReleased DataKey variant or back it with storage" labels: type:refactor, area:storage, stack:soroban, stack:rust, priority:low, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
DataKey::MilestoneReleased(u32, u32) is declared in contracts/escrow/src/types.rs but is never read or written anywhere in the contract β release status is tracked solely on the Milestone.released boolean inside the milestones vector. The dangling variant suggests a per-milestone release-flag store that was never wired up, which is confusing for reviewers and for anyone reasoning about the storage layout.
This issue either removes the dead variant or actually backs milestone-release state with it.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Decide the canonical source of truth for release state (the
Milestone.releasedflag vs a dedicated key) and document it. - If removing: delete
MilestoneReleasedfromDataKeyand confirm no client SDK references it. - If keeping: write/read it in
release_milestoneconsistently and add ais_milestone_released(contract_id, index)reader. - Keep the
DataKeyenum layout append-only-safe for any persisted entries.
- Fork the repo and create a branch
git checkout -b refactor/contracts-milestone-released-key- Implement changes
- Write code in:
contracts/escrow/src/types.rsandcontracts/escrow/src/lib.rs. - Write comprehensive tests in:
contracts/escrow/src/test/release.rsβ assert release state is consistent post-change. - Add documentation: update the storage-key list in
docs/escrow/state-persistence.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: single source of truth for release state.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: released vs unreleased reads after the change.
- Include full
cargo testoutput in the PR description.
refactor: resolve the unused MilestoneReleased DataKey variant
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Consolidate the orphaned deposit, release, and refund modules into the active contract" labels: type:refactor, area:module-layout, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The escrow crate ships standalone deposit.rs, release.rs, refund.rs, refund_impl.rs, and create_contract.rs files under contracts/escrow/src/, but contracts/escrow/src/lib.rs only declares mod approvals; mod finalize; mod governance; mod ttl; mod types; plus dispute/migration. The deposit/release/refund logic that the contract actually runs is inlined in lib.rs, while these parallel files are dead duplicates (e.g. refund_impl.rs reimplements refund_unreleased_milestones). This is a maintenance hazard: fixes land in one copy and not the other.
This issue eliminates the duplication by either wiring these modules in as the single implementation or deleting them.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Audit
deposit.rs,release.rs,refund.rs,refund_impl.rs, andcreate_contract.rsagainst the inlinelib.rsimplementations. - For each, either promote the module to the canonical implementation (and
mod-declare it) or remove the dead file. - Ensure exactly one implementation of each entrypoint remains, with no behavioral change.
- Confirm the build has no orphaned
modwarnings and clippy passes.
- Fork the repo and create a branch
git checkout -b refactor/contracts-consolidate-orphan-modules- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ module declarations and removal of duplicate logic. - Write comprehensive tests in:
contracts/escrow/src/test/flows.rsβ assert the consolidated paths behave identically. - Add documentation: document the final module layout in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: single implementation per entrypoint.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: deposit/release/refund happy paths and failures post-consolidation.
- Include full
cargo testoutput in the PR description.
refactor: consolidate orphaned deposit/release/refund modules
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Wire amount_validation constants into a single MAX_SINGLE_AMOUNT enforcement path" labels: type:refactor, area:validation, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
contracts/escrow/src/amount_validation.rs defines MAX_SINGLE_AMOUNT_STROOPS, MIN_POSITIVE_AMOUNT, STROOP_PRECISION, and validate_single_amount, all marked #[allow(dead_code)] with comments noting they are "available for callers; not used internally." Meanwhile create_contract and deposit_funds in contracts/escrow/src/lib.rs hand-roll their own amount <= 0 checks and enforce no upper bound, so a single milestone can be i128::MAX.
This issue wires validate_single_amount into the real entrypoints so the module's bounds are actually enforced.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Call
validate_single_amountfor each milestone amount increate_contractand for theamountindeposit_funds, mappingAmountValidationErrorto the canonical contract error. - Remove the now-redundant inline
amount <= 0checks. - Drop the
#[allow(dead_code)]attributes once the items are used. - Keep behavior backward-compatible for amounts within bounds.
- Fork the repo and create a branch
git checkout -b refactor/contracts-wire-amount-validation- Implement changes
- Write code in:
contracts/escrow/src/lib.rsβ invokeamount_validationhelpers. - Write comprehensive tests in:
contracts/escrow/src/test/input_sanitization_amounts.rsβ assert max-bound and min-bound enforcement. - Add documentation: describe the validation bounds in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///). - Validate security assumptions: no amount above the max is accepted.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: amount at max, just above max, zero, negative.
- Include full
cargo testoutput in the PR description.
refactor: enforce amount_validation bounds in create_contract and deposit
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add tests for the dispute resolution_payouts split math in dispute.rs" labels: type:test, area:dispute, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
contracts/escrow/src/dispute.rs implements resolution_payouts for FullRefund, PartialRefund (70/30), FullPayout, and Split(client, freelancer), plus final_status_after_resolution. This pure money-splitting logic is the most security-sensitive code in the contract, yet it has no dedicated unit tests covering the 70/30 rounding, the Split total-must-equal-available rule, negative-split rejection, and the accounting-invariant guard.
This issue adds focused unit tests for the dispute payout calculations.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Test each
DisputeResolutionvariant against a range ofavailablebalances, asserting(client_payout, freelancer_payout)and that the two always sum toavailable. - Cover
PartialRefundrounding at odd amounts (e.g. available = 7 β 30% truncation). - Cover
Splitrejection when totals mismatch or amounts are negative (InvalidDisputeSplit). - Cover the
AccountingInvariantViolatedpath whenavailablewould be negative, and verifyfinal_status_after_resolutionreturnsRefundedonly on full refund.
- Fork the repo and create a branch
git checkout -b test/contracts-dispute-payouts- Implement changes
- Write code in:
contracts/escrow/src/dispute.rsβ no logic change expected; only add a#[cfg(test)]module if needed. - Write comprehensive tests in:
contracts/escrow/src/test/dispute.rsβ table-driven assertions over all variants. - Add documentation: describe the payout matrix in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: payouts conserve the available balance.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: zero available, odd-amount PartialRefund, mismatched Split.
- Include full
cargo testoutput in the PR description.
test: add resolution_payouts split-math coverage for dispute.rs
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add property tests for resolution_payouts conserving the available balance" labels: type:test, area:dispute, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
The Split and PartialRefund arms of resolution_payouts in contracts/escrow/src/dispute.rs must satisfy the invariant client_payout + freelancer_payout == available for all inputs that succeed. There is an existing proptest.rs/fuzz_test.rs harness in the crate but no property test pinning this conservation invariant for dispute payouts.
This issue adds a property test that fuzzes available and Split inputs to prove value is conserved and never created.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Generate random non-negative
availablevalues andSplit(client, freelancer)candidates; assert success iffclient + freelancer == availableand both>= 0. - Assert
FullRefund,FullPayout, andPartialRefundalways conserveavailableand never return negative payouts. - Use the repo's existing proptest configuration and bound the input domain to avoid overflow.
- Fork the repo and create a branch
git checkout -b test/contracts-dispute-conservation-proptest- Implement changes
- Write code in:
contracts/escrow/src/dispute.rsβ expose helpers if needed for testing. - Write comprehensive tests in:
contracts/escrow/src/proptest.rsβ conservation properties for dispute payouts. - Add documentation: note the invariant in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: no value creation across any input.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: available = 0, max-bounded available, boundary splits.
- Include full
cargo testoutput in the PR description.
test: add property tests for dispute payout conservation
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add tests asserting approval auto-expiry via temporary storage TTL" labels: type:test, area:approvals, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
approve_milestone stores approvals in temporary storage with PENDING_APPROVAL_TTL_LEDGERS (seven days) in contracts/escrow/src/approvals.rs, and check_approvals treats an expired/absent record as InsufficientApprovals (fail-closed). The inline unit tests cover approval and duplicate rejection but never advance the ledger past the TTL to prove that an aged approval actually stops a release.
This issue adds tests that advance the ledger sequence beyond the TTL and assert release fails.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Approve a milestone, advance
env.ledger()sequence beyondPENDING_APPROVAL_TTL_LEDGERS, and assertcheck_approvals/release_milestonefails withInsufficientApprovals. - Assert that a fresh approval within the bump threshold keeps the entry live.
- Cover each
ReleaseAuthorizationmode, including MultiSig where one approval expires before the second arrives.
- Fork the repo and create a branch
git checkout -b test/contracts-approval-ttl-expiry- Implement changes
- Write code in: no production change expected.
- Write comprehensive tests in:
contracts/escrow/src/test/ttl_tests.rsandcontracts/escrow/src/test/approval_expiry.rs. - Add documentation: note expiry semantics in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: expired approvals cannot release funds.
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: exactly-at-TTL, one ledger past TTL, refresh before expiry.
- Include full
cargo testoutput in the PR description.
test: assert milestone approvals auto-expire via temporary TTL
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add tests for accept_client_migration with an expired pending migration" labels: type:test, area:migration, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
accept_client_migration in contracts/escrow/src/migration.rs loads the pending record via read_if_live, which returns None once the PENDING_MIGRATION_TTL_LEDGERS (21-day) temporary entry has been evicted, and then panics with InvalidState. The existing client-migration tests cover propose/accept happy paths but do not advance the ledger past the migration TTL to confirm a stale proposal can no longer be accepted.
This issue adds tests covering expiry of the pending migration window.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Propose a migration, advance
env.ledger()sequence beyondPENDING_MIGRATION_TTL_LEDGERS, and assertaccept_client_migrationpanics withInvalidStateandhas_pending_client_migrationreturns false. - Assert acceptance within the window still succeeds and updates
contract.client. - Cover acceptance by the wrong
new_client(UnauthorizedRole).
- Fork the repo and create a branch
git checkout -b test/contracts-migration-expiry- Implement changes
- Write code in: no production change expected.
- Write comprehensive tests in:
contracts/escrow/src/test/client_migration.rs. - Add documentation: note the migration window in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: expired proposals cannot transfer client rights.
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: accept at boundary, accept after expiry, accept by wrong address.
- Include full
cargo testoutput in the PR description.
test: cover expired pending client migration acceptance
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add finalize_contract authorization and status-gate negative-path tests" labels: type:test, area:finalization, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
finalize_contract in contracts/escrow/src/finalize.rs enforces several preconditions: not paused, valid participant via require_finalizer_role, status must be Completed or Disputed, and no existing finalization record. Each of these is a distinct rejection path (ContractPaused, UnauthorizedRole, InvalidStatusTransition, AlreadyFinalized), but there is no dedicated test module asserting every guard, nor that a finalized contract blocks later release_milestone / refund_unreleased_milestones calls.
This issue adds comprehensive negative-path coverage for finalization.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Assert finalize fails while paused/emergency, by a non-participant, from a non-
Completed/Disputedstatus, and when already finalized. - Assert that after finalization,
release_milestoneandrefund_unreleased_milestonespanic withAlreadyFinalized(viarequire_not_finalized). - Assert the emitted
finalizedevent and thatget_finalization_recordreturns the snapshot.
- Fork the repo and create a branch
git checkout -b test/contracts-finalize-negative-paths- Implement changes
- Write code in: no production change expected.
- Write comprehensive tests in:
contracts/escrow/src/test/security.rsβ finalize guard coverage. - Add documentation: confirm the guard list in
docs/escrow/SECURITY.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: every finalize guard is enforced.
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: each rejection path plus a successful finalize then blocked mutation.
- Include full
cargo testoutput in the PR description.
test: add finalize_contract authorization and status-gate coverage
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add release_milestone tests for each ReleaseAuthorization mode's authorized callers" labels: type:test, area:release, stack:soroban, stack:rust, priority:high, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
release_milestone in contracts/escrow/src/lib.rs branches on ReleaseAuthorization::{ClientOnly, ArbiterOnly, ClientAndArbiter, MultiSig} to decide which caller may release, then separately calls approvals::check_approvals which requires a matching approval. The interaction between the caller-authorization match and the approval check is subtle (e.g. MultiSig permits client or freelancer to call but requires both to have approved), and there is no test matrix exercising every mode's authorized and unauthorized callers end-to-end.
This issue adds a full caller-by-mode authorization matrix for releases.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- For each
ReleaseAuthorizationmode, assert which callers succeed and which panic withUnauthorizedRole. - For MultiSig, assert release requires both client and freelancer approvals and that a single approval yields
InsufficientApprovals. - Assert releasing without any approval fails, and that releasing in non-
Fundedstatus fails withInvalidState.
- Fork the repo and create a branch
git checkout -b test/contracts-release-auth-matrix- Implement changes
- Write code in: no production change expected.
- Write comprehensive tests in:
contracts/escrow/src/test/release_authorization.rs. - Add documentation: tabulate the mode/caller matrix in
docs/escrow/README.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: only authorized callers with valid approvals release.
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: arbiter-only with client caller, MultiSig with one approval, no-approval release.
- Include full
cargo testoutput in the PR description.
test: add ReleaseAuthorization caller/approval matrix for release_milestone
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward. ++++++
type: Feature title: "Add deposit_funds tests for non-client callers and over-funding behavior" labels: type:test, area:deposits, stack:soroban, stack:rust, priority:medium, MAYBE REWARDED, GRANTFOX OSS, OFFICIAL CAMPAIGN assignees: ''
deposit_funds in contracts/escrow/src/lib.rs rejects non-client callers with UnauthorizedRole, rejects non-positive amounts with AmountMustBePositive, and only transitions to Funded once funded_amount >= total_amount β but it does not cap deposits at the milestone total, so a client can over-fund. The README asserts "deposits cannot exceed the required escrow total," which the code does not currently enforce. The behavior here needs locked-in tests so the discrepancy is visible and any cap change is covered.
This issue adds deposit-path tests for callers and amounts, documenting actual vs intended over-funding behavior.
- Repository scope: Talenttrust/Talenttrust-Contracts only.
- Assert a non-client caller panics with
UnauthorizedRoleand a zero/negative amount panics withAmountMustBePositive. - Assert the
Created β Fundedtransition at exactly the total and document whether over-funding is accepted (current behavior) or rejected. - If the intended behavior is a cap, add a failing test and an accompanying fix; otherwise pin current behavior with a comment referencing the README discrepancy.
- Fork the repo and create a branch
git checkout -b test/contracts-deposit-caller-and-overfund- Implement changes
- Write code in:
contracts/escrow/src/lib.rsonly if a cap is added. - Write comprehensive tests in:
contracts/escrow/src/test/deposit.rs. - Add documentation: reconcile the over-funding claim in
README.md. - Include NatSpec-style doc comments (
///) where helpful. - Validate security assumptions: only the client funds; transitions are correct.
- Write code in:
- Test and commit
- Run
cargo fmt --all -- --check,cargo build, andcargo test. - Cover edge cases: freelancer caller, arbiter caller, exact-total, over-total deposit.
- Include full
cargo testoutput in the PR description.
test: add deposit_funds caller and over-funding coverage
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
- π¬ Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
- β This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project β if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.