From 29e5178a4c15eb56568f5da0d0a30990a47bc76f Mon Sep 17 00:00:00 2001 From: Leandro Date: Thu, 12 Oct 2023 07:38:19 -0700 Subject: [PATCH] feat(permit): disable permit for SC wallets (#3213) --- .../src/common/hooks/featureFlags/useIsPermitEnabled.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/cowswap-frontend/src/common/hooks/featureFlags/useIsPermitEnabled.ts b/apps/cowswap-frontend/src/common/hooks/featureFlags/useIsPermitEnabled.ts index 56dff4497e..04e42129b7 100644 --- a/apps/cowswap-frontend/src/common/hooks/featureFlags/useIsPermitEnabled.ts +++ b/apps/cowswap-frontend/src/common/hooks/featureFlags/useIsPermitEnabled.ts @@ -1,10 +1,17 @@ import { SupportedChainId } from '@cowprotocol/cow-sdk' +import { useIsSmartContractWallet } from '@cowprotocol/wallet' import { useFeatureFlags } from './useFeatureFlags' export function useIsPermitEnabled(chainId: SupportedChainId | undefined): boolean { + const isSmartContractWallet = useIsSmartContractWallet() const { permitEnabledMainnet, permitEnabledGoerli, permitEnabledGnosis } = useFeatureFlags() + // Permit is only available for EOAs + if (isSmartContractWallet) { + return false + } + switch (chainId) { case SupportedChainId.MAINNET: return !!permitEnabledMainnet