In multihop user knows the address of token he wants to sell, but doesn't know if it's a first or a second token in a configuration.
Modify the swap interface and replace mystical sell_a: bool parameter with offer_asset: Addr.
let config = get_config(&env)?;
...
let (pool_balance_sell, pool_balance_buy) = if sell_a {
(pool_balance_a, pool_balance_b)
} else {
(pool_balance_b, pool_balance_a)
};
From Config struct you will get addresses of both token_a and token_b.
Where pool_balane_sell will be balance of offer_token and pool_balance_buy will be the other one.
In multihop user knows the address of token he wants to sell, but doesn't know if it's a first or a second token in a configuration. Modify the swap interface and replace mystical
sell_a: bool
parameter withoffer_asset: Addr
.The main change will be: https://github.com/Phoenix-Protocol-Group/phoenix-contracts/blob/431c62b371263fea69d512df8ca052aa6a18613f/contracts/pair/src/contract.rs#L602C20-L613
From
Config
struct you will get addresses of bothtoken_a
andtoken_b
. Wherepool_balane_sell
will be balance ofoffer_token
andpool_balance_buy
will be the other one.