diff --git a/src/popup/views/addressToken.js b/src/popup/views/addressToken.js
index 2701963..1284029 100644
--- a/src/popup/views/addressToken.js
+++ b/src/popup/views/addressToken.js
@@ -11,6 +11,7 @@ const {
balanceLine,
} = require("./helpers");
const { state, currentAddress, saveState } = require("../../shared/state");
+const { TOKEN_BY_ADDRESS } = require("../../shared/tokenList");
const {
formatUsd,
getPrice,
@@ -142,30 +143,24 @@ function show() {
const tokenHolders = tb && tb.holders != null ? tb.holders : null;
const dot = addressDotHtml(tokenId);
const tokenLink = `https://etherscan.io/token/${escapeHtml(tokenId)}`;
- let infoHtml =
- `
${dot}` +
+ const knownToken = TOKEN_BY_ADDRESS.get(tokenId.toLowerCase());
+ const projectUrl = knownToken && knownToken.url ? knownToken.url : null;
+ let infoHtml = `
Contract Address
`;
+ infoHtml +=
+ `
`;
- const details = [];
if (tokenName)
- details.push(`
Name: ${tokenName}`);
+ infoHtml += `
Name: ${tokenName}
`;
if (tokenSymbol)
- details.push(
- `
Symbol: ${tokenSymbol}`,
- );
+ infoHtml += `
Symbol: ${tokenSymbol}
`;
if (tokenDecimals != null)
- details.push(
- `
Decimals: ${tokenDecimals}`,
- );
+ infoHtml += `
Decimals: ${tokenDecimals}
`;
if (tokenHolders != null)
- details.push(
- `
Holders: ${Number(tokenHolders).toLocaleString()}`,
- );
- if (details.length > 0) {
- infoHtml += `
${details.join("")}
`;
- }
+ infoHtml += `
Holders: ${Number(tokenHolders).toLocaleString()}
`;
+ if (projectUrl)
+ infoHtml += `
`;
contractInfo.innerHTML = infoHtml;
contractInfo.classList.remove("hidden");
} else {