Skip to content

Commit fc40661

Browse files
authored
fix(partner-fee): update fee address (#5896)
* fix: update partner fee recipient in all chains * refactor: move partner fee const to common-const lib * refactor: replace manual list with helper fn
1 parent 9984d91 commit fc40661

File tree

4 files changed

+19
-27
lines changed

4 files changed

+19
-27
lines changed

apps/cowswap-frontend/src/modules/volumeFee/state/cowswapFeeAtom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { atom } from 'jotai'
22

3-
import { LpToken, STABLECOINS } from '@cowprotocol/common-const'
3+
import { DEFAULT_PARTNER_FEE_RECIPIENT, LpToken, STABLECOINS } from '@cowprotocol/common-const'
44
import { getCurrencyAddress, isInjectedWidget } from '@cowprotocol/common-utils'
55
import { SupportedChainId } from '@cowprotocol/cow-sdk'
66
import { walletInfoAtom } from '@cowprotocol/wallet'
@@ -16,12 +16,12 @@ const COWSWAP_VOLUME_FEES: Record<SupportedChainId, VolumeFee | null> = {
1616
[SupportedChainId.SEPOLIA]: null,
1717
[SupportedChainId.ARBITRUM_ONE]: {
1818
volumeBps: 10, // 0.1%
19-
recipient: '0x451100Ffc88884bde4ce87adC8bB6c7Df7fACccd', // Arb1 Protocol fee safe
19+
recipient: DEFAULT_PARTNER_FEE_RECIPIENT,
2020
},
2121
[SupportedChainId.BASE]: null,
2222
[SupportedChainId.GNOSIS_CHAIN]: {
2323
volumeBps: 10, // 0.1%
24-
recipient: '0x6b3214fD11dc91De14718DeE98Ef59bCbFcfB432', // Gnosis Chain Protocol fee safe
24+
recipient: DEFAULT_PARTNER_FEE_RECIPIENT,
2525
},
2626
[SupportedChainId.POLYGON]: null, // TODO: check if we should apply fee on Polygon
2727
[SupportedChainId.AVALANCHE]: null, // TODO: check if we should apply fee on Avalanche

apps/widget-configurator/src/app/configurator/consts.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
1-
import { SupportedChainId } from '@cowprotocol/cow-sdk'
1+
import { DEFAULT_PARTNER_FEE_RECIPIENT } from '@cowprotocol/common-const'
2+
import { mapAddressToSupportedNetworks } from '@cowprotocol/cow-sdk'
23
import { CowWidgetEventListeners, CowWidgetEvents, ToastMessageType } from '@cowprotocol/events'
34
import { CowSwapWidgetPaletteParams, TokenInfo, TradeType } from '@cowprotocol/widget-lib'
45

56
import { TokenListItem } from './types'
67

78
// CoW DAO addresses
8-
const GNOSIS_DEFAULT_PARTNER_FEE_RECIPIENT = '0x6b3214fd11dc91de14718dee98ef59bcbfcfb432'
9-
const MAINNET_DEFAULT_PARTNER_FEE_RECIPIENT = '0xB64963f95215FDe6510657e719bd832BB8bb941B'
10-
const ARB1_DEFAULT_PARTNER_FEE_RECIPIENT = '0x451100Ffc88884bde4ce87adC8bB6c7Df7fACccd'
11-
const BASE_DEFAULT_PARTNER_FEE_RECIPIENT = '0x3c4DBcCf8d80D3d92B0d82197aebf52574ED1F3B'
12-
export const DEFAULT_PARTNER_FEE_RECIPIENT_PER_NETWORK: Record<SupportedChainId, string> = {
13-
[SupportedChainId.MAINNET]: MAINNET_DEFAULT_PARTNER_FEE_RECIPIENT,
14-
[SupportedChainId.GNOSIS_CHAIN]: GNOSIS_DEFAULT_PARTNER_FEE_RECIPIENT,
15-
[SupportedChainId.ARBITRUM_ONE]: ARB1_DEFAULT_PARTNER_FEE_RECIPIENT,
16-
[SupportedChainId.BASE]: BASE_DEFAULT_PARTNER_FEE_RECIPIENT,
17-
[SupportedChainId.SEPOLIA]: MAINNET_DEFAULT_PARTNER_FEE_RECIPIENT,
18-
[SupportedChainId.POLYGON]: MAINNET_DEFAULT_PARTNER_FEE_RECIPIENT,
19-
[SupportedChainId.AVALANCHE]: MAINNET_DEFAULT_PARTNER_FEE_RECIPIENT,
20-
}
9+
10+
export const DEFAULT_PARTNER_FEE_RECIPIENT_PER_NETWORK = mapAddressToSupportedNetworks(DEFAULT_PARTNER_FEE_RECIPIENT)
2111

2212
export const TRADE_MODES = [TradeType.SWAP, TradeType.LIMIT, TradeType.ADVANCED, TradeType.YIELD]
2313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const DEFAULT_PARTNER_FEE_RECIPIENT = '0x22af3D38E50ddedeb7C47f36faB321eC3Bb72A76'

libs/common-const/src/index.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
export * from './types'
1+
export * from './bff'
2+
export * from './chainInfo'
23
export * from './common'
3-
export * from './locales'
4-
export * from './tokens'
4+
export * from './cowprotocolTokenLogoUrl'
5+
export * from './feeRecipient'
6+
export * from './gnosis_chain/hack'
57
export * from './intl'
6-
export * from './misc'
7-
export * from './chainInfo'
8-
export * from './networks'
98
export * from './ipfs'
10-
export * from './gnosis_chain/hack'
11-
export * from './cowprotocolTokenLogoUrl'
9+
export * from './launchDarkly'
10+
export * from './locales'
11+
export * from './misc'
1212
export * from './nativeAndWrappedTokens'
13+
export * from './networks'
1314
export * from './theme'
14-
export * from './launchDarkly'
15-
export * from './bff'
15+
export * from './tokens'
16+
export * from './types'

0 commit comments

Comments
 (0)