Skip to content

[BUG]: Batch invoice creation accepts contracts without ERC-20 return data #215

Description

@Anand-0037

Bug

createInvoice() rejects a token when balanceOf or allowance returns less than 32 bytes, but createInvoicesBatch() only checks whether the balanceOf call succeeds. A fallback-only contract is therefore accepted as a batch token even though it does not implement ERC-20 return data. The resulting invoice cannot be paid.

Reproduction

On main at e299e8a, a Foundry test using a fallback-only token shows:

  • createInvoice() reverts with InvalidToken;
  • createInvoicesBatch() succeeds with the same token;
  • payment of the accepted batch-created invoice reverts and rolls back.

This inconsistency was also noted during the review of PR #102, but I could not find a follow-up issue or implementation PR for it.

Expected

Batch creation should reject malformed token contracts consistently with the single-invoice path. Tests should cover failed calls and missing return data.

If this is still worth fixing, please assign it to me. I would keep the change limited to consistent token validation and focused Foundry regression tests.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions