Bug Description
The PDF generator currently hardcodes ETH for native token representation and network fee labels.
On non-ETH chains (for example Polygon/BSC), exported PDFs still show ETH instead of the correct native symbol (MATIC/BNB).
Why This Is Incorrect
- In
frontend/src/utils/generateInvoicePDF.js:343, token symbol falls back to ETH.
- In
frontend/src/utils/generateInvoicePDF.js:527, network fee is always rendered as ETH.
Note About Reproduction
We used browser console JavaScript for reproduction because Lit services were down.
This issue is in PDF formatting logic and can be reproduced without Lit and without any on-chain transaction cost.
Steps to Reproduce
- Run frontend locally.
- Open browser DevTools Console.
- Execute:
const mod = await import("/src/utils/generateInvoicePDF.js");
const invoice = {
id: 999,
isCancelled: false,
isPaid: false,
amountDue: "1.25",
issueDate: new Date().toISOString(),
dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
chainId: 137, // Polygon
paymentToken: null, // Native path
user: {
fname: "Alice",
lname: "Sender",
address: "0x1111111111111111111111111111111111111111",
email: "alice@example.com"
},
client: {
fname: "Bob",
lname: "Receiver",
address: "0x2222222222222222222222222222222222222222",
email: "bob@example.com"
},
items: [
{
description: "Design",
qty: "1",
unitPrice: "1.25",
discount: "0",
tax: "0",
amount: "1.25"
}
]
};
const feeWei = "21000000000000";
const pdf = await mod.generateInvoicePDF(invoice, feeWei);
pdf.save("polygon-native-symbol-bug.pdf");
Open the generated PDF and record:
- Payment currency displays Ether (ETH)
Network fee displays ETH
- Chain context is Polygon (chainId: 137)
Expected Behavior
- For chainId: 137, native symbol should be MATIC.
- For chainId: 56, native symbol should be BNB.
- Network fee label should use the active chain native symbol, not always ETH.
Actual Behavior
- PDF displays ETH for native token and network fee regardless of chain context.
Logs and Screenshots
Environment Details
OS: Windows 11
Browser: Chrome
Impact
Medium - Feature works but has issues
Code of Conduct
Bug Description
The PDF generator currently hardcodes
ETHfor native token representation and network fee labels.On non-ETH chains (for example Polygon/BSC), exported PDFs still show
ETHinstead of the correct native symbol (MATIC/BNB).Why This Is Incorrect
frontend/src/utils/generateInvoicePDF.js:343, token symbol falls back toETH.frontend/src/utils/generateInvoicePDF.js:527, network fee is always rendered asETH.Note About Reproduction
We used browser console JavaScript for reproduction because Lit services were down.
This issue is in PDF formatting logic and can be reproduced without Lit and without any on-chain transaction cost.
Steps to Reproduce
Open the generated PDF and record:
Network fee displays ETH
Expected Behavior
Actual Behavior
Logs and Screenshots
Environment Details
OS: Windows 11
Browser: Chrome
Impact
Medium - Feature works but has issues
Code of Conduct