Skip to content

Commit

Permalink
fix: add safe apps fee in Base network (#5161)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoom3301 authored Dec 5, 2024
1 parent fa7a5f5 commit cefdb55
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { atom } from 'jotai'

import { STABLECOINS } from '@cowprotocol/common-const'
import { getCurrencyAddress } from '@cowprotocol/common-utils'
import { OrderKind, SupportedChainId } from '@cowprotocol/cow-sdk'
import { getCurrencyAddress, isInjectedWidget } from '@cowprotocol/common-utils'
import { OrderKind } from '@cowprotocol/cow-sdk'
import { walletDetailsAtom, walletInfoAtom } from '@cowprotocol/wallet'

import { featureFlagsAtom } from '../../../common/state/featureFlagsState'
import { derivedTradeStateAtom } from '../../trade'
import { derivedTradeStateAtom } from 'modules/trade'

import { featureFlagsAtom } from 'common/state/featureFlagsState'

import { VolumeFee } from '../types'

const SAFE_FEE_RECIPIENT = '0x63695Eee2c3141BDE314C5a6f89B98E62808d716'
Expand Down Expand Up @@ -39,9 +41,8 @@ export const safeAppFeeAtom = atom<VolumeFee | null>((get) => {
const { isSafeAppFeeEnabled } = get(featureFlagsAtom)
const { inputCurrency, outputCurrency, inputCurrencyFiatAmount, outputCurrencyFiatAmount, orderKind } =
get(derivedTradeStateAtom) || {}
const isBaseNetwork = chainId === SupportedChainId.BASE

if (!isSafeApp || !isSafeAppFeeEnabled || isBaseNetwork) return null
if (!isSafeApp || !isSafeAppFeeEnabled || isInjectedWidget()) return null

const fiatCurrencyValue = orderKind === OrderKind.SELL ? inputCurrencyFiatAmount : outputCurrencyFiatAmount
const fiatAmount = fiatCurrencyValue ? +fiatCurrencyValue.toExact() : null
Expand Down

0 comments on commit cefdb55

Please sign in to comment.