diff --git a/AllInteractions/subgraph.yaml b/AllInteractions/subgraph.yaml index 26bde3d..a2a1097 100644 --- a/AllInteractions/subgraph.yaml +++ b/AllInteractions/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: PoolFactory network: chapel source: - address: "0xc5A750E8e3361D186236D7f708Cb1C92b944Ce48" + address: "0x16A393C8D0cdF0E3D4be1A68610E90268b367283" abi: PoolFactory - startBlock: 34202816 + startBlock: 34950529 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -27,9 +27,9 @@ dataSources: name: UserRegistry network: chapel source: - address: "0x7d090C1a5A5f8f1742F32C15BeB03980B3bfb1Dc" + address: "0xA3A20A05C3f69a77c0eca9c4f23840D3c3C8C917" abi: UserRegistry - startBlock: 34202816 + startBlock: 34950529 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/DaoPools/src/entities/global/globals.ts b/DaoPools/src/entities/global/globals.ts index 33df940..cacbed6 100644 --- a/DaoPools/src/entities/global/globals.ts +++ b/DaoPools/src/entities/global/globals.ts @@ -1,6 +1,6 @@ import { BigInt } from "@graphprotocol/graph-ts"; -export const PRICE_FEED_ADDRESS = "0x80852Edd95423C3BD37F94EF795e7Da8E1ED465e"; +export const PRICE_FEED_ADDRESS = "0xc2E2ad8Bbf700C054951DD869750803B15d27A9F"; export const BNB_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; export const WBNB_ADDRESS = "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd"; export const DAY = 86400; diff --git a/DaoPools/src/helpers/PriceFeedInteractions.ts b/DaoPools/src/helpers/PriceFeedInteractions.ts index f09c133..be094b5 100644 --- a/DaoPools/src/helpers/PriceFeedInteractions.ts +++ b/DaoPools/src/helpers/PriceFeedInteractions.ts @@ -3,9 +3,13 @@ import { PriceFeed } from "../../generated/templates/DaoPool/PriceFeed"; import { PRICE_FEED_ADDRESS } from "../entities/global/globals"; export function getUSDValue(token: Bytes, amount: BigInt): BigInt { + if (token.equals(Bytes.empty())) { + return BigInt.zero(); + } + let pfPrototype = PriceFeed.bind(Address.fromString(PRICE_FEED_ADDRESS)); - let resp = pfPrototype.try_getNormalizedPriceOutUSD(Address.fromString(token.toHexString()), amount); + let resp = pfPrototype.try_getNormalizedPriceOutUSD(Address.fromBytes(token), amount); if (resp.reverted) { log.warning("try_getNormalizedPriceOutUSD reverted. FromToken: {}, Amount:{}", [ token.toHexString(), diff --git a/DaoPools/subgraph.yaml b/DaoPools/subgraph.yaml index e1892e6..3512f9f 100644 --- a/DaoPools/subgraph.yaml +++ b/DaoPools/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: PoolFactory network: chapel source: - address: "0xc5A750E8e3361D186236D7f708Cb1C92b944Ce48" + address: "0x16A393C8D0cdF0E3D4be1A68610E90268b367283" abi: PoolFactory - startBlock: 34202816 + startBlock: 34950529 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -26,9 +26,9 @@ dataSources: name: ERC721Expert network: chapel source: - address: "0x36841F49C19B08795f4d3CDd9AB722Be8A8843C9" + address: "0xc85a5D41217C6bf7500d2d115dAbA3B98d17cbe7" abi: ERC721Expert - startBlock: 34202816 + startBlock: 34950529 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/DaoValidators/subgraph.yaml b/DaoValidators/subgraph.yaml index c3892eb..ce3f2eb 100644 --- a/DaoValidators/subgraph.yaml +++ b/DaoValidators/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: PoolFactory network: chapel source: - address: "0xc5A750E8e3361D186236D7f708Cb1C92b944Ce48" + address: "0x16A393C8D0cdF0E3D4be1A68610E90268b367283" abi: PoolFactory - startBlock: 34202816 + startBlock: 34950529 mapping: kind: ethereum/events apiVersion: 0.0.6