Skip to content

Commit c8a5cfe

Browse files
authored
feat: remove DAI, add native USDC to Arbitrum One (gitcoinco#2329)
1 parent 623d759 commit c8a5cfe

6 files changed

Lines changed: 39 additions & 32 deletions

File tree

packages/grant-explorer/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
.eslintcache
2525

2626
npm-debug.log*
27-
.vercel
2827
.env*.local
28+
.vercel

packages/grant-explorer/src/features/api/__tests__/utils.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe("fetchFromIPFS", () => {
107107
const res = await fetchFromIPFS(cid);
108108

109109
expect(fetchMock).toHaveBeenCalledWith(
110-
`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
110+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
111111
);
112112
expect(res).toEqual({ name: "My First Metadata" });
113113
});
@@ -122,7 +122,7 @@ describe("fetchFromIPFS", () => {
122122
await expect(fetchFromIPFS(cid)).rejects.toHaveProperty("status", 404);
123123

124124
expect(fetchMock).toHaveBeenCalledWith(
125-
`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
125+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
126126
);
127127
});
128128
});

packages/grant-explorer/src/features/api/utils.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,15 @@ const ARBITRUM_TOKENS: PayoutToken[] = [
273273
canVote: true,
274274
},
275275
{
276-
name: "DAI",
276+
name: "USDC",
277277
chainId: ChainId.ARBITRUM,
278-
address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
279-
decimal: 18,
280-
logo: TokenNamesAndLogos["DAI"],
281-
redstoneTokenId: RedstoneTokenIds["DAI"],
278+
address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
279+
decimal: 6,
280+
logo: TokenNamesAndLogos["USDC"],
281+
redstoneTokenId: RedstoneTokenIds["USDC"],
282282
defaultForVoting: false,
283283
canVote: true,
284+
permitVersion: "2",
284285
},
285286
{
286287
name: "ARB",
@@ -427,15 +428,15 @@ export const graphql_fetch = async (
427428
* @param cid - the unique content identifier that points to the data
428429
*/
429430
export const fetchFromIPFS = (cid: string) => {
430-
return fetch(`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`).then(
431-
(resp) => {
432-
if (resp.ok) {
433-
return resp.json();
434-
}
435-
436-
return Promise.reject(resp);
431+
return fetch(
432+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
433+
).then((resp) => {
434+
if (resp.ok) {
435+
return resp.json();
437436
}
438-
);
437+
438+
return Promise.reject(resp);
439+
});
439440
};
440441

441442
/**
Lines changed: 5 additions & 0 deletions
Loading

packages/round-manager/src/features/api/__tests__/utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("fetchFromIPFS", () => {
2828
const res = await fetchFromIPFS(cid);
2929

3030
expect(fetchMock).toHaveBeenCalledWith(
31-
`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
31+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
3232
);
3333
expect(res).toEqual({ name: "My First Metadata" });
3434
});
@@ -43,7 +43,7 @@ describe("fetchFromIPFS", () => {
4343
await expect(fetchFromIPFS(cid)).rejects.toHaveProperty("status", 404);
4444

4545
expect(fetchMock).toHaveBeenCalledWith(
46-
`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
46+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
4747
);
4848
});
4949
});
@@ -251,7 +251,7 @@ describe("checkGrantApplicationStatus", () => {
251251
const res = await checkGrantApplicationStatus("1", metadataPointer);
252252

253253
expect(fetchMock).toHaveBeenCalledWith(
254-
`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${metadataPointer.pointer}`
254+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${metadataPointer.pointer}`
255255
);
256256
expect(res).toEqual("FRAUD");
257257
});

packages/round-manager/src/features/api/utils.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const TokenNamesAndLogos = {
7878
FTM: "/logos/fantom-logo.svg",
7979
BUSD: "/logos/busd-logo.svg",
8080
DAI: "/logos/dai-logo.svg",
81+
USDC: "./logos/usdc-logo.svg",
8182
ETH: "/logos/ethereum-eth-logo.svg",
8283
OP: "/logos/optimism-logo.svg",
8384
ARB: "/logos/arb-logo.svg",
@@ -269,12 +270,12 @@ const ARBITRUM_TOKENS: PayoutToken[] = [
269270
redstoneTokenId: RedstoneTokenIds["ETH"],
270271
},
271272
{
272-
name: "DAI",
273+
name: "USDC",
273274
chainId: ChainId.ARBITRUM,
274-
address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
275-
decimal: 18,
276-
logo: TokenNamesAndLogos["DAI"],
277-
redstoneTokenId: RedstoneTokenIds["DAI"],
275+
address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
276+
decimal: 6,
277+
logo: TokenNamesAndLogos["USDC"],
278+
redstoneTokenId: RedstoneTokenIds["USDC"],
278279
},
279280
{
280281
name: "ARB",
@@ -443,15 +444,15 @@ export const getPayoutTokenOptions = (chainId: ChainId): PayoutToken[] => {
443444
* @param cid - the unique content identifier that points to the data
444445
*/
445446
export const fetchFromIPFS = (cid: string) => {
446-
return fetch(`${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`).then(
447-
(resp) => {
448-
if (resp.ok) {
449-
return resp.json();
450-
}
451-
452-
return Promise.reject(resp);
447+
return fetch(
448+
`https://${process.env.REACT_APP_PINATA_GATEWAY}/ipfs/${cid}`
449+
).then((resp) => {
450+
if (resp.ok) {
451+
return resp.json();
453452
}
454-
);
453+
454+
return Promise.reject(resp);
455+
});
455456
};
456457

457458
/**

0 commit comments

Comments
 (0)