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
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
token: Addresson the invoice struct at submission timefund_invoice(), validate that the provided token matches the invoice's tokenError::TokenMismatchSuggested execution
Invoicestruct to includetokenfieldfund_invoice()Example commit message
fix: add token mismatch guard in fund_invoice