Sushi-X-Swap enables cross chain swaps on Sushiswap on the supported networks. It supports all combinations of wallet, bentobox, trident and legacy AMM. It supports Stargate bridge as of now.
We assume that the tokens and bentobox approvals are already done. If not, add that at the start of the action.
Asset Transfer - Stargate Supported Assets - USDC, USDT, STG
ACTION_SRC_TRANSFER_FROM_BENTOBOX
and unwrap the tokens to this contract address. After this add action STARGATE_TELEPORT
. On the dst chain, use ACTION_DST_DEPOSIT_TO_BENTOBOX
, which deposits it to the bentobox.ACTION_SRC_DEPOSIT_TO_BENTOBOX
and deposit to the address of msg.sender. After this add action ACTION_SRC_TRANSFER_FROM_BENTOBOX
and unwrap the tokens to this contract address. After this add action STARGATE_TELEPORT
. On dst chain, use ACTION_DST_WITHDRAW_TOKEN
to withdraw it to user wallet.ACTION_SRC_DEPOSIT_TO_BENTOBOX
and deposit to the address of msg.sender. After this add action ACTION_SRC_TRANSFER_FROM_BENTOBOX
and unwrap the tokens to this contract address. After this add action STARGATE_TELEPORT
. On the dst chain, use ACTION_DST_DEPOSIT_TO_BENTOBOX
, which deposits it to the bentobox.ACTION_SRC_TRANSFER_FROM_BENTOBOX
and unwrap the tokens to this contract address. After this add action STARGATE_TELEPORT
. On dst chain, use ACTION_DST_WITHDRAW_TOKEN
to withdraw it to user wallet.Asset Transfer / Swaps - ERC20s and Native Token
ACTION_SRC_TRANSFER_FROM_BENTOBOX
and unwrap the tokens to the first pool of the swap, if it's legacy swap. If it's trident, transfer it to the first pool of the swap path. After this add action ACTION_LEGACY_SWAP
or ACTION_TRIDENT_SWAP
. If you have already deposited the tokens to the pool address, make sure to pass the correct amountIn. You can pass amountIn as 0 as well, however, in that case, it would automatically do the transfer, no need to deposit to the pool contract. In this case, make sure to withdraw tokens to this contract address. After this add action STARGATE_TELEPORT
. On the dst chain, use ACTION_DST_DEPOSIT_TO_BENTOBOX
for trident and deposit to the pool address of the swap path. In the case of legacy use ACTION_DST_WITHDRAW_TOKEN
and transfer it to the first pool of the swap path or you can put amountIn as 0 for swap and it would automatically take the amounts from this contract, make sure to withdraw it.