StabilityNexus / StabilityNexus/Chainvoice
Gas Fees Optimization: Reduce Storage Reads
Open
@aniket866 is already working on this.
Since Jan 28, 2026.
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 47
- Avg merge
- 17h 47m
- Merged PRs (30d)
- 4
Description
-
Issue: payInvoice reads invoice.tokenAddress and invoice.amountDue from storage multiple times.
-
Impact: Each SLOAD costs 100 gas (after the first cold load); repeated reads waste gas.
-
Fix: Cache the InvoiceDetails struct (or specific fields) in memory at the start of the function and read from the stack.
@kumawatkaran523 Please assign me this Optimization fix.
Contributor 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.
Assessment
This issue has not been assessed yet.