Skip to content

Commit

Permalink
feat(permit): disable permit for SC wallets (#3213)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito authored Oct 12, 2023
1 parent 5de0df4 commit 29e5178
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 29e5178

Please sign in to comment.