-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add split route support in all adapters #103
Conversation
@thal0x Don't we have to change interfaces for all swap adapters no matter what? How would this be called by the entrypoint without a change in interface? |
minimum_receive: None, | ||
}; | ||
|
||
// let denom_in = route.operations.first().unwrap().denom_in.clone(); |
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.
remove comment
The interface was already updated this PR just changes the logic to not error on multiple routes |
|
||
// validate that the one coin is the same as the first swap operation's denom in | ||
if coin.denom != operations.first().unwrap().denom_in { |
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.
Do we do validation elsewhere that makes the validations you deleted no longer be relevant? I don't seem to see any validation but may be missing it
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.
Oh we do validation in entrypoint so we shouldn't need this... I see
@@ -159,22 +145,40 @@ fn execute_swap( | |||
return Err(ContractError::Unauthorized); | |||
} | |||
|
|||
// reset the pre swap out asset amount | |||
PRE_SWAP_OUT_ASSET_AMOUNT.save(deps.storage, &Uint128::new(0))?; |
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.
Same comment I had on the astroport version
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.
left some comments
* Revert "Add split route support in all adapters (#103)" This reverts commit 1fa4f21. * Revert "Support multiple routes in astroport adapter (#99)" This reverts commit a95f17d. * Revert "Support split routes in entry point contract (#101)" This reverts commit 94c3bbf. * Revert "Update contract types to support route splitting (#98)" This reverts commit ec1fd57. * Revert "add interface field to SwapOperation (#96)" This reverts commit eb37618.
* add SmartSwapExactAssetIn swap type * Revert "Add split route support in all adapters (#103)" This reverts commit 1fa4f21. * Revert "Support multiple routes in astroport adapter (#99)" This reverts commit a95f17d. * Revert "Support split routes in entry point contract (#101)" This reverts commit 94c3bbf. * Revert "Update contract types to support route splitting (#98)" This reverts commit ec1fd57. * Revert "add interface field to SwapOperation (#96)" This reverts commit eb37618. * remove deployed test contracts * fix fmt issue * update schema * since user_swap is mutatable, we can mutate in place * swap excess funds * update schema * lint change * fix test * add optional interface field to SwapOperation (#108) * return error for largest_route_index --------- Co-authored-by: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com>
* add SmartSwapExactAssetIn swap type * Revert "Add split route support in all adapters (#103)" This reverts commit 1fa4f21. * Revert "Support multiple routes in astroport adapter (#99)" This reverts commit a95f17d. * Revert "Support split routes in entry point contract (#101)" This reverts commit 94c3bbf. * Revert "Update contract types to support route splitting (#98)" This reverts commit ec1fd57. * Revert "add interface field to SwapOperation (#96)" This reverts commit eb37618. * remove deployed test contracts * fix fmt issue * update schema * since user_swap is mutatable, we can mutate in place * swap excess funds * update schema * lint change * fix test * add optional interface field to SwapOperation (#108) * return error for largest_route_index * [API-2792] Add hallswap adapter (#102) * feat: add hallswap adapter * chore: add readme * pr fixes * add optional interface field to SwapOperation * update hallswap adapter to implement updated interface * remove get_hallswap_routes_from_skip_routes --------- Co-authored-by: thal0x <thal0x.eth@gmail.com> --------- Co-authored-by: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Co-authored-by: Yonggiee <58546952+Yonggiee@users.noreply.github.com>
Updates adapter contracts to support multiple routes. Excluding:
Updates
osmosis-std
to access split route typesNote: I checked the Dexter router code and they properly track balances between swaps so the edge case found in #99 won't be an issue.