Skip to content
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

Address review comments on PR134 #147

Merged
merged 9 commits into from
May 24, 2024

Conversation

yugure-orca
Copy link
Collaborator

@yugure-orca yugure-orca commented May 22, 2024

This PR is to address review comments on #134 .
PR134 contains many difference, so to clarify the difference to address comments, I've created separate PR.
Once this PR have been approved, will merge into yugure/token-extensions branch, and then it will be merged into main.

@yugure-orca yugure-orca marked this pull request as draft May 22, 2024 08:36
@yugure-orca yugure-orca changed the title Address review comments [WIP] Address review comments May 22, 2024
@yugure-orca yugure-orca changed the title [WIP] Address review comments Address review comments on PR134 May 23, 2024
@yugure-orca yugure-orca mentioned this pull request May 23, 2024
52 tasks
@yugure-orca yugure-orca requested a review from philcchen May 23, 2024 18:34
@yugure-orca yugure-orca marked this pull request as ready for review May 23, 2024 18:34
@yugure-orca yugure-orca merged commit e29b2cb into yugure/token-extensions May 24, 2024
yugure-orca added a commit that referenced this pull request May 24, 2024
* upgrade to solana 1.17 & anchor 0.29

* just add v2 instructions as v1 clone

* migrate to InterfaceAccount, add memo and mints

* add v2 token transfer

* swap util v2

* rename const memo to transfer_memo

* add is_supported_token_mint check

* add safe guard (for TODO)

* add safe guard (for TODO)

* add V2 ix on WhirlpoolIx class

* add v2 test fixture

* update test cases (collect_fees_v2, collect_protocol_fees_v2)

* update test cases (collect_reward_v2)

* update test cases (increase/decrease liquidity)

* update test cases (init pool & init reward)

* update test cases (set_reward_emmissions_v2)

* update test cases (swap_v2)

* update test cases (two_hop_swap_v2)

* add transfer fee extension

* add ConfigExtension and TokenBadge

* add transfer hook extension

* add TransferHook test program

* support ConfidentialTransferMint (but non-confidential transfer only)

* format doc (v2 test cases)

* add token_program address constraints / add invalid account test cases

* add MemoTransfer ext test cases

* add TransferHook ext test cases

* add Confidential Transfer test cases

* add ConfigExtension/TokenBadge ix test cases

* restructure ConfigExtension authority relation

* add TransferFee ext test cases

* add additional TransferFee ext test cases

* update is_supported_token_mint logic

mint of TokenProgram will be always supported (for compatibility)

* add SupportedToken test cases

* block FeeTier and tickSpacing unmatch

* add fake TokenBadge test cases

* add more TransferHook test cases (hook program block transfer)

* add more TransferFee test cases (update and max)

* add logging TransferFee config state

* fix test case errors (feetier / tickspacing unmatch)

* remove TA related defs from remaining_accounts

* [WIP] Token extension step 2 (mainly SDK side) (#141)

* drop supporting native mint of Token-2022

* add remaining accounts comment on Accounts struct

* upgrade SDK anchor version to v0.29

* fix type unmatch on RemainingAccountsInfoData

* use common-sdk with TokenExtension

* intro TransferFee into SDK

* intro TransferHook into SDK

* impl vault to vault transfer

* use vault to vault transfer

* eliminate mid owner token account from two_hop_swap

* add test cases for TransferFee edge case (100% fee rate)

* add test cases for TransferFee edge case (100% fee rate) (twoHopSwap)

* address review comment (fix comment)

* twoHop: check overlapping in handler, fix testcase

* [sdk] fix position-impl

* Yugure/token extension step 3 (SDK/client) (#143)

* add testcase: re-initialize TokenBadge

* make TokenExtensionUtil public

* use V2 instructions

* deprecate PriceModule, WhirlpoolRouter

* add isSupportedToken (client side)

* add client test

* client impl update

* [audit feedback] add RemainingAccountsDuplicatedAccountsType error

* [audit feedback] split AmountWithTransferFee

* [audit feedback] add fuzz_tests for fee calc

* Token extension merge from main (price slippage) (#145)

* Price-based slippage calculation for increase liquidity (#135)

- Deprecated the old increaseLiquidityQuoteByInputToken quote function & added a new increaseLiquidityQuoteByInputTokenUsingPriceSlippage to calculate tokenMax based on price movement
- Adding increaseLiquidityQuoteByLiquidity quote function to generate a quote by a set liquidity value

* Bump common-sdk to 0.5.2 (#138)

* Bump common-sdk to 0.5.2

* Lockfile

* Version bump

---------

Co-authored-by: Michael Hwang <[email protected]>
Co-authored-by: Wilhelm Thieme <[email protected]>

* Bump common-sdk to 0.5.3 (#139)

* Bump common-sdk to 0.5.3
* Bump whirlpools-sdk to 0.12.4

* Remove some unnused/unnecessary lock files (#137)

* use idempotent on whirlpool.swap (swapAsync) (#142)

* use idempotent on whirlpool.swap (swapAsync)

* add test case

* bump version 0.12.5

* fix compile error

---------

Co-authored-by: meep <[email protected]>
Co-authored-by: tmoc <[email protected]>
Co-authored-by: Michael Hwang <[email protected]>
Co-authored-by: Wilhelm Thieme <[email protected]>
Co-authored-by: Will <[email protected]>

* fix merge issue (dup comment)

* use the latest common sdk, fix build error (router doesn't support TE)

* bump to 0.13.0-alpha.0

* Address review comments on PR134 (#147)

* fix comment

* combine two statements depending on same condition

* refactor isV2IxRequiredPool

* refactor: split TokenAmountWithFee into 2 explicit types

* type change BN to TransferFeeIn(Ex)cludedAmount on quotes

* Revert "type change BN to TransferFeeIn(Ex)cludedAmount on quotes"

This reverts commit 41008b1.

* fix Router test case (compatibility)

* make remaining_accounts_info Option

* add getExtraAccountMetasForTransferHookForPool

* bump to 0.3.0

---------

Co-authored-by: meep <[email protected]>
Co-authored-by: tmoc <[email protected]>
Co-authored-by: Michael Hwang <[email protected]>
Co-authored-by: Wilhelm Thieme <[email protected]>
Co-authored-by: Will <[email protected]>
@wjthieme wjthieme deleted the yugure/address-review-comments branch August 5, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants