specVersion: 0.0.2
description: Pancake Trading Competition V1
repository: https://github.com/pancakeswap
schema:
  file: ./trading.graphql
dataSources:
  - kind: ethereum/contract
    name: TradingCompetitionV1
    network: bsc
    source:
      address: '0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA'
      abi: TradingCompetitionV1
      startBlock: 6214239
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.4
      language: wasm/assemblyscript
      file: ../src/trading/competition.ts
      entities:
        - Bundle
        - Competition
        - Team
        - User
      abis:
        - name: TradingCompetitionV1
          file: ../abis/TradingCompetitionV1.json
        - name: Factory
          file: ../abis/Factory.json
        - name: Pair
          file: ../abis/Pair.json
      blockHandlers:
        - handler: handleBlock
      eventHandlers:
        - event: UserRegister(address,uint256)
          handler: handleUserRegister
        - event: NewCompetitionStatus(uint8)
          handler: handleNewCompetitionStatus
templates:
  - kind: ethereum/contract
    name: Pair
    network: bsc
    source:
      abi: Pair
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.4
      language: wasm/assemblyscript
      file: ../src/trading/pair.ts
      entities:
        - Bundle
        - Competition
        - Team
        - User
      abis:
        - name: Factory
          file: ../abis/Factory.json
        - name: Pair
          file: ../abis/Pair.json
      eventHandlers:
        - event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
          handler: handleSwap
