How to Mirror BEP2 and BEP20 Tokens
In the world of blockchain and cryptocurrency, it is common for multiple networks and platforms to exist for the same token. For example, a token may have a BEP2 version on Binance Chain and a BEP20 version on Binance Smart Chain. Mirroring tokens, or having the same token represented on multiple chains, allows for greater flexibility and reach for the token’s users.
This tutorial will guide you through the process of mirroring BEP2 and BEP20 tokens. You will learn how to create a smart contract that can represent the token on both chains, and how to manage the token on each chain. Whether you are a token issuer, a developer, or a token holder, this tutorial will provide valuable information on how to effectively manage your tokens across different networks.
This BEP20 token is not bound to any BEP2 token
Anyone can call the
mirror method to issue a BEP2 token automatically and bind them.
What Happens Under the Hood
Verify there is no pending mirror request
Check the total supply and token symbol is valid
Send a cross-chain package to issue a BEP2 token on Beacon Chain
The newly created BEP2 token is locked until the token holder sends cross-chain transfer
After binding, all liquid circulation is on BSC.
Pay in BNB
it’s 10 BNB on mainnet now
it’s 0.002BNB on mainnet now
relayFee can be changed by on-chain governance
mirrorFee from the system contract;
relayFee from system contract;
Mirror With MyEtherWallet
Tokenmanager Contract with the latest ABI
mirror function and fill-in with your BEP20 address
The value here should be no less than
Time stamp should be greater than
unix_timestamp(now()). The difference should be between 120 and 86400. It’s recommended to use
Query BEP2 Token Symbol
You can query the BEP2 Token symbol from
tokenhub contract with the latest ABI
getBoundBep2Symbol function to input BEP20 token contract address, then you can see the token symbol in the result.