- truffle v5.1.43 (Solidity v0.5.16 (solc-js), Node v14.8.0, Web3.js v1.2.1)
- ganache test rpc.
$ npm install
$ export SEED=<your seed phrase>
$ truffle migrate --network {development/bsc_testnet}
Please have a look this instuction and make sure all of requrements for binding.
$ tbnbcli keys add owner --recover
$ tbnbcli token issue --symbol TESTONE --token-name "TEST one token" --total-supply 100000000000000000 --from owner --chain-id Binance-Chain-Ganges --node http://data-seed-pre-0-s3.binance.org:80
See the above deploy command. You have to check the following things before deploy token.
- Token symbol should have to same (if the BEP-2 token name is
SWINGBY-888
, symbol should beSWINGBY
) - Total supply should be same as BEP-2 token supply
- It may be better to disable the
mintable
on the Token.sol.
In thie case, the total supply is 100000000000000000
and 60000000000000000
600 million BEP-2 tokens will be locked into the pure-code-controlled address on BC. then, 40000000000000000
400 million BEP-20 tokens will be locked into the tokenManager contract on BSC.
$ tbnbcli bridge bind --symbol TESTONE-A43 --amount 60000000000000000 --expire-time <expiry time e.g. 1603011072> --contract-decimals 18 --from owner --chain-id Binance-Chain-Ganges --contract-address <your token contract address> --node http://data-seed-pre-0-s3.binance.org:80
$ AMOUNT=40000000000000000 truffle exec scripts/approveTokens.js --network bsc_testnet
$ SYMBOL=TESTONE-A43 truffle exec scripts/bindTokenContract.js --network bsc_testnet
$ tbnbcli token info --symbol TESTONE-A43 --trust-node --node http://data-seed-pre-0-s3.binance.org:80
$ tbnbcli bridge transfer-out --to <your bsc address> --expire-time <expiry time e.g. 1603011072> --chain-id Binance-Chain-Ganges --from owner --amount 10000000000:TESTONE-A43 --node http://data-seed-pre-0-s3.binance.org:80
$ AMOUNT=<your amount e.g. if decimals == 18, should be set 100> TO=<your bc address> truffle exec scripts/transferOutToBC.js --network bsc_testnet
$ truffle test