Skip to content

update cUSD #3609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/grant-explorer/src/checkoutStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const useCheckoutStore = create<CheckoutState>()(
client: walletClient,
});
nonce = await erc20Contract.read.nonces([owner]);
const tokenName = await erc20Contract.read.name();
let tokenName = await erc20Contract.read.name();
if (getPermitType(token, chainId) === "dai") {
sig = await signPermitDai({
walletClient: walletClient,
Expand All @@ -194,6 +194,13 @@ export const useCheckoutStore = create<CheckoutState>()(
permitVersion: token.permitVersion ?? "1",
});
} else {
// cUSD is a special case where the token symbol is used for permit instead of the name
if (
chainId === 42220 &&
token.address.toLowerCase() ===
"0x765de816845861e75a25fca122bb6898b8b1282a".toLowerCase()
)
tokenName = "cUSD";
sig = await signPermit2612({
walletClient: walletClient,
value: totalDonationPerChain[chainId],
Expand Down
Loading