Transfer Moons between Rinkeby and xDai Chain using the MOON bridge extension
Instructions on relaying MOON tokens through the MOON AMB bridge extension
The instructions below use MyEtherWallet to transfer tokens. This method is not very intuitive. We expect a DApp (e.g. Burner Wallet 2) will adopt these instructions to provide a better user experience.
We use MyEtherWallet (MEW) to transfer MOON tokens through the bridge extension. MEW may be used for both types of operations: to deposit tokens to the xDai chain and to withdraw tokens from the xDai chain.
You will need a small amount of Rinkeby Testnet ether for gas fees and an amount of Moons to transfer for this tutorial.
Deposit MOON tokens to the xDai chain
Activate and open a web3 wallet (like MetaMask or Nifty Wallet) and select the Rinkeby Testnet. Go to MyEtherWallet (MEW) and select the option to login with MewCX (MetaMask or other web3 wallet). Use a wallet that contains some amount of Moon tokens. Next:
1) Select the Interact with Contract item from the sidebar menu
2) Initialize the MOON token contract interface by entering the Moon token contract address in the Contract Address field: 0xdf82c9014f127243ce1305dfe54151647d74b27a
3) Add the following JSON in the ABI/JSON Interface field:
5) Choose an appropriate relayTokens method. There are two possible methods:
relayTokens(address _receiver, uint256 _amount)- Used to transfer MOON tokens to a recipient in the xDai chain.
relayTokens(address _from, address _receiver, uint256 _amount) - Used in scenarios when the MOON tokens deposit is performed by another contract on behalf of a user account (e.g. a wallet contract).
1) Select the first relayTokens method.
2) _receiver - Enter the account that will receive the MOON tokens on the xDai chain. Typically we assume the same account that deposits the token also receives the token, so enter the address (from your web3wallet & shown in MEW) you are initiating the transfer from. However, you can enter another address if you prefer.
3)_amount -- the amount of tokens (in Wei) to transfer; it must be less or equal to the amount of tokens approved for the bridge operations in step 2.3.
4) Press Write.
Check the gas price, then Submit the transaction your web3 wallet and wait until it is included in the chain.
It will require the AMB bridge a short (20-40 seconds) amount of time to relay the deposit request to the xDai chain. After some time the balance of the account specified as _receiver in the relayTokens method call will increase. The result of the relay operation can be monitored in Blockscout.
Withdraw MOON tokens from the xDai chain
No special operations are required to transfer MOON tokens back to the Rinkeby Testnet. Just send MOON tokens in the xDai chain to the mediator 0x1E0507046130c31DEb20EC2f870ad070Ff266079. They will be sent to the same wallet address. You will need a very small amount of xDai to process.
If you want to specify an alternative receiver of the tokens (a different address) in the Rinkeby Testnet, the relayTokens method from the mediator contract can be used.
Viewing your MOON Tokens
You will need to add the Moon contract addresses to your wallet to view, and be sure you are connected to the correct chain. For instructions on adding custom tokens, see the sUSD tutorial. Add 18 decimals of precision to view accurate balance.