Check senderAccount for withdrawal using private key

This commit is contained in:
Ayanami 2022-03-11 12:55:52 +09:00
parent b7931adaa4
commit 5e89da416f
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
1 changed files with 1 additions and 0 deletions

1
cli.js
View File

@ -469,6 +469,7 @@ async function withdraw({ deposit, currency, amount, recipient, relayerURL, refu
}
} else {
// using private key
assert(senderAccount, 'Private Key should be supplied through .env file if you want to make withdrawal without relayers');
// check if the address of recepient matches with the account of provided private key from environment to prevent accidental use of deposit address for withdrawal transaction.
assert(recipient.toLowerCase() == senderAccount.toLowerCase(), 'Withdrawal recepient mismatches with the account of provided private key from environment file');