Skip to content

Reject cross-token invoice funding (token mismatch guard) #17

Description

@Nursca

Description
If an invoice is denominated in USDC but an LP tries to fund it with EURC, the contract should reject this. Currently there may be no explicit check for token matching between invoice denomination and funding token.

Requirements and context

  • Store token: Address on the invoice struct at submission time
  • In fund_invoice(), validate that the provided token matches the invoice's token
  • Return Error::TokenMismatch
  • Write tests for mismatch and match scenarios

Suggested execution

git checkout -b fix/token-mismatch-guard
  • Update Invoice struct to include token field
  • Add validation in fund_invoice()
  • Write tests

Example commit message
fix: add token mismatch guard in fund_invoice

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignStellar WaveIssues in the Stellar wave program

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions