From e608c4606901c5fbe941331acd661b41192ce686 Mon Sep 17 00:00:00 2001 From: Kris Bitney Date: Mon, 29 Jan 2024 20:01:53 +0500 Subject: [PATCH 1/2] fixed graphql query so ensure social links are obtained; made sure social links open in new tab (#121) --- .../app/src/components/ViewCollective.tsx | 20 +++---- .../app/src/subgraph/useSubgraphCollective.ts | 60 +------------------ 2 files changed, 13 insertions(+), 67 deletions(-) diff --git a/packages/app/src/components/ViewCollective.tsx b/packages/app/src/components/ViewCollective.tsx index 43d752a..09c1ac7 100644 --- a/packages/app/src/components/ViewCollective.tsx +++ b/packages/app/src/components/ViewCollective.tsx @@ -94,26 +94,26 @@ function ViewCollective({ collective }: ViewCollectiveProps) { {ipfs.description} {collective.ipfs.website && ( - + )} {collective.ipfs.twitter && ( - + )} {collective.ipfs.instagram && ( - + )} {collective.ipfs.threads && ( - + )} - + @@ -249,26 +249,26 @@ function ViewCollective({ collective }: ViewCollectiveProps) { {ipfs.description} {collective.ipfs.website && ( - + )} {collective.ipfs.twitter && ( - + )} {collective.ipfs.instagram && ( - + )} {collective.ipfs.threads && ( - + )} - + diff --git a/packages/app/src/subgraph/useSubgraphCollective.ts b/packages/app/src/subgraph/useSubgraphCollective.ts index 987bbc4..37e0515 100644 --- a/packages/app/src/subgraph/useSubgraphCollective.ts +++ b/packages/app/src/subgraph/useSubgraphCollective.ts @@ -2,9 +2,9 @@ import { gql } from '@apollo/client'; import { CollectivesSubgraphResponse, useSubgraphData } from './useSubgraphData'; import { SubgraphCollective } from './subgraphModels'; -export const collective = gql` - query COLLECTIVE($id: String) { - collectives(where: { id: $id }) { +export const collectivesById = gql` + query COLLECTIVES_BY_ID($ids: [String!]) { + collectives(where: { id_in: $ids }) { id ipfs { id @@ -49,60 +49,6 @@ export const collective = gql` } `; -export const collectivesById = gql` - query COLLECTIVES_BY_ID($ids: [String!]) { - collectives(where: { id_in: $ids }) { - id - ipfs { - id - name - description - headerImage - } - stewards { - id - steward { - id - } - collective { - id - } - actions - totalEarned - } - donors { - id - donor { - id - } - collective { - id - } - contribution - timestamp - flowRate - } - timestamp - paymentsMade - totalDonations - totalRewards - } - } -`; - -export function useSubgraphCollective(id: string): SubgraphCollective | undefined { - const response = useSubgraphData(collective, { - variables: { - id: id, - }, - }); - const data = (response as CollectivesSubgraphResponse).collectives; - if (!data || data.length === 0) { - return undefined; - } - return data[0]; -} - export function useSubgraphCollectivesById(ids: string[]): SubgraphCollective[] | undefined { const response = useSubgraphData(collectivesById, { variables: { From a86c664da865eab3f06e92ce91c3285f9db15b13 Mon Sep 17 00:00:00 2001 From: Lewis B Date: Tue, 30 Jan 2024 13:05:26 +0800 Subject: [PATCH 2/2] fix: use gd token address from deployment.json (#120) --- packages/app/src/models/constants.ts | 3 ++- packages/common/src/constants/addresses.ts | 3 +-- packages/sdk-js/scripts/createPool.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app/src/models/constants.ts b/packages/app/src/models/constants.ts index 0235bc1..0a803fa 100644 --- a/packages/app/src/models/constants.ts +++ b/packages/app/src/models/constants.ts @@ -1,4 +1,5 @@ import { Token } from '@uniswap/sdk-core'; +import GdContracts from '@gooddollar/goodprotocol/releases/deployment.json'; // 5% export const acceptablePriceImpact = 5; @@ -14,7 +15,7 @@ export const SupportedNetworkNames: Record = { // Uniswap V3 Router on Celo export const UNISWAP_V3_ROUTER_ADDRESS = '0x5615CDAb10dc425a742d643d949a7F474C01abc4'; -export const GDToken: Token = new Token(SupportedNetwork.CELO, '0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A', 18, 'G$'); +export const GDToken: Token = new Token(SupportedNetwork.CELO, GdContracts['production-celo'].GoodDollar, 18, 'G$'); // if a token is not in this list, the address from the Celo Token List is used export const coingeckoTokenMapping: Record = { diff --git a/packages/common/src/constants/addresses.ts b/packages/common/src/constants/addresses.ts index 4df8600..d683503 100644 --- a/packages/common/src/constants/addresses.ts +++ b/packages/common/src/constants/addresses.ts @@ -1,3 +1,2 @@ // EXTERNAL CONTRACTS - -export const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; +export const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; // dai-mainnet diff --git a/packages/sdk-js/scripts/createPool.ts b/packages/sdk-js/scripts/createPool.ts index 0790e0e..1bf33ad 100644 --- a/packages/sdk-js/scripts/createPool.ts +++ b/packages/sdk-js/scripts/createPool.ts @@ -35,7 +35,7 @@ const main = async () => { manager: '0xEbB3341cD1511035845f1b37e6A2BFCDcf433Ad7', membersValidator: ethers.constants.AddressZero, uniquenessValidator: ethers.constants.AddressZero, - rewardToken: '0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A', //celo dev token + rewardToken: '0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A', //celo production token allowRewardOverride: false, };