fix abi, goerli compatibility

This commit is contained in:
poma 2021-03-16 00:59:33 +03:00
parent 565ff3dc35
commit 10170b2155
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657
5 changed files with 36 additions and 23 deletions

View File

@ -4,10 +4,11 @@ BROADCAST_NODES=https://api.taichi.network:10001/rpc/public,https://cloudflare-e
PRIVATE_KEY=
# the block of the tornadoTrees contract deployment
INSERT_BATCH_SIZE=128
INSERT_BATCH_SIZE=256
# should not be more often than CONFIRMATION_BLOCKS time. e.g every 3 minutes
CONFIRMATION_BLOCKS=0
# a number in Gwei
GAS_PRICE=20
TORNADO_TREES=
GAS_PRICE=200
TORNADO_TREES=0x722122df12d4e14e13ac3b6895a86e84145b6967
NET_ID=1

View File

@ -12,7 +12,6 @@ COPY --from=tornadocash/tornado-trees \
/app/artifacts/circuits/BatchTreeUpdate.r1cs \
./snarks/
COPY package.json yarn.lock ./
RUN yarn && yarn cache clean --force
COPY . .

View File

@ -6,21 +6,11 @@
"name": "_governance",
"type": "address"
},
{
"internalType": "address",
"name": "_tornadoProxy",
"type": "address"
},
{
"internalType": "contract ITornadoTreesV1",
"name": "_tornadoTreesV1",
"type": "address"
},
{
"internalType": "contract IBatchTreeUpdateVerifier",
"name": "_treeUpdateVerifier",
"type": "address"
},
{
"components": [
{
@ -352,6 +342,24 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_tornadoProxy",
"type": "address"
},
{
"internalType": "contract IBatchTreeUpdateVerifier",
"name": "_treeUpdateVerifier",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lastProcessedDepositLeaf",
@ -583,9 +591,9 @@
"type": "bytes32"
},
{
"internalType": "uint256",
"internalType": "uint32",
"name": "_pathIndices",
"type": "uint256"
"type": "uint32"
},
{
"components": [

View File

@ -13,14 +13,19 @@ const tornadoTreesV1 = new ethers.Contract(
provider,
)
const instances = [
const instances = process.env.NET_ID === '1' ? [
'0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc',
'0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936',
'0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF',
'0xA160cdAB225685dA1d56aa342Ad8841c3b53f291',
] : [
'0x3aac1cC67c2ec5Db4eA850957b967Ba153aD6279',
'0x723B78e67497E85279CB204544566F4dC5d2acA0',
'0x0E3A09dDA6B20aFbB34aC7cD4A6881493f3E7bf7',
'0x6Bf694a291DF3FeC1f7e69701E3ab6c592435Ae7',
]
const tornadoTreesDeploymentBlock = 11474714
const tornadoTreesDeploymentBlock = process.env.NET_ID === '1' ? 11474714 : 3945174
async function getTornadoEvents({ instances, fromBlock, toBlock, type, provider }) {
const hashName = type === 'deposit' ? 'commitment' : 'nullifierHash'
@ -184,8 +189,8 @@ async function getCommittedWithdrawals() {
fs.writeFileSync('./cache/committedWithdrawals.json', JSON.stringify(events, null, 2))
}
// getCommittedDeposits()
// getCommittedWithdrawals()
getCommittedDeposits()
getCommittedWithdrawals()
// getPendingDeposits()
// getPendingWithdrawals()
getPendingDeposits()
getPendingWithdrawals()

View File

@ -2,7 +2,7 @@ const { getTornadoTrees, getProvider } = require('./singletons')
const { action } = require('./utils')
const ethers = require('ethers')
const abi = new ethers.utils.AbiCoder()
const fs = require('fs')
// const fs = require('fs')
async function getTornadoTreesEvents(type, fromBlock, toBlock) {
const eventName = type === action.DEPOSIT ? 'DepositData' : 'WithdrawalData'