[BUG]: Add cancel invoices batch to match create invoices batch and pay invoices batch
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- solidity
- Domain
- blockchain
Research direction
Start from the existing cancel invoice(uint256 invoiceId) and pay invoices batch functions in the contract, and check how the batch size constant and duplicate-ID handling from #202 are done. Add cancel invoices batch(uint256[] calldata invoiceIds) with the same per-invoice checks, custom errors, and cancellation event, reverting the whole batch on any failure. Done means the batch cancels valid invoices, reverts on duplicates, an oversized array, or any unauthorized, paid, or already-cancelled invoice, and emits one event per invoice; confirm with the contract's existing test suite.
Written by the indexing model from the issue text.
Description
Bug Description
Chainvoice has batch functions for creating invoices (create invoice batch, up to 30) and paying them (pay invoices batch, up to 50), but cancelling is single-only through cancel invoice(uint256 invoiceId).
The gap shows up when someone creates a batch of up to 30 invoices in one transaction and then needs to cancel several of them, for example because of a wrong amount or the wrong token. Creating them took one transaction, but cancelling them takes one transaction each.
Proposal: add cancel invoices batch(uint256[] calldata invoiceIds), following the same pattern as pay invoices batch.
How I'd handle the details:
- Same checks as cancel invoice for each invoice (caller is the creator, not already paid or cancelled), reverting with the existing custom errors, so behavior matches the single version
- The whole batch reverts if any invoice fails, which is how pay invoices batch behaves, so a batch is all-or-nothing
- A maximum batch size, using a constant like the other two batch functions
- Reject duplicate IDs in the array, so the fix in #202 isn't repeated here
- Emit the same cancellation event for each invoice, so indexers and the frontend don't need changes
I'd like to work on this.
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 62
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 18
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/Chainvoice
-
[BUG]: Smart Batch Suggestions ignore active filters and select invoices hidden from the tablePossibly taken @anshulchikhale30-p claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
StabilityNexus/Chainvoice#331 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Invoices with the same date are sorted out of order (ids compared as strings)Possibly taken @anshulchikhale30-p claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
StabilityNexus/Chainvoice#330 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Stale token-list requests can overwrite state after switching networksPossibly taken @JANAKIRAM218 claimed this 10 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StabilityNexus/Chainvoice#325 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Invoice PDF totals overlap the footer with 10 line itemsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
StabilityNexus/Chainvoice#310 · 4 comments ·
Maintainers usually reply within 2 days
-
[BUG]: Batch invoice summary truncates displayed amount precision to four decimal placesPossibly taken @JANAKIRAM218 claimed this 29 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
StabilityNexus/Chainvoice#294 · 2 comments ·
Maintainers usually reply within 2 days
All issues in StabilityNexus/Chainvoice
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day