Define netSymbol in advance

This commit is contained in:
Ayanami 2022-01-26 23:40:00 +09:00
parent 15fe31445a
commit e9ff6d1488
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
1 changed files with 1 additions and 2 deletions

3
cli.js
View File

@ -963,8 +963,8 @@ async function init({ rpc, noteNetId, currency = 'dai', amount = '100', torPort,
senderAccount = (await web3.eth.getAccounts())[0]
} else {
try {
netSymbol = getCurrentNetworkSymbol()
if (balanceCheck) {
netSymbol = getCurrentNetworkSymbol()
currency = netSymbol.toLowerCase()
amount = Object.keys(config.deployments[`netId${netId}`][currency].instanceAddress)[0]
}
@ -981,7 +981,6 @@ async function init({ rpc, noteNetId, currency = 'dai', amount = '100', torPort,
process.exit(1)
}
}
netSymbol = getCurrentNetworkSymbol()
tornado = new web3.eth.Contract(contractJson, tornadoAddress)
tornadoContract = new web3.eth.Contract(instanceJson, tornadoInstance)
contractAddress = tornadoAddress