Fix token deposit & Fix EIP-1559 for goerli network

This commit is contained in:
Ayanami 2022-02-05 20:08:17 +09:00
parent 5064b379f5
commit 9ec34aa423
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4

6
cli.js

@ -94,7 +94,7 @@ async function generateTransaction(to, encodedData, value = 0) {
async function txoptions() {
// Generate EIP-1559 transaction
if (netId == 1 || netId == 5) {
if (netId == 1) {
tx = {
to : to,
value : value,
@ -104,7 +104,7 @@ async function generateTransaction(to, encodedData, value = 0) {
gas : gasLimit,
data : encodedData
}
} else if (netId == 137 || netId == 43114) {
} else if (netId == 5 || netId == 137 || netId == 43114) {
tx = {
to : to,
value : value,
@ -207,7 +207,7 @@ async function deposit({ currency, amount }) {
}
console.log('Submitting deposit transaction')
await generateTransaction(contractAddress, tornado.methods.deposit(toHex(deposit.commitment)).encodeABI())
await generateTransaction(contractAddress, tornado.methods.deposit(tornadoInstance, toHex(deposit.commitment), []).encodeABI())
await printERC20Balance({ address: tornadoContract._address, name: 'Tornado contract' })
await printERC20Balance({ address: senderAccount, name: 'Sender account' })
}