1ST ERC20 token migration is the burning of tokens on the Ethereum chain and the minting of Dawn tokens on the Dawn Chain (DAWN).
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
There is a contract specifically for KYC that will be just used for processing KYC.
The contract is Owned by the deployer and can be transferred to another owner
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.
Mapping specifying what addresses are allowed to migrate tokens. They get added/removed by Approvers.
The owner will add Approvers who will approve any address for token migration.
The users/token holders will send an approval request so that they are allowed to migrate.
Approvers will look into their KYC details and after they are convinced, they will add the users to ApprovedAddresses.
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.
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.
The contract is Owned by the deployer and can be transferred to another owner
The ApprovedAddresses which would migrate their tokens
The provider will set the active=true
for fund locking
so that the migration window is open.
The user can then start the migration flow by entering the amount of 1ST tokens he needs to transfer.
The 1ST tokens will be then sent to 0x0
ethereum address (burn address).
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
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 [email protected], 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.
Solidity - Smart Contract Language
Chai - Testing Framework
Open Zeppelin - Smart Contract Tools
Truffle - Smart Contract Tools
Please read CAREFULLY through the documents which are also available on our official site before interacting with this smart contract.