diff --git a/src/popup/views/confirmTx.js b/src/popup/views/confirmTx.js
index f11cf68..5e8ff1e 100644
--- a/src/popup/views/confirmTx.js
+++ b/src/popup/views/confirmTx.js
@@ -95,10 +95,22 @@ function show(txInfo) {
// Token contract section (ERC-20 only)
const tokenSection = $("confirm-token-section");
if (isErc20) {
+ const dot = addressDotHtml(txInfo.token);
const link = etherscanTokenLink(txInfo.token);
$("confirm-token-contract").innerHTML =
- escapeHtml(txInfo.token) +
- `
${EXT_ICON}`;
+ `
` +
+ dot +
+ `
${escapeHtml(txInfo.token)}` +
+ `
${EXT_ICON}` +
+ `
`;
+ if (txInfo.tokenName) {
+ $("confirm-token-contract").innerHTML +=
+ `
Name: ${escapeHtml(txInfo.tokenName)}
`;
+ }
+ if (txInfo.tokenSymbol) {
+ $("confirm-token-contract").innerHTML +=
+ `
Symbol: ${escapeHtml(txInfo.tokenSymbol)}
`;
+ }
tokenSection.classList.remove("hidden");
} else {
tokenSection.classList.add("hidden");
@@ -273,6 +285,13 @@ function hidePasswordModal() {
}
function init(ctx) {
+ $("confirm-token-section").addEventListener("click", (e) => {
+ const copyEl = e.target.closest("[data-copy]");
+ if (copyEl) {
+ navigator.clipboard.writeText(copyEl.dataset.copy);
+ }
+ });
+
$("btn-confirm-send").addEventListener("click", () => {
showPasswordModal();
});
diff --git a/src/popup/views/send.js b/src/popup/views/send.js
index fda8a66..0fc2e01 100644
--- a/src/popup/views/send.js
+++ b/src/popup/views/send.js
@@ -10,7 +10,11 @@ const {
const { state, currentAddress } = require("../../shared/state");
let ctx;
const { getProvider } = require("../../shared/balances");
-const { KNOWN_SYMBOLS, resolveSymbol } = require("../../shared/tokenList");
+const {
+ KNOWN_SYMBOLS,
+ TOKEN_BY_ADDRESS,
+ resolveSymbol,
+} = require("../../shared/tokenList");
const EXT_ICON =
`
` +
@@ -124,6 +128,7 @@ function init(_ctx) {
let tokenSymbol = null;
let tokenBalance = null;
+ let tokenName = null;
if (token !== "ETH") {
const tb = (addr.tokenBalances || []).find(
(t) => t.address.toLowerCase() === token.toLowerCase(),
@@ -134,6 +139,17 @@ function init(_ctx) {
state.trackedTokens,
);
tokenBalance = tb ? tb.balance || "0" : "0";
+ // Resolve token name from balances, tracked tokens, or known list
+ const lower = token.toLowerCase();
+ tokenName =
+ (tb && tb.name) ||
+ (
+ (state.trackedTokens || []).find(
+ (t) => t.address.toLowerCase() === lower,
+ ) || {}
+ ).name ||
+ (TOKEN_BY_ADDRESS.get(lower) || {}).name ||
+ null;
}
ctx.showConfirmTx({
@@ -145,6 +161,7 @@ function init(_ctx) {
balance: addr.balance,
tokenSymbol: tokenSymbol,
tokenBalance: tokenBalance,
+ tokenName: tokenName,
});
});