Skip to content

Commit

Permalink
hotfix: chain id
Browse files Browse the repository at this point in the history
  • Loading branch information
luistorres committed May 22, 2024
1 parent 296cce6 commit 540b732
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/web-app/app/_lib/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
useWriteCtzndSaleBuy,
useWriteCtzndErc20Approve,
} from '@/wagmi.generated';
import { sepolia } from 'viem/chains';
import { mainnet, sepolia } from 'viem/chains';
import { appSignal } from '../app-signal';

export const useAcquireAccessGrantMutation = () => {
Expand Down Expand Up @@ -246,7 +246,11 @@ export const useBuyCtzndTokens = () => {
};

export const useSetPaymentTokenAllowance = () => {
const saleAddress = ctzndSaleAddress[sepolia.id];
const chainId =
process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true'
? sepolia.id
: mainnet.id;
const saleAddress = ctzndSaleAddress[chainId];
const { data: paymentToken } = useReadCtzndSalePaymentToken();
const {
writeContract,
Expand Down

0 comments on commit 540b732

Please sign in to comment.