Skip to content

Commit

Permalink
Merge branch 'master' of github.com:GoodDollar/GoodCollective into kr…
Browse files Browse the repository at this point in the history
…is/decimals-two-places
  • Loading branch information
L03TJ3 committed Jan 30, 2024
2 parents 68e723c + a86c664 commit d4dacfd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 71 deletions.
20 changes: 10 additions & 10 deletions packages/app/src/components/ViewCollective.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,26 @@ function ViewCollective({ collective }: ViewCollectiveProps) {
<Text style={styles.description}>{ipfs.description}</Text>
<View style={[styles.icons, { position: 'absolute', bottom: 0, left: 25 }]}>
{collective.ipfs.website && (
<Link href={collective.ipfs.website}>
<Link href={collective.ipfs.website} isExternal>
<Image source={WebIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.twitter && (
<Link href={collective.ipfs.twitter}>
<Link href={collective.ipfs.twitter} isExternal>
<Image source={TwitterIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.instagram && (
<Link href={collective.ipfs.instagram}>
<Link href={collective.ipfs.instagram} isExternal>
<Image source={InstagramIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.threads && (
<Link href={collective.ipfs.threads}>
<Link href={collective.ipfs.threads} isExternal>
<Image source={AtIcon} style={styles.rowIcon} />
</Link>
)}
<Link href={`https://explorer.celo.org/mainnet/address/${poolAddress}`}>
<Link href={`https://explorer.celo.org/mainnet/address/${poolAddress}`} isExternal>
<Image source={LastRowIcon} style={styles.rowIcon} />
</Link>
</View>
Expand Down Expand Up @@ -249,26 +249,26 @@ function ViewCollective({ collective }: ViewCollectiveProps) {
<Text style={styles.description}>{ipfs.description}</Text>
<View style={styles.icons}>
{collective.ipfs.website && (
<Link href={collective.ipfs.website}>
<Link href={collective.ipfs.website} isExternal>
<Image source={WebIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.twitter && (
<Link href={collective.ipfs.twitter}>
<Link href={collective.ipfs.twitter} isExternal>
<Image source={TwitterIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.instagram && (
<Link href={collective.ipfs.instagram}>
<Link href={collective.ipfs.instagram} isExternal>
<Image source={InstagramIcon} style={styles.rowIcon} />
</Link>
)}
{collective.ipfs.threads && (
<Link href={collective.ipfs.threads}>
<Link href={collective.ipfs.threads} isExternal>
<Image source={AtIcon} style={styles.rowIcon} />
</Link>
)}
<Link href={`https://explorer.celo.org/mainnet/address/${poolAddress}`}>
<Link href={`https://explorer.celo.org/mainnet/address/${poolAddress}`} isExternal>
<Image source={LastRowIcon} style={styles.rowIcon} />
</Link>
</View>
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/models/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Token } from '@uniswap/sdk-core';
import GdContracts from '@gooddollar/goodprotocol/releases/deployment.json';

// 5%
export const acceptablePriceImpact = 5;
Expand All @@ -14,7 +15,7 @@ export const SupportedNetworkNames: Record<SupportedNetwork, string> = {
// 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<string, `0x${string}`> = {
Expand Down
60 changes: 3 additions & 57 deletions packages/app/src/subgraph/useSubgraphCollective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {
Expand Down
3 changes: 1 addition & 2 deletions packages/common/src/constants/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// EXTERNAL CONTRACTS

export const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F';
export const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; // dai-mainnet
2 changes: 1 addition & 1 deletion packages/sdk-js/scripts/createPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit d4dacfd

Please sign in to comment.