mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-06 08:15:41 -04:00
Merge branch 'master' into phase2
This commit is contained in:
commit
6d383235bb
4 changed files with 26 additions and 4 deletions
12
cli.js
12
cli.js
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env NODE_OPTIONS=--no-warnings node
|
||||
#!/usr/bin/env node
|
||||
// Temporary demo client
|
||||
// Works both in browser and node.js
|
||||
|
||||
|
@ -515,6 +515,16 @@ async function init({ rpc, noteNetId, currency = 'dai', amount = '100' }) {
|
|||
tokenAddress = currency !== 'eth' ? erc20ContractJson.networks[netId].address : null
|
||||
senderAccount = (await web3.eth.getAccounts())[0]
|
||||
} else {
|
||||
try {
|
||||
const account = web3.eth.accounts.privateKeyToAccount('0x' + PRIVATE_KEY)
|
||||
web3.eth.accounts.wallet.add('0x' + PRIVATE_KEY)
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
web3.eth.defaultAccount = account.address
|
||||
senderAccount = account.address
|
||||
} catch(e) {
|
||||
console.error('Please provide PRIVATE_KEY in .env file')
|
||||
process.exit(1)
|
||||
}
|
||||
try{
|
||||
tornadoAddress = config.deployments[`netId${netId}`][currency].instanceAddress[amount]
|
||||
if (!tornadoAddress) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue