diff --git a/abis/ERC20NameBytes.json b/abis/ERC20NameBytes.json deleted file mode 100644 index 2d3c877a..00000000 --- a/abis/ERC20NameBytes.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } -] diff --git a/abis/ERC20SymbolBytes.json b/abis/ERC20SymbolBytes.json deleted file mode 100644 index a76d6163..00000000 --- a/abis/ERC20SymbolBytes.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/mappings/factory.ts b/src/mappings/factory.ts index ed4f177c..483783cb 100644 --- a/src/mappings/factory.ts +++ b/src/mappings/factory.ts @@ -3,6 +3,7 @@ import { log } from '@graphprotocol/graph-ts' import { PairCreated } from '../types/Factory/Factory' import { Pair, Token, UniswapFactory } from '../types/schema' +import { Pair as PairTemplate } from '../types/templates' import { FACTORY_ADDRESS, fetchTokenDecimals, ZERO_BI } from './helpers' export function handleNewPair(event: PairCreated): void { @@ -58,4 +59,6 @@ export function handleNewPair(event: PairCreated): void { pair.createdAtBlockNumber = event.block.number pair.txCount = ZERO_BI pair.save() + + PairTemplate.create(event.params.pair) } diff --git a/src/mappings/core.ts b/src/mappings/pair.ts similarity index 100% rename from src/mappings/core.ts rename to src/mappings/pair.ts diff --git a/subgraph.yaml b/subgraph.yaml index cc1d645d..63a76f20 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -17,6 +17,7 @@ dataSources: language: wasm/assemblyscript file: ./src/mappings/factory.ts entities: + - UniswapFactory - Pair - Token abis: @@ -24,10 +25,6 @@ dataSources: file: ./abis/factory.json - name: ERC20 file: ./abis/ERC20.json - - name: ERC20SymbolBytes - file: ./abis/ERC20SymbolBytes.json - - name: ERC20NameBytes - file: ./abis/ERC20NameBytes.json eventHandlers: - event: PairCreated(indexed address,indexed address,address,uint256) handler: handleNewPair @@ -41,15 +38,14 @@ templates: kind: ethereum/events apiVersion: 0.0.9 language: wasm/assemblyscript - file: ./src/mappings/core.ts + file: ./src/mappings/pair.ts entities: - Pair - Token + - Mint abis: - name: Pair file: ./abis/pair.json - - name: Factory - file: ./abis/factory.json eventHandlers: - event: Mint(indexed address,uint256,uint256) handler: handleMint