CenturionDEX
Launch App

backfill.ts

Last modified:

Only in Optimism The file is present only for the optimism subgraph

path: /src/utils/backfill.ts

populateToken()

Params:
 - tokenAddress (String): 
 
ReturnType: void

Entities:

  1. Token - Read/Create & Write

Dependencies:

  1. fetchTokenSymbol()
  2. fetchTokenName()
  3. fetchTokenTotalSupply()
  4. fetchTokenDecimals()
  5. ZERO_BD
  6. ZERO_BI

Invoked at:

  1. populateEmptyPools()

populateEmptyPools()

Params:
 - event (ethereum.Event): 
 
ReturnType: void

Create entities for each pool and token before regenesis of optimism chain.

Overwrites Token TVL token.tokenValueLocked is set everytime instead of adding it to the existing balance. Thus if a token is present in multiple pools, the TVL in the from the last pool will be shown.

Entities:

  1. Pool - Create & Write
  2. Token - Read/Create & Write

Contracts

  1. Pool (Template) - Create

ABI Dependencies:

  1. pool.json
  2. ERC20.json

Dependencies:

  1. POOL_MAPPINGS
  2. ZERO_BD
  3. ZERO_BI
  4. populateToken()
  5. WHITELIST_TOKENS
  6. convertTokenToDecimal()

Invoked at:

  1. handlePoolCreated()