Testing Token Migration

This test scenario walks you through the process of acquiring test INS tokens and swapping them to test XNS coins.

During the testing period of the Insolar MainNet, all operations will be performed with test XNS coins (native for MainNet).

Warning

Do not send real INS tokens from the main Ethereum network to Insolar MainNet during the testing period.

What You Will Need

You need to create two wallets:

  • Ethereum wallet that supports Ethereum test networks (Ropsten in particular) and custom tokens. This test scenario uses MetaMask as an example.

  • Insolar Wallet in which you can store XNS coins that are native for the MainNet.

Additionally, you need to understand the following:

  • What coins and tokens are. Coin is a native cryptocurrency of any blockchain and token is a unit of value that may be built on top of it. Coins operate independently, while tokens have specific uses. In the Ethereum network, the coin is the ether (ETH) and the token standard (upon which the INS token is built) is called ERC-20. Test tokens and coins are those that operate in test networks. For testing purposes, we are going to use the Ropsten test network.

  • What a crypto faucet is. The faucet is a quick and easy way of creating and distributing test coins and tokens in test networks.

  • What a token contract is. Essentially, a token contract is a smart contract that contains a map of account addresses and their balances. The unit of the balance is the token. When tokens are transferred from one account to another, the token contract updates the balances of the two accounts.

Test Scenario Overview

To grasp what you will be doing, take a look at the steps of the test scenario:

  1. Create a MetaMask wallet and, inside, switch to Ropsten test network and add the INS custom token.

  2. Get Ropsten test ETH coins.

  3. Swap the coins to test INS tokens using the INS token contract.

  4. Create an Insolar Wallet and, automatically, receive a migration address.

  5. Send the test INS tokens from the MetaMask wallet to the migration address. They will automatically swap to XNS native coins and appear in the Insolar Wallet.

All the above steps are described in detail in subsequent sections.

Creating and Setting Up Ethereum Wallet

To create and set up a MetaMask Ethereum wallet:

  1. Go to metamask.io and add its extension to your browser.

  2. Open the extension, click Get Started, Create a Wallet, and agree or disagree to help MetaMask improve itself.

  3. Create a new password, confirm it, and agree to the “Terms of Use”.

  4. Reveal the backup phrase, copy it, and click Next.

  5. Click the words of the backup phrase in correct order and then click Confirm.

  6. Receive congratulations from MetaMask and click All Done. You will see the wallet’s user interface.

  7. In the top right corner, select Ropsten Test Network from the drop-down list:

    https://github.com/insolar/doc-pics/raw/master/mig-test/selecting-ropsten.png

  8. In the bottom left corner, click Add Token:

    https://github.com/insolar/doc-pics/raw/master/mig-test/add-token.png

  9. On the Add Tokens screen, open the Custom Token tab:

    https://github.com/insolar/doc-pics/raw/master/mig-test/custom-token.png

  10. Copy the INS token contract address – click the copy icon copy-icon in the right corner of the following code block:

    0x7e94f2be613c6846c40325b0f2712269a0d61d10
    
  11. In the Token Contract Address field, paste the copied INS token contract address:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-token.png

    MetaMask will find the INS token symbol and decimals of precision for you. Click Next.

  12. On the next screen, click Add Tokens:

    https://github.com/insolar/doc-pics/raw/master/mig-test/add-ins.png

    With that, the MetaMask wallet is set up to operate the test ETH coins and INS tokens:

    https://github.com/insolar/doc-pics/raw/master/mig-test/wallet-setup.png

Acquiring Test ETH Coins and Swapping Them to Test INS Tokens

To acquire, first, test ETH, then swap them to test INS tokens:

  1. In the MetaMask wallet, first, click the ETH tab, then Deposit.

    https://github.com/insolar/doc-pics/raw/master/mig-test/eth-deposit.png

  2. In the Deposit Ether window, click Get Ether next to Test Faucet:

    https://github.com/insolar/doc-pics/raw/master/mig-test/get-eth-from-faucet.png

    This opens the MetaMask Ether Faucet page.

  3. On the opened page, click request 1 ether from faucet:

    https://github.com/insolar/doc-pics/raw/master/mig-test/request-one-eth.png

    MetaMask will ask you to connect the request in the newly opened window. Click Connect:

    https://github.com/insolar/doc-pics/raw/master/mig-test/connect-request.png

    Once connected, you can click request 1 ether from faucet several times more (maximum 6). The corresponding transaction entries will appear below:

    https://github.com/insolar/doc-pics/raw/master/mig-test/test-eth-txes.png

    Wait several seconds to let the transactions be processed by the test network and return to the MetaMask wallet.

  4. In the MetaMask wallet’s History, the confirmed transactions will appear and your balance will be updated. Click Send:

    https://github.com/insolar/doc-pics/raw/master/mig-test/meta-balance.png

  5. Again, copy the INS token contract address – click the copy icon copy-icon in the right corner of the following code block:

    0x7e94f2be613c6846c40325b0f2712269a0d61d10
    
  6. On the Add Recipient screen, paste the copied address to the search field:

    https://github.com/insolar/doc-pics/raw/master/mig-test/send-search-field.png

    The MetaMask wallet will recognize the INS token contract and display the transfer details:

    https://github.com/insolar/doc-pics/raw/master/mig-test/meta-transfer-details.png

  7. On the Send ETH screen, you do not need to send actual ETH to the token contract but a small amount of ETH will be automatically subtracted to pay for transaction processing.

    However, setting the correct gas value is required. To set it, click Advanced Options:

    https://github.com/insolar/doc-pics/raw/master/mig-test/advanced-options.png

  8. On the Customize Gas screen, set the Gas Limit to 80000 (eighty thousand) and click Save:

    https://github.com/insolar/doc-pics/raw/master/mig-test/gas-limit.png

    Caution

    If the gas limit value is lower than 80,000, the token contract will fail.

  9. Back on the Send ETH screen, click Next:

    https://github.com/insolar/doc-pics/raw/master/mig-test/finally-send-eth.png

    And, on the next screen, click Confirm:

    https://github.com/insolar/doc-pics/raw/master/mig-test/finally-confirm.png

  10. Repeat the procedure of sending ETH to INS token contract several more times to acquire enough test INS tokens.

    Once the corresponding transactions are confirmed, the MetaMask wallet is set up to operate test INS tokens:

    https://github.com/insolar/doc-pics/raw/master/mig-test/meta-wallet-setup.png

Next, migrate test INS token to the Insolar network. The migration will automatically swap the test INS tokens to test XNS coins.

Migrating Test INS Tokens and Swapping Them to Test XNS Coins

To migrate the test INS tokens and swap them to XNS coins:

  1. Create your Insolar Wallet. On the Insolar Wallet main page, click CREATE A NEW WALLET:

    https://github.com/insolar/doc-pics/raw/master/mig-test/create-ins-wallet.png

    The Wallet creation tutorial will open. Read through it attentively.

    Upon creation, the Wallet takes care of security for you:

    1. Generates a backup phrase and private key using randomization. They are synonymous in function.

    2. Encrypts the key with your password and puts it in a keystore file. You can use this file to access your wallet and authorize operations.

    3. Ensures that you make a record of the backup phrase. Using this phrase, you can restore the Wallet in case you lose the private key or the keystore file and your password.

    Caution

    You are solely responsible for keeping your funds as no one else can recover your Wallet. Insolar does not store your credentials, encrypted or otherwise.

  2. On the Create a new Wallet page:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-wallet-password.png
    1. Enter a new password. It should be at least 8 characters long and contain a mix of numbers, uppercase, and lowercase letters.

    2. Re-enter the password to confirm it.

    3. Agree to the “Term of Use”.

    4. Allow anonymous data collection to improve the service.

    5. Click NEXT.

  3. On the next screen, click REVEAL TEXT to see the backup phrase:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-reveal-phrase.png

    The secret backup phrase is a series of words that store all the information needed to recover Insolar Wallet. The backup phrase and private key are synonymous in function.

    Warning

    Never disclose your backup phrase (or private key).

    Tip

    Security tips:

    • Store the backup phrase in a password manager.

    • Write the phrase down on several pieces of paper and store them in different locations.

    • Memorize the phrase.

    Once you have secured the backup phrase, click NEXT.

  4. On the next screen, enter the requested words in the correct order and click OPEN MY WALLET:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-word-order.png
  5. Wait for the Wallet validation to complete and all features to become available:

    https://github.com/insolar/doc-pics/raw/master/mig-test/one-more-thing.png
  6. Once the Wallet is created, receive congratulations from Insolar:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-congrats.png

    And save the keystore file in one of the following ways:

    • Click SAVE LOCALLY to save it to your browser’s local storage. Keeping the file locally allows easier access from the browser on the device you are using.

    • Click DOWNLOAD to save it to your computer. In this case, you can move it to another device via, for example, a USB drive.

    Later, you can log in using one of the following:

    • (Recommended) Your password and the keystore file.

    • Unencrypted private key.

    Either way, the Wallet does not store the private key. Instead, it uses the private key provided every time to authorize login and operations. While logged in, you can copy your unencrypted private key, but keep in mind, this is its most vulnerable form.

  7. In the Insolar Wallet, click the avatar icon avatar-icon in the upper right corner to open the menu:

    https://github.com/insolar/doc-pics/raw/master/mig-test/right-menu.png

    In the menu, click Copy migration address.

    After that, return to the MetaMask wallet.

  8. In the MetaMask wallet, open the INS tab and click Send:

    https://github.com/insolar/doc-pics/raw/master/mig-test/meta-send-ins.png

  9. On the Add Recipient screen, paste the copied migration address to the search field:

    https://github.com/insolar/doc-pics/raw/master/mig-test/send-search-field.png

  10. On the Send Tokens screen, first, click Max, then Next:

    https://github.com/insolar/doc-pics/raw/master/mig-test/send-ins-to-mig-addr.png

    And Confirm the transaction:

    https://github.com/insolar/doc-pics/raw/master/mig-test/confirm-send-to-mig-addr.png

    The migration process may take some time.

  11. Once the transaction is processed by the Ropsten test network, your test XNS coins will appear in the Insolar Wallet:

    https://github.com/insolar/doc-pics/raw/master/mig-test/ins-tokens-hold.png

This concludes the migration test.