diff --git a/src/popup/views/confirmTx.js b/src/popup/views/confirmTx.js index 522e9e5..82c14dd 100644 --- a/src/popup/views/confirmTx.js +++ b/src/popup/views/confirmTx.js @@ -244,6 +244,7 @@ function show(txInfo) { showView("confirm-tx"); estimateGas(txInfo); + checkRecipientHistory(txInfo); } async function estimateGas(txInfo) { @@ -286,6 +287,28 @@ async function estimateGas(txInfo) { } } +async function checkRecipientHistory(txInfo) { + try { + const provider = getProvider(state.rpcUrl); + const txCount = await provider.getTransactionCount(txInfo.to); + if (txCount === 0) { + const warningsEl = $("confirm-warnings"); + const warning = + `