Skip to content

v0.0.2

Latest
Compare
Choose a tag to compare
@Michael-Ixo Michael-Ixo released this 06 Sep 16:27
143c6ba

This release includes a few fixes and changes to the ixo-swap smart contract.

  • add more attributes to events for all messages, for easier off-chain indexing etc
  • add fee percentage validation that if not 0 it cant be less than 0.01%, as that is the minimum the scaling factors in code allows
  • add fee percentage validation that both liquidity pool fee and protocol fee together is less than max allowed 5%
  • remove native coin validation against bank module DenomMetada as want to be able to use ibc tokens
  • update slippage percentage handling/validation to also use the scale factor fees use, and make max possible slippage 10%
  • for cw1155 message creation use BTreeMap so events for the transfer will be deterministic (not urgent but nice)
  • change the way the 1155 tokens for transfer(get_token_amounts_to_transfer) gets fetched from the token supplies, first grab the
    specified minimums if provided, then use all the rest of the same token ids provided for mimimum, then lastly if needed use the rest
    of the token supplies, but load the other tokens from supplies in chunks for optimization, as large amounts of different tokens will
    cause scaling issues. This change also fixes a possible non-deterministic issue that used into_iter on HashMap
  • fix get_amount_without_fee as fee amounts won't always include all tokens, thus will panic
  • change fee calculations to round up, so if protocol fee is not 0, then will have minimum fee of 1. This also allowed adding
    extra validation that if there is a protocol fee and input amount is 1, then swap amount will always be 0 and we can throw nice error
    message instead of 0 transfer attempt
  • change the way to get 1155 token for a certain percentage (generally for protocol fees) get_percent_from_multiple works
    instead of trying to get the same amount from all token ids provided, rather sort the input tokens and fill up with sorted tokens. This
    means there will be less tokens in the protocol fee and swap transfer respectively, which is better for fees. This change also fixes a
    possible non-deterministic issue that used into_iter on HashMap
  • add a lot of comments to make code more clear

What's Changed

Full Changelog: v0.0.1...v0.0.2