Skip to content

Instantly share code, notes, and snippets.

@thexeromin
Created August 18, 2022 09:30
Show Gist options
  • Save thexeromin/b4274cb40b39118e454d68e8f1b58b92 to your computer and use it in GitHub Desktop.
Save thexeromin/b4274cb40b39118e454d68e8f1b58b92 to your computer and use it in GitHub Desktop.
specVersion: 0.0.2
description: Uniswap is a decentralized protocol for automated token exchange on Ethereum.
repository: https://github.com/Uniswap/uniswap-v2-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: mainnet
source:
address: '0x456405E3d355ad27010Fd87e3c7cC8a2DcA372fD'
abi: Factory
startBlock: 768455
mapping:
kind: ethereum/events
apiVersion: 0.0.3
language: wasm/assemblyscript
file: ./src/mappings/factory.ts
entities:
- Pair
- Token
abis:
- name: Factory
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
templates:
- kind: ethereum/contract
name: Pair
network: mainnet
source:
abi: Pair
mapping:
kind: ethereum/events
apiVersion: 0.0.3
language: wasm/assemblyscript
file: ./src/mappings/core.ts
entities:
- Pair
- Token
abis:
- name: Pair
file: ./abis/pair.json
- name: Factory
file: ./abis/factory.json
eventHandlers:
- event: Mint(indexed address,uint256,uint256)
handler: handleMint
- event: Burn(indexed address,uint256,uint256,indexed address)
handler: handleBurn
- event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
handler: handleSwap
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: Sync(uint112,uint112)
handler: handleSync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment