feat: add Avalanche

This commit is contained in:
Danil Kovtonyuk 2021-09-15 01:28:22 +10:00
parent 0065747552
commit 2e7c35cac8
6 changed files with 152 additions and 4 deletions

View File

@ -29,6 +29,12 @@ const contracts = [
name: 'Echoer',
address: '0x37e6859804b6499d1e4a86d70a5fdd5de6a0ac65',
},
{
prod: 4285638,
network: 'avalanche',
name: 'Echoer',
address: '0xEd2B6bf192cFAb45810FC06c5E44e4Df48Eef47d',
},
];
module.exports = contracts;

View File

@ -1,9 +1,10 @@
const deployedBlocks = {
bsc: 8159290,
xdai: 17754561,
matic: 16257962,
goerli: 3781595,
mainnet: 9116966,
matic: 16257962,
xdai: 17754561,
bsc: 8159290,
avalanche: 4285638,
};
const contracts = [
@ -407,6 +408,38 @@ const contracts = [
name: 'Instance',
address: '0x0E3A09dDA6B20aFbB34aC7cD4A6881493f3E7bf7',
},
{
prod: deployedBlocks.avalanche,
amount: '0.1',
network: 'avalanche',
currency: 'avax',
name: 'Instance',
address: '0x25b5aD99DE3a1d713d3E5578413002ff6F89744d',
},
{
prod: deployedBlocks.avalanche,
amount: '10',
network: 'avalanche',
currency: 'avax',
name: 'Instance',
address: '0x44139ab9F929CC10cdCEBddca8008e07ac52954E',
},
// {
// prod: deployedBlocks.avalanche,
// amount: '100',
// network: 'avalanche',
// currency: 'avax',
// name: 'Instance',
// address: '',
// },
// {
// prod: deployedBlocks.avalanche,
// amount: '500',
// network: 'avalanche',
// currency: 'avax',
// name: 'Instance',
// address: '',
// },
];
module.exports = contracts;

View File

@ -29,6 +29,12 @@ const contracts = [
network: 'goerli',
address: '0x454d870a72e29d5e5697f635128d18077bd04c60',
},
{
prod: 4285638,
name: 'Proxy',
network: 'avalanche',
address: '0xa77350E1a72bE5bC7634d359C5011b4E359f4320',
},
];
module.exports = contracts;

View File

@ -8,29 +8,34 @@
"generate-matic": "yarn codegen:tornado-matic && yarn build:tornado-matic",
"generate-mainnet": "yarn codegen:tornado-mainnet && yarn build:tornado-mainnet",
"generate-goerli": "yarn codegen:tornado-goerli && yarn build:tornado-goerli",
"generate-avalanche": "yarn codegen:tornado-avalanche && yarn build:tornado-avalanche",
"yaml:tornado-bsc": "node ./create-yaml-file create-yaml -e bsc | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-bsc.yaml",
"yaml:tornado-xdai": "node ./create-yaml-file create-yaml -e xdai | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-xdai.yaml",
"yaml:tornado-matic": "node ./create-yaml-file create-yaml -e matic | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-matic.yaml",
"yaml:tornado-mainnet": "node ./create-yaml-file create-yaml -e mainnet | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-mainnet.yaml",
"yaml:tornado-goerli": "node ./create-yaml-file create-yaml -e goerli | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-goerli.yaml",
"yaml:tornado-avalanche": "node ./create-yaml-file create-yaml -e avalanche | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-avalanche.yaml",
"codegen": "graph codegen",
"codegen:tornado-bsc": "yarn yaml:tornado-bsc && yarn codegen -- subgraphs/tornado-subgraph-bsc.yaml",
"codegen:tornado-xdai": "yarn yaml:tornado-xdai && yarn codegen -- subgraphs/tornado-subgraph-xdai.yaml",
"codegen:tornado-matic": "yarn yaml:tornado-matic && yarn codegen -- subgraphs/tornado-subgraph-matic.yaml",
"codegen:tornado-mainnet": "yarn yaml:tornado-mainnet && yarn codegen -- subgraphs/tornado-subgraph-mainnet.yaml",
"codegen:tornado-goerli": "yarn yaml:tornado-goerli && yarn codegen -- subgraphs/tornado-subgraph-goerli.yaml",
"codegen:tornado-avalanche": "yarn yaml:tornado-avalanche && yarn codegen -- subgraphs/tornado-subgraph-avalanche.yaml",
"build": "graph build",
"build:tornado-bsc": "graph build subgraphs/tornado-subgraph-bsc.yaml",
"build:tornado-xdai": "graph build subgraphs/tornado-subgraph-xdai.yaml",
"build:tornado-matic": "graph build subgraphs/tornado-subgraph-matic.yaml",
"build:tornado-mainnet": "graph build subgraphs/tornado-subgraph-mainnet.yaml",
"build:tornado-goerli": "graph build subgraphs/tornado-subgraph-goerli.yaml",
"build:tornado-avalanche": "graph build subgraphs/tornado-subgraph-avalanche.yaml",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token $TOKEN",
"deploy:tornado-bsc": "yarn deploy -- tornadocash/bsc-tornado-subgraph subgraphs/tornado-subgraph-bsc.yaml",
"deploy:tornado-xdai": "yarn deploy -- tornadocash/xdai-tornado-subgraph subgraphs/tornado-subgraph-xdai.yaml",
"deploy:tornado-matic": "yarn deploy -- tornadocash/matic-tornado-subgraph subgraphs/tornado-subgraph-matic.yaml",
"deploy:tornado-mainnet": "yarn deploy -- tornadocash/mainnet-tornado-subgraph subgraphs/tornado-subgraph-mainnet.yaml",
"deploy:tornado-goerli": "yarn deploy -- tornadocash/goerli-tornado-subgraph subgraphs/tornado-subgraph-goerli.yaml"
"deploy:tornado-goerli": "yarn deploy -- tornadocash/goerli-tornado-subgraph subgraphs/tornado-subgraph-goerli.yaml",
"deploy:tornado-avalanche": "yarn deploy -- tornadocash/avalanche-tornado-subgraph subgraphs/tornado-subgraph-avalanche.yaml"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.20.0",

View File

@ -150,4 +150,10 @@ contractsToInstances.set("0x723b78e67497e85279cb204544566f4dc5d2aca0", // Inst
contractsToInstances.set("0x0e3a09dda6b20afbb34ac7cd4a6881493f3e7bf7", // Instance-eth-100
  "eth-100"
);
contractsToInstances.set("0x25b5ad99de3a1d713d3e5578413002ff6f89744d", // Instance-avax-0.1
  "avax-0.1"
);
contractsToInstances.set("0x44139ab9f929cc10cdcebddca8008e07ac52954e", // Instance-avax-10
  "avax-10"
);
// this is a read only file generated by manual inputs to file mustache/templates/rates/contracts.js.

View File

@ -0,0 +1,92 @@
specVersion: 0.0.2
description: Proxy
repository: https://github.com/tornadocash/tornado-subgraph
schema:
file: ../schema.graphql
dataSources:
- kind: ethereum/contract
name: Echoer
network: avalanche
source:
address: "0xEd2B6bf192cFAb45810FC06c5E44e4Df48Eef47d"
abi: Echoer
startBlock: 4285638
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ../src/mapping-echo-account.ts
entities:
- NoteAccount
abis:
- name: Echoer
file: ../abis/Echoer.json
eventHandlers:
- event: Echo(indexed address,bytes)
handler: handleEcho
- kind: ethereum/contract
name: Instance-0.1-avax
network: avalanche
source:
address: "0x25b5aD99DE3a1d713d3E5578413002ff6F89744d"
abi: Instance
startBlock: 4285638
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ../src/mapping-instance.ts
entities:
- Deposit
- Withdrawal
abis:
- name: Instance
file: ../abis/Instance.json
eventHandlers:
- event: Deposit(indexed bytes32,uint32,uint256)
handler: handleDeposit
- event: Withdrawal(address,bytes32,indexed address,uint256)
handler: handleWithdrawal
- kind: ethereum/contract
name: Instance-10-avax
network: avalanche
source:
address: "0x44139ab9F929CC10cdCEBddca8008e07ac52954E"
abi: Instance
startBlock: 4285638
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ../src/mapping-instance.ts
entities:
- Deposit
- Withdrawal
abis:
- name: Instance
file: ../abis/Instance.json
eventHandlers:
- event: Deposit(indexed bytes32,uint32,uint256)
handler: handleDeposit
- event: Withdrawal(address,bytes32,indexed address,uint256)
handler: handleWithdrawal
- kind: ethereum/contract
name: Proxy
network: avalanche
source:
address: "0xa77350E1a72bE5bC7634d359C5011b4E359f4320"
abi: Proxy
startBlock: 4285638
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ../src/mapping-encrypted-note.ts
entities:
- EncryptedNote
abis:
- name: Proxy
file: ../abis/Proxy.json
eventHandlers:
- event: EncryptedNote(indexed address,bytes)
handler: handleEncryptedNote