ERC20 Messaging dApp

It is time to make your first steps with the Topos Testnet and get familiar with it. To do so, you will use a basic dApp provided by Topos: the Topos ERC20 Messaging dApp. It is a sample application that allows you to experience Topos as a user. Later, you can find out more about the actions that are triggered and executed on the Testnet during your test.

Visit the ERC20 Messaging dApp

Note

Please make sure you have installed MetaMask before continuing.

With MetaMask installed, you can navigate to ERC20 Messaging:

dApp first page

You are now going to complete a cross-subnet, fungible token transfer from the Topos Subnet to the Incal subnet.

1

First, you must connect MetaMask with the ERC20 Messaging dApp:

The ERC20 Messaging dApp will display your address in the right top corner after the ERC20 dApp is connected to your wallet:

Each time you pick up a sending subnet it will be automatically added to MetaMask, if it is the first time you attempt to do so.

Add Topos to your networks:

Add Incal too:

If the network is already added to MetaMask, it will just ask for permission to switch the network if you pick up a subnet. For example, for Topos:

Or for Incal:

2

In either case, select the Incal subnet in the dApp:

3

Register a token, here named testToken:

Faucet

In order to register tokens on the subnets, you will need to pay fees on both subnets. Use the Topos Faucet:

Get some TOPOS and INCAL

Make sure that the tokens are sent:

Tokens sent

Now you can pay the necessary fee for a token registration (e.g., for the Incal subnet):

Pay INCA fee
4

Repeat these steps for the Topos Subnet.

5

With both token setups done, you can try your first cross-subnet token transfer:

Incal page
6

The ERC20 Messaging dApp will list the different steps involved in the cross-subnet transfer process:

Transaction page

First, approve the actions:

approve transaction
Note

A cross-subnet ERC20 token transfer involves you approving several actions:

  1. Make allowance for token burn by sending an approve transaction to the token contract you deployed during registration of a new token. This step is not always required (for example, if you did not hit the maximum you set in this step during the next step).
  2. Burn tokens on the Incal subnet and emit an event by sending a sendToken transaction to ERC20Messaging contract.

The ERC20 Messaging dApp will wait for the transaction to be executed:

Wait for the transaction

It should give you a success message, like the following:

Successful page

Congratulations! You have completed your first cross-subnet token transfer.

Troubleshooting

Under the hood

The following steps describe what actually happened:

  1. The ERC20 Messaging frontend deployed a token contract on each subnet for the token you registered on it.
  2. It submitted a transaction to the Incal subnet in order to burn the transferred tokens on the Incal subnet.
  3. It made a request on the executor service. It submitted the Merkle proof of the transaction (proof of inclusion of its receipt in the receipt trie of the certified state transition) and the root of the transaction trie to the executor service, which is used by the ERC20Messaging contract to retrieve the certificate from the ToposCore contract.
  4. This certificate was emitted and then stored on-chain by the Topos Subnet.
  5. The Topos Subnet minted your transferred tokens.

Up next

You have invoked your first cross-subnet token transfer with Topos. In the next section, you will use Topos Explorer to see the certificates that were created.