-
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.