feat: implementing permit2 with pay with any token#5926
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportBase: 12.86% // Head: 12.89% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5926 +/- ##
==========================================
+ Coverage 12.86% 12.89% +0.02%
==========================================
Files 408 408
Lines 12815 12816 +1
Branches 4491 4492 +1
==========================================
+ Hits 1649 1652 +3
+ Misses 11159 11157 -2
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| cy.get(getTestSelector('nft-details-description-text')).should('not.exist') | ||
| cy.get(getTestSelector('nft-details-toggle-bag')).eq(1).click() | ||
| cy.get(getTestSelector('nft-bag')).should('exist') | ||
| // TODO: Enable when universal router is deployed to goerli these tests fail because it is not deployed there |
There was a problem hiding this comment.
Can you go into more detail about this failure? Could we instead make the bag or test conditional based off chain instead of removing it entirely?
There was a problem hiding this comment.
copied what web did and changed the hook to not be enabled on chains where universal router is not deployed an added an enabled flag
| display: flex; | ||
| justify-content: center; | ||
| margin: 12px 0 !important; | ||
| margin-bottom: 10px !important; |
There was a problem hiding this comment.
nit: I don't think the !important is needed
There was a problem hiding this comment.
surprisingly it is
| buttonText = <Trans>Connect wallet</Trans> | ||
| } else if (usingPayWithAnyToken && tradeState !== TradeState.VALID) { | ||
| disabled = true | ||
| buttonText = <Trans>Fetching Route</Trans> |
There was a problem hiding this comment.
this is actually a bug on main .... fixed
| import { useCallback, useMemo, useState } from 'react' | ||
| import invariant from 'tiny-invariant' | ||
|
|
||
| export default function usePermit2Approval(amount?: CurrencyAmount<Token>, maximumAmount?: CurrencyAmount<Token>) { |
There was a problem hiding this comment.
Does web not already have a hook for approving the use of Permit2?
There was a problem hiding this comment.
they don't this is the code from web reduced to a hook
cbachmeier
left a comment
There was a problem hiding this comment.
Small bug. Other than that works well!
|
|
||
| const PayButton = styled(Row)<{ disabled?: boolean }>` | ||
| background: ${({ theme }) => theme.accentAction}; | ||
| const PayButton = styled.button<{ $backgroundColor: string }>` |


Uh oh!
There was an error while loading. Please reload this page.