From 44a8b82b000e61c347491cd915011c23a1ca1c7d Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 16 May 2023 18:00:35 +0300 Subject: [PATCH] Add withdrawal address validation according to this issue: https://development.tornadocash.community/tornadocash/tornado-cli/issues/6 --- cli.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli.js b/cli.js index 6ee2ae2..a537149 100755 --- a/cli.js +++ b/cli.js @@ -457,6 +457,11 @@ async function withdraw({ deposit, currency, amount, recipient, relayerURL, refu if (currency === netSymbol.toLowerCase() && refund !== '0') { throw new Error('The ETH purchase is supposted to be 0 for ETH withdrawals'); } + + if (!web3.utils.isAddress(recipient)) { + throw new Error('Recipient address is not valid'); + } + refund = toWei(refund); if (relayerURL) { if (relayerURL.endsWith('.eth')) {