As some of you already know, not all of the Ethereum addresses that held ERC20 tokens were registered into the new EOS Blockchain. There is still a small number of EOS that has not been allocated to their rightful owners. In order to fix this we have coded up a possible solution trough the implementation of a smart contract called eosio.claim.
EOS Argentina will keep working towards brining community solutions to the EOS Blockchain and we believe it is of utmost importance to register all of the Ethereum Addresses that participated in the contribution period.
The Contract
The following “eosio.claim” contract can be used to register the unregistered accounts and issue the corresponding tokens for each account that was left out the bios-boot process.
eosio.claim reads the eosio.unregd table of unregistered accounts to verify the unregistered ethereum addresses, if an address is in fact unregistered the contract proceeds to create an EOS Account and issue the corresponding tokens.
Once the account has been created and the tokens have been issued, the Ethereum address is added to an internal contract's table and marked as “used”, so that it can not be claimed more than once.
In essence, what the eosio.claim contract does is:
- Verify that the account name is valid / and it has exactly 12 chars.
- Verify that the desired account does not exists.
- Extract block num/prefix from message.
- Assert that the current TX has the same block num/prefix as the message.
- Calculate the ETH address based on the pubkey sent.
- Verify that the ETH address has not claim their tokens before.
- Find the ETH address in the eosio.unregd contract.
- Calculate hash(message) and verify the signature against the pubkey provided.
- Split eosio.unregd contribution into cpu/net/liquid (same split function as boot).
- Generate EOS key based on ETH pubkey.
- Calculate the amount of EOS to purchase 8k of RAM (using the EOSRAM market).
- Build an authority with just one k1 key.
- Issue (to eosio) the necessary amount of EOS to create the provided account (total = EOS to buy 8k of RAM + balance of account in eosio.unregd).
- Create an EOS account with the above authority for owner/active.
- Buy RAM for the provided account (8k).
- Delegate bandwidth.
- Transfer remaining EOS if any (liquid EOS).
- Mark the ETH address as "used".
Block Producers can implement this contract by creating a multisig that:
1.- Deploys the contract in the eosio.claim account
2.- Sets the eosio.claim account as a privileged account so that it can issue tokens as the eosio account.
We invite all Block Producers and the EOS community to read through this contract and evaluate the implementation of a multisig to deploy it.