1

I have a smart contract on the BSC network that I want to accept other tokens like AVAX, MATIC, ETH, and other EVM compatible tokens. How would one go about letting a user use AVAX but at the end it automatically turns to BNB and puts it in the smart contract on the BSC network?

I am guessing it will need a bridge of some sort but how does the swap from AVAX to BNB happen?

1 Answer 1

0

You cannot have native AVAX on BSC. You can only have one native token which is BNB on BSC. Though, you can have wrapped tokens like this one for AVAX : https://www.bscscan.com/address/0x1ce0c2827e2ef14d5c4f29a091d735a204794041#code Then if you want to do a swap automatically to BNB, you'll need to use an AMM like Pancakeswap : see https://docs.pancakeswap.finance/code/smart-contracts/pancakeswap-exchange/router-v2 and find the right pool for your needs.

Hope that helps

2
  • I was talking more about Avax on the Avax chain swapping to BNB on the BSC chain. Or Matic on the polygon network to BNB on the bsc chain. How do you do that? Jun 13, 2022 at 15:40
  • We use Bridges. Native AVAX would be locked on Avax chain and minted (wrapped token) on BSC then swapped for BNB. The bridge is a set of smart contracts deployed on both chains (target and source chains) and a set of off-chain services (can be centralised or decentralised). example : multichain.xyz. or github.com/ChainSafe/ChainBridge
    – Cyril
    Jun 14, 2022 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.