feat: add polygon

This commit is contained in:
Danil Kovtonyuk 2021-06-14 15:33:59 +03:00 committed by 0xZick 地方分権化
parent b1c053df36
commit fe4f037db7
8 changed files with 44 additions and 157 deletions

1
.gitignore vendored
View File

@ -67,3 +67,4 @@ build
generated generated
.DS_Store .DS_Store
subgraphs

View File

@ -5,6 +5,12 @@ const contracts = [
name: 'Echoer', name: 'Echoer',
address: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4', address: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4',
}, },
{
prod: 15586935,
network: 'matic',
name: 'Echoer',
address: '0x88Fb545DC03438b9FFb958361b7F3CfA6ce1B9c5',
},
]; ];
module.exports = contracts; module.exports = contracts;

View File

@ -31,6 +31,14 @@ const contracts = [
name: 'Instance', name: 'Instance',
address: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD', address: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
}, },
{
prod: 15586940,
amount: '0.1',
network: 'matic',
currency: 'matic',
name: 'Instance',
address: '0x992A81FA34aa6ecD9520F39f858abc51fee6994a',
},
]; ];
module.exports = contracts; module.exports = contracts;

View File

@ -5,6 +5,12 @@ const contracts = [
network: 'bsc', network: 'bsc',
address: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17', address: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
}, },
{
prod: 15586930,
name: 'Proxy',
network: 'matic',
address: '0xDC16d16341A62c60E7C9889F9d1FcE4cde57a90F',
},
]; ];
module.exports = contracts; module.exports = contracts;

View File

@ -2,12 +2,12 @@ const Contracts = require('./contracts');
module.exports = { module.exports = {
createYaml: (env) => { createYaml: (env) => {
const createProxyBlock = ({ name, network, address }) => ({ const createProxyBlock = ({ name, network, startBlocks, address }) => ({
name, name,
network, network,
mappingFile: '../src/mapping-encrypted-note.ts', mappingFile: '../src/mapping-encrypted-note.ts',
abi: 'Proxy', abi: 'Proxy',
startBlock: 7941563, startBlock: startBlocks.prod,
address: `"${address}"`, address: `"${address}"`,
entities: ['EncryptedNote'], entities: ['EncryptedNote'],
abis: [ abis: [

View File

@ -3,14 +3,19 @@
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
"generate": "yarn codegen:tornado && yarn build:tornado", "generate-bsc": "yarn codegen:tornado-bsc && yarn build:tornado-bsc",
"yaml:tornado": "node ./create-yaml-file create-yaml -e bsc | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph.yaml", "generate-matic": "yarn codegen:tornado-matic && yarn build:tornado-matic",
"yaml:tornado-bsc": "node ./create-yaml-file create-yaml -e bsc | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-bsc.yaml",
"yaml:tornado-matic": "node ./create-yaml-file create-yaml -e matic | mustache - mustache/yaml.mustache > subgraphs/tornado-subgraph-matic.yaml",
"codegen": "graph codegen", "codegen": "graph codegen",
"codegen:tornado": "yarn yaml:tornado && yarn codegen -- subgraphs/tornado-subgraph.yaml", "codegen:tornado-bsc": "yarn yaml:tornado-bsc && yarn codegen -- subgraphs/tornado-subgraph-bsc.yaml",
"codegen:tornado-matic": "yarn yaml:tornado-matic && yarn codegen -- subgraphs/tornado-subgraph-matic.yaml",
"build": "graph build", "build": "graph build",
"build:tornado": "graph build subgraphs/tornado-subgraph.yaml", "build:tornado-bsc": "graph build subgraphs/tornado-subgraph-bsc.yaml",
"build:tornado-matic": "graph build subgraphs/tornado-subgraph-matic.yaml",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token TOKEN", "deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token TOKEN",
"deploy:tornado": "yarn deploy -- tornadocash/bsc-tornado-subgraph subgraphs/tornado-subgraph.yaml" "deploy:tornado-bsc": "yarn deploy -- tornadocash/bsc-tornado-subgraph subgraphs/tornado-subgraph-bsc.yaml",
"deploy:tornado-matic": "yarn deploy -- tornadocash/matic-tornado-subgraph subgraphs/tornado-subgraph-matic.yaml"
}, },
"dependencies": { "dependencies": {
"@graphprotocol/graph-cli": "0.20.0", "@graphprotocol/graph-cli": "0.20.0",

View File

@ -1,19 +1,18 @@
// this is a read only file generated by manual inputs to file mustache/templates/rates/contracts.js. // this is a read only file generated by manual inputs to file mustache/templates/rates/contracts.js.
export let contractsToInstances = new Map<string, string>(); export let contractsToInstances = new Map<string, string>();
contractsToInstances.set( contractsToInstances.set("0x84443cfd09a48af6ef360c6976c5392ac5023a1f", // Instance-bnb-0.1
'0x84443cfd09a48af6ef360c6976c5392ac5023a1f', // Instance-bnb-0.1   "bnb-0.1"
'bnb-0.1',
); );
contractsToInstances.set( contractsToInstances.set("0xd47438c816c9e7f2e2888e060936a499af9582b3", // Instance-bnb-1
'0xd47438c816c9e7f2e2888e060936a499af9582b3', // Instance-bnb-1   "bnb-1"
'bnb-1',
); );
contractsToInstances.set( contractsToInstances.set("0x330bdfade01ee9bf63c209ee33102dd334618e0a", // Instance-bnb-10
'0x330bdfade01ee9bf63c209ee33102dd334618e0a', // Instance-bnb-10   "bnb-10"
'bnb-10',
); );
contractsToInstances.set( contractsToInstances.set("0x1e34a77868e19a6647b1f2f47b51ed72dede95dd", // Instance-bnb-100
'0x1e34a77868e19a6647b1f2f47b51ed72dede95dd', // Instance-bnb-100   "bnb-100"
'bnb-100', );
contractsToInstances.set("0x992a81fa34aa6ecd9520f39f858abc51fee6994a", // Instance-matic-0.1
  "matic-0.1"
); );
// this is a read only file generated by manual inputs to file mustache/templates/rates/contracts.js. // this is a read only file generated by manual inputs to file mustache/templates/rates/contracts.js.

View File

@ -1,138 +0,0 @@
specVersion: 0.0.2
description: Proxy
repository: https://github.com/tornadocash/tornado-subgraph
schema:
file: ../schema.graphql
dataSources:
- kind: ethereum/contract
name: Echoer
network: bsc
source:
address: "0xa75BF2815618872f155b7C4B0C81bF990f5245E4"
abi: Echoer
startBlock: 8159269
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-bnb
network: bsc
source:
address: "0x84443CFd09A48AF6eF360C6976C5392aC5023a1F"
abi: Instance
startBlock: 8159279
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-1-bnb
network: bsc
source:
address: "0xd47438C816c9E7f2E2888E060936a499Af9582b3"
abi: Instance
startBlock: 8159286
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-bnb
network: bsc
source:
address: "0x330bdFADE01eE9bF63C209Ee33102DD334618e0a"
abi: Instance
startBlock: 8159290
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-100-bnb
network: bsc
source:
address: "0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"
abi: Instance
startBlock: 8159296
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: bsc
source:
address: "0x0D5550d52428E7e3175bfc9550207e4ad3859b17"
abi: Proxy
startBlock: 7941563
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