Ethereum Bridge

1ST ERC20 token migration is the burning of tokens on the Ethereum chain and the minting of Dawn tokens on the Dawn Chain (DAWN).

1ST ERC20 token migration is the burning of tokens on the Ethereum chain and the minting of Dawn tokens on the Dawn Chain (DAWN).

🧐 About

There is a contract specifically for token migration that will not be reused for anything else, such as stablecoin deposits and withdrawals. This limits the scope of the implementation and increases speed to market. The engineering plan has 2 sections:

  • KYC Contract

  • Token Migration Contract

🕵️‍♂️ KYC Contract

There is a contract specifically for KYC that will be just used for processing KYC.

Owner

The contract is Owned by the deployer and can be transferred to another owner

Approvers

This is a mapping that specifies what Ethereum addresses can add or remove addresses that are allowed to migrate which have completed the KYC. Approvers can be added/removed by the owner.

Approved Addresses

Mapping specifying what addresses are allowed to migrate tokens. They get added/removed by Approvers.

🎲 Steps

  1. The owner will add Approvers who will approve any address for token migration.

  2. The users/token holders will send an approval request so that they are allowed to migrate.

  3. Approvers will look into their KYC details and after they are convinced, they will add the users to ApprovedAddresses.

  4. The ApprovedAddresses will now be able to transfer his tokens.

PS: Only the ApprovedAddresses can migrate their tokens. And only the Approvers can approve the addresses.

💸 Token Migration Contract

This contract will be only used for migrating the 1st ERC tokens i.e burning of the 1st tokens on the Ethereum chain and minting them on the Dawn chain.

Provider

The contract is Owned by the deployer and can be transferred to another owner

Sender

The ApprovedAddresses which would migrate their tokens

🎲 Steps

  1. The provider will set the active=true for fund locking so that the migration window is open.

  2. The user can then start the migration flow by entering the amount of 1ST tokens he needs to transfer.

  3. The 1ST tokens will be then sent to 0x0 ethereum address (burn address).

  4. This will result in an event with the complete transaction data.

That event will be fetched by the relayer in the Dawn Chain which will trigger minting of new FBX tokens.

The active flag is there so that we can pause the migration in case of any abnormality

🔗 Testing

Install Truffle: $ npm install -g truffle

Install dependencies: $ npm install

Run commands from the appropriate directory: $ cd ethereum-contracts/contracts/bridge

Start the truffle environment: $ truffle develop

In another tab, run tests: $ truffle test

Run individual tests: $ truffle test test/<test_name.js>

Note: This project currently uses solc@0.5.0, make sure that this version of the Solidity compiler is being used to compile the contracts and does not conflict with other versions that may be installed on your machine.

⛏️ Built Using

🎉 Terms & Risk Disclosure

Please read CAREFULLY through the documents which are also available on our official site before interacting with this smart contract.

Last updated