-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(swap): partial approve #5256
Merged
Merged
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8c617cc
feat(swap): add settings option for partial approve
shoom3301 9cf72b4
feat(swap): add sell amount to regular approve tx
shoom3301 a017d48
feat(swap): add sell amount to permit value
shoom3301 40a4ba8
chore: fix build
shoom3301 2cbf15a
fix: cache permit taking amount into account
shoom3301 4573c4d
feat(swap): take partial approves into account for sc wallets
shoom3301 7d412c5
fix: ignore account agnostic permit in hooks details
shoom3301 70b26a8
fix: take permit amount into account when caching
shoom3301 7456ae1
Merge branch 'develop' into feat/partial-approve
shoom3301 0f9afb1
Merge branch 'feat/partial-approve' of https://github.com/cowprotocol…
shoom3301 6e8ab09
fix: skip partial permits in widgets besides swap
shoom3301 fed5b99
chore: fix permit hook description
shoom3301 a7746a0
chore: fix conditions
shoom3301 f0a55ea
fix: disable partial approve for Hooks store
shoom3301 aa86013
fix: support partial approve it classic eth flow
shoom3301 92a8253
fix: do not use infinite approvals in swap when partial approve mode
shoom3301 ba3e996
chore: fix circular dependency
shoom3301 e188b2b
chore: add a dot
shoom3301 9438a4d
chore: fix tooltips
shoom3301 5098421
chore: adjust approve tooltip
shoom3301 11c6863
fix: display hook details only in Hooks store confirm modal
shoom3301 05a723f
feat(partial-approvals): partial approve v2 (#5269)
alfetopito da14347
Merge branch 'develop' into feat/partial-approve
alfetopito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Erc20__factory } from '@cowprotocol/abis' | ||
import type { BigNumber } from '@ethersproject/bignumber' | ||
|
||
const erc20Interface = Erc20__factory.createInterface() | ||
|
||
export interface PermitParameters { | ||
owner: string | ||
spender: string | ||
value: BigNumber | ||
deadline: BigNumber | ||
} | ||
|
||
export function parsePermitData(callData: string): PermitParameters { | ||
return erc20Interface.decodeFunctionData('permit', callData) as unknown as PermitParameters | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this throw?