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

⚡️ Derive Fee Swap Coin Out From IBC Fees Provided #36

Merged
merged 7 commits into from
Jul 28, 2023

Conversation

NotJeremyLiu
Copy link
Member

@NotJeremyLiu NotJeremyLiu commented Jul 28, 2023

Background

  • Previously, the contract accepted a coin_out param in SwapExactCoinOut, but the logic would essentially ensure this coin_out provided matched the actual fees given in ibc_info.fee.
  • So, since we made this enforcement, a simplification and safer flow from a caller would be such that the fee swap coin_out is directly derived from the provided ibc fees itself, leaving no way for the caller to specify an incorrect coin_out.

This PR

  • Removes the coin_out field from SwapExactCoinOut
  • Implements a one_coin method on IbcFee to ensure that if it provided it is exactly one coin (since the rest of the contract can't handle multiple ibc fee swaps anyways, and since it's an Option it should be set to None if no ibc fees are required)
  • Changes the entry point contract to derive the fee swap coin out from the ibc fees
  • Adds tests

@NotJeremyLiu NotJeremyLiu changed the title Jl/derive fee swap coin out from ibc fees ⚡️ Derive Fee Swap Coin Out From IBC Fees Provided Jul 28, 2023
@NotJeremyLiu NotJeremyLiu added the interface-breaking changes that break the user-facing interface to call the contract label Jul 28, 2023
@NotJeremyLiu NotJeremyLiu mentioned this pull request Jul 28, 2023
23 tasks
@NotJeremyLiu NotJeremyLiu merged commit 0444978 into main Jul 28, 2023
3 checks passed
@NotJeremyLiu NotJeremyLiu deleted the jl/derive-fee-swap-coin-out-from-ibc-fees branch July 28, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface-breaking changes that break the user-facing interface to call the contract
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants