diff --git a/src/popup/views/confirmTx.js b/src/popup/views/confirmTx.js index f11cf68..787de0b 100644 --- a/src/popup/views/confirmTx.js +++ b/src/popup/views/confirmTx.js @@ -14,6 +14,7 @@ const { showError, hideError, showView, + showFlash, addressTitle, addressDotHtml, escapeHtml, @@ -95,11 +96,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}` + + `
`; tokenSection.classList.remove("hidden"); + // Attach click-to-copy on the contract address + const copyEl = tokenSection.querySelector("[data-copy]"); + if (copyEl) { + copyEl.onclick = () => { + navigator.clipboard.writeText(copyEl.dataset.copy); + showFlash("Copied!"); + }; + } } else { tokenSection.classList.add("hidden"); }