Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Oct 18, 2024
2 parents 99c4c42 + cb589b6 commit 39f451e
Show file tree
Hide file tree
Showing 31 changed files with 168 additions and 42 deletions.
16 changes: 8 additions & 8 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"apps/cowswap-frontend": "1.85.0",
"apps/explorer": "2.35.1",
"apps/cowswap-frontend": "1.86.1",
"apps/explorer": "2.36.0",
"libs/permit-utils": "0.4.0",
"libs/widget-lib": "0.15.0",
"libs/widget-lib": "0.16.0",
"libs/widget-react": "0.11.0",
"apps/widget-configurator": "1.7.2",
"apps/widget-configurator": "1.8.0",
"libs/analytics": "1.8.0",
"libs/assets": "1.8.0",
"libs/common-const": "1.7.0",
"libs/common-const": "1.8.0",
"libs/common-hooks": "1.4.0",
"libs/common-utils": "1.7.2",
"libs/core": "1.3.0",
Expand All @@ -16,13 +16,13 @@
"libs/snackbars": "1.1.0",
"libs/tokens": "1.10.0",
"libs/types": "1.2.0",
"libs/ui": "1.10.1",
"libs/wallet": "1.6.0",
"libs/ui": "1.11.0",
"libs/wallet": "1.6.1",
"apps/cow-fi": "1.15.0",
"libs/wallet-provider": "1.0.0",
"libs/ui-utils": "1.1.0",
"libs/abis": "1.2.0",
"libs/balances-and-allowances": "1.0.0",
"libs/iframe-transport": "1.0.0",
"libs/hook-dapp-lib": "1.1.0"
"libs/hook-dapp-lib": "1.2.0"
}
26 changes: 26 additions & 0 deletions apps/cowswap-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [1.86.1](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.86.0...cowswap-v1.86.1) (2024-10-18)


### Bug Fixes

* **widget:** ignore selected eip6963 provider when in widget ([#5009](https://github.com/cowprotocol/cowswap/issues/5009)) ([3f8446b](https://github.com/cowprotocol/cowswap/commit/3f8446b48a4f493448b262959b943756a24382d9))

## [1.86.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.85.0...cowswap-v1.86.0) (2024-10-18)


### Features

* display new label for cow amm ([#4994](https://github.com/cowprotocol/cowswap/issues/4994)) ([531e63f](https://github.com/cowprotocol/cowswap/commit/531e63f666ffcafdaf8e2b1c2850991facbe5cf1))
* **hooks-store:** add claim vesting iframe hook ([#4924](https://github.com/cowprotocol/cowswap/issues/4924)) ([395f48f](https://github.com/cowprotocol/cowswap/commit/395f48f57d93de67305791fdb9a668bdd693074e))
* **hooks-store:** add sell/buy amounts to hook-dapp context ([#4990](https://github.com/cowprotocol/cowswap/issues/4990)) ([26cbffb](https://github.com/cowprotocol/cowswap/commit/26cbffbbfe8edbc0a4a9ba31fe9c0d42852118d9))
* **slippage:** small order slippage v2 ([#4934](https://github.com/cowprotocol/cowswap/issues/4934)) ([7b2a49c](https://github.com/cowprotocol/cowswap/commit/7b2a49c41ecfd62107a3128e771003743094d246))
* **smart-slippage:** update smart slippage text ([#4982](https://github.com/cowprotocol/cowswap/issues/4982)) ([4b89ecb](https://github.com/cowprotocol/cowswap/commit/4b89ecbf661e6c30193586c704e23c78b2bfc22b))
* **widget:** deadline widget param ([#4991](https://github.com/cowprotocol/cowswap/issues/4991)) ([ce3b5b8](https://github.com/cowprotocol/cowswap/commit/ce3b5b8adb5cc95a5ca3097d5cf2d45b249748c2))
* **widget:** hide bridge info ([#4992](https://github.com/cowprotocol/cowswap/issues/4992)) ([9842afd](https://github.com/cowprotocol/cowswap/commit/9842afdb887497d235a01538663488b0b8852bb5))
* **widget:** hide orders table ([#4993](https://github.com/cowprotocol/cowswap/issues/4993)) ([681fb20](https://github.com/cowprotocol/cowswap/commit/681fb20dab0b4155d50ad7f32c7a48cb95e084a3))


### Bug Fixes

* **smart-slippage:** fix smart slip tooltip and feature flag ([#5004](https://github.com/cowprotocol/cowswap/issues/5004)) ([c6ea5af](https://github.com/cowprotocol/cowswap/commit/c6ea5af5d24b9a806540d53d2a0d9e12799d4eff))

## [1.85.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.84.0...cowswap-v1.85.0) (2024-10-10)


Expand Down
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cowswap",
"version": "1.85.0",
"version": "1.86.1",
"description": "CoW Swap",
"main": "index.js",
"author": "",
Expand Down
28 changes: 19 additions & 9 deletions apps/cowswap-frontend/src/common/utils/tradeSettingsTooltips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,29 @@ export const getNativeSlippageTooltip = (chainId: SupportedChainId, symbols: (st
</Trans>
)

export const getNonNativeSlippageTooltip = (isSettingsModal?: boolean) => (
export const getNonNativeSlippageTooltip = (params?: { isDynamic?: boolean; isSettingsModal?: boolean }) => (
<Trans>
CoW Swap dynamically adjusts your slippage tolerance to ensure your trade executes quickly while still getting the
best price.{' '}
{isSettingsModal ? (
{params?.isDynamic ? (
<>
To override this, enter your desired slippage amount.
<br />
<br />
Either way, your slippage is protected from MEV!
CoW Swap dynamically adjusts your slippage tolerance to ensure your trade executes quickly while still getting
the best price.{' '}
{params?.isSettingsModal ? (
<>
To override this, enter your desired slippage amount.
<br />
<br />
Either way, your slippage is protected from MEV!
</>
) : (
<>
<br />
<br />
Trades are protected from MEV, so your slippage can't be exploited!
</>
)}
</>
) : (
"Trades are protected from MEV, so your slippage can't be exploited!"
<>CoW Swap trades are protected from MEV, so your slippage can't be exploited!</>
)}
</Trans>
)
7 changes: 6 additions & 1 deletion apps/cowswap-frontend/src/cow-react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ function Main() {

function Web3ProviderInstance({ children }: { children: ReactNode }) {
const selectedWallet = useAppSelector((state) => state.user.selectedWallet)
const { standaloneMode } = useInjectedWidgetParams()

return <Web3Provider selectedWallet={selectedWallet}>{children}</Web3Provider>
return (
<Web3Provider standaloneMode={standaloneMode} selectedWallet={selectedWallet}>
{children}
</Web3Provider>
)
}

function Toasts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { getNativeSlippageTooltip, getNonNativeSlippageTooltip } from 'common/ut
import useNativeCurrency from 'lib/hooks/useNativeCurrency'

import { useSwapConfirmButtonText } from '../../hooks/useSwapConfirmButtonText'
import { useSmartSwapSlippage } from '../../hooks/useSwapSlippage'
import { useSwapState } from '../../hooks/useSwapState'

const CONFIRM_TITLE = 'Swap'
Expand Down Expand Up @@ -78,6 +79,7 @@ export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) {
const buttonText = useSwapConfirmButtonText(slippageAdjustedSellAmount)

const isSmartSlippageApplied = useIsSmartSlippageApplied()
const smartSlippage = useSmartSwapSlippage()

const labelsAndTooltips = useMemo(
() => ({
Expand All @@ -87,7 +89,7 @@ export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) {
: undefined,
slippageTooltip: isEoaEthFlow
? getNativeSlippageTooltip(chainId, [nativeCurrency.symbol])
: getNonNativeSlippageTooltip(),
: getNonNativeSlippageTooltip({ isDynamic: !!smartSlippage }),
expectReceiveLabel: isExactIn ? 'Expected to receive' : 'Expected to sell',
minReceivedLabel: isExactIn ? 'Minimum receive' : 'Maximum sent',
minReceivedTooltip: getMinimumReceivedTooltip(allowedSlippage, isExactIn),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function calculateBpsFromFeeMultiplier(
isSell: boolean | undefined,
multiplierPercentage: number,
): number | undefined {
if (!sellAmount || !feeAmount || isSell === undefined || multiplierPercentage <= 0) {
if (!sellAmount || !feeAmount || isSell === undefined || !multiplierPercentage || multiplierPercentage <= 0) {
return undefined
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useReceiveAmountInfo } from 'modules/trade'

import { calculateBpsFromFeeMultiplier } from './calculateBpsFromFeeMultiplier'


/**
* Calculates smart slippage in bps, based on quoted fee
*
Expand All @@ -19,7 +18,7 @@ export function useSmartSlippageFromFeeMultiplier(): number | undefined {
const sellAmount = isSell ? afterNetworkCosts?.sellAmount : beforeNetworkCosts?.sellAmount
const feeAmount = costs?.networkFee?.amountInSellCurrency

const { smartSlippageFeeMultiplierPercentage = 50 } = useFeatureFlags()
const { smartSlippageFeeMultiplierPercentage } = useFeatureFlags()

return useMemo(
() => calculateBpsFromFeeMultiplier(sellAmount, feeAmount, isSell, smartSlippageFeeMultiplierPercentage),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function TransactionSettings({ deadlineState }: TransactionSettingsProps)
// <Trans>Your transaction will revert if the price changes unfavorably by more than this percentage.</Trans>
isEoaEthFlow
? getNativeSlippageTooltip(chainId, [nativeCurrency.symbol, getWrappedToken(nativeCurrency).symbol])
: getNonNativeSlippageTooltip(true)
: getNonNativeSlippageTooltip({ isDynamic: !!smartSlippage, isSettingsModal: true })
}
/>
</RowFixed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export function RowSlippageContent(props: RowSlippageContentProps) {
const openSettings = () => setSettingTabState({ open: true })

const tooltipContent =
slippageTooltip || (isEoaEthFlow ? getNativeSlippageTooltip(chainId, symbols) : getNonNativeSlippageTooltip())
slippageTooltip ||
(isEoaEthFlow
? getNativeSlippageTooltip(chainId, symbols)
: getNonNativeSlippageTooltip({ isDynamic: !!smartSlippage }))

// In case the user happened to set the same slippage as the suggestion, do not show the suggestion
const suggestedEqualToUserSlippage = smartSlippage && smartSlippage === displaySlippage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useYieldDerivedState } from '../../hooks/useYieldDerivedState'
const CONFIRM_TITLE = 'Confirm order'

const labelsAndTooltips = {
// TODO: pass parameters
slippageTooltip: getNonNativeSlippageTooltip(),
}

Expand Down
14 changes: 14 additions & 0 deletions apps/explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [2.36.0](https://github.com/cowprotocol/cowswap/compare/explorer-v2.35.2...explorer-v2.36.0) (2024-10-18)


### Features

* **explorer:** update explorer graph images ([#5008](https://github.com/cowprotocol/cowswap/issues/5008)) ([8952e9f](https://github.com/cowprotocol/cowswap/commit/8952e9f7b29ff848fa3da3f811e3e6232eb92361))

## [2.35.2](https://github.com/cowprotocol/cowswap/compare/explorer-v2.35.1...explorer-v2.35.2) (2024-10-18)


### Bug Fixes

* **explorer:** display hook details of unknown hook-dapp ([#4995](https://github.com/cowprotocol/cowswap/issues/4995)) ([eaa29f3](https://github.com/cowprotocol/cowswap/commit/eaa29f3ed421d92214b857bf1c57d75b0317cbba))

## [2.35.1](https://github.com/cowprotocol/cowswap/compare/explorer-v2.35.0...explorer-v2.35.1) (2024-10-14)


Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/explorer",
"version": "2.35.1",
"version": "2.36.0",
"description": "CoW Swap Explorer",
"main": "src/main.tsx",
"author": "",
Expand Down
7 changes: 6 additions & 1 deletion apps/explorer/src/assets/img/CoW-protocol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 39f451e

Please sign in to comment.