Bind Token

BSC and BC work together to ensure that one token can circulate in both formats with confirmed total supply and be used in different use cases. Token Binding can happen at any time after BEP2 and BEP2E are ready. The token owners of either BEP2 or BEP2E only need to complete the Binding process when a cross-chain feature is necessory.

Issue BEP2 Token

Please refer to this doc

Example Let's issue a new token ABC

tbnbcli token issue --symbol ABC --token-name "ABC token" --mintable --total-supply 10000000000000000 --from owner --chain-id Binance-Chain-Kongo --node http://data-seed-prealpha-2-s1.binance.org:80

Deploy BEP2E Token

Please refer to this doc

The symbol of the BEP2E token must be identical to the prefix of the bep2 token(case insensitive). In this scenario, the symbol can be "abc", "aBc", "ABC" and so on.

Token Binding

Send Bind Transaction

tbnbcli bridge bind --symbol ABC-A64 --amount 6000000000000000 --expire-time 1597545851 --contract-decimals 18 --from owner --chain-id Binance-Chain-Kongo --contract-address 0xee3de9d0640ab4342bf83fe2897201543924a324 --node http://data-seed-prealpha-2-s1.binance.org:80
The total supply of the ABC-A64 token is 100 million. The above bind transfer will transfer 60 million to a pure-code-controlled address. And then there are 40 million flowable tokens in BC. According to our bind mechanism, we have to lock 40 million token to TokenHub contract and leave 60 million flowable token on BSC. Thus the sum of flowable tokens on both chains is 100 million. Please remember that the amounts I mentioned above don’t include decimals.

Approve Bind Request

  1. Grant allowance:

    In myetherwallet, call the approve of the BEP2E to grant a 40 million allowance to TokenHub contract. The spender value should be 0x0000000000000000000000000000000000001004, and the amount value should be 4e25. The transaction sender should be the BEP2E owner.

    img

  2. Approve Bind

    In myetherwallet, call approveBind in TokenHub contract to approve the bind request from the BEP2E owner address.

    img

  3. Confirm bind result on BC

    Wait for about 20 seconds and execute this command:

    tbnbcli token info --symbol ABC-A64 --trust-node --node http://data-seed-prealpha-2-s1.binance.org:80
    

    {
      "type": "bnbchain/Token",
      "value": {
        "name": "ABC Token",
        "symbol": "ABC-A64",
        "original_symbol": "ABC",
        "total_supply": "100000000.00000000",
        "owner": "tbnb1l9ffdr8e2pk7h4agvhwcslh2urwpuhqm2u82hy",
        "mintable": false,
        "contract_address": "0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "contract_decimals": 18
      }
    }
    
    If the bind was successful, then in the above response, "contract_address" and "contract_decimals" should not be empty.