Skip to content

feat: restrict dispute raising to invoice parties - #315

Open
Buchi-Einstein wants to merge 1 commit into
WHEELBACK:mainfrom
Buchi-Einstein:feature/restrict-raise-dispute-to-actual-invoice-parties
Open

feat: restrict dispute raising to invoice parties#315
Buchi-Einstein wants to merge 1 commit into
WHEELBACK:mainfrom
Buchi-Einstein:feature/restrict-raise-dispute-to-actual-invoice-parties

Conversation

@Buchi-Einstein

Copy link
Copy Markdown

Description

Restrict raise_dispute on both the invoice and treasury contracts so that only the invoice's merchant or payer (customer) can open a dispute. Previously any address could grief a settlement.

Changes

Invoice contract (COMEBACKHERE-contracts/contracts/invoice/src/lib.rs)

  • Added NotAParty error variant to ContractError
  • Modified raise_dispute to fetch the invoice record and verify claimant is either invoice.merchant or invoice.customer

Treasury contract (COMEBACKHERE-contracts/contracts/treasury/src/lib.rs)

  • Added NotSettlementParty error variant to TreasuryError
  • Modified raise_dispute to fetch the settlement record and verify signer is settlement.merchant

Tests

  • Added tests for random address rejection, merchant success, and customer (payer) success on invoice contract
  • Added tests for non-merchant rejection and merchant success on treasury contract
  • Updated existing integration tests to use the merchant as the disputing party

Security

This is a security-sensitive change. Previously any address could call raise_dispute on any invoice/settlement, allowing griefing attacks that put legitimate settlements on hold. Now only the invoice parties (merchant/customer) can raise disputes.

Closes #177

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Buchi-Einstein Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restrict raise_dispute to actual invoice parties

1 participant