Skip to content

Commit

Permalink
chore: restrict send function for OP token from optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
canhtrinh committed Jan 14, 2024
1 parent 5a9e73c commit 8e218f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions apps/maestro/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,13 @@ export const NEXT_PUBLIC_DISABLED_WALLET_IDS = Maybe.of(
)
.map(split(","))
.mapOr([], map(trim));

export const shouldDisableSend = (
axelarChainId: string,
tokenAddress: `0x${string}`
) => {
const shouldDisable: Record<string, Record<`0x${string}`, boolean>> = {
optimism: { "0x4200000000000000000000000000000000000042": true },
};
return shouldDisable[axelarChainId]?.[tokenAddress];
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Link from "next/link";
import { TransactionExecutionError } from "viem";
import { useAccount, useChainId, useSwitchNetwork } from "wagmi";

import { shouldDisableSend } from "~/config/env";
import { useInterchainTokenBalanceForOwnerQuery } from "~/services/interchainToken/hooks";
import BigNumberText from "~/ui/components/BigNumberText";
import { ChainIcon } from "~/ui/components/EVMChainsDropdown";
Expand Down Expand Up @@ -233,7 +234,13 @@ export const RegisteredInterchainTokenCard: FC<Props> = (props) => {
size="xs"
variant="primary"
className="absolute right-6"
disabled={!props.hasRemoteTokens}
disabled={
!props.hasRemoteTokens ||
shouldDisableSend(
props.axelarChainId,
props.tokenAddress
)
}
>
Transfer
</Button>
Expand Down
1 change: 1 addition & 0 deletions apps/maestro/src/features/InterchainTokenList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { ExtendedWagmiChainConfig } from "~/config/wagmi";
type Kind = "canonical" | "interchain";

export type TokenInfo = {
axelarChainId: string;
chainId: number;
isRegistered: boolean;
isOriginToken: boolean;
Expand Down

0 comments on commit 8e218f5

Please sign in to comment.