Dissecting the EOS ICO Distribution App, how does it interface with the EOSCrowdsale Contract?

in #eos7 years ago (edited)

The following is a technical Breakdown of the Official EOS Distribution MetaMask enabled Web-Interface and how it integrates with the EOSCrowdsale contract. This originally appeared in EOS Token Sale with MyEtherWallet - The Complete Guide, but was removed to make the guide easier for users. I have declined payout for this post

The Official EOS Distribution Web-Interface simplifies the interaction with the EOSCrowdsale Contract to make the process easier on the user with significantly lower possibility of error.

Breakdown

  1. Button to Generate EOS Keypar client-side via JS.
  2. Step to remind you to store your key-pair and nags for a private key confirmation.
  3. When you click "I have safely backed up my private key," it calls the register() function in the EOSCrowdsale contract that maps the EOS key you just generated to the active Ethereum wallet (address/pub key) in MetaMask.
  4. You then enter how many ETH you would like to contribute from the currently loaded MetaMask Wallet. Behind the scenes, it's passing the ETH amount you entered, the number representing the window period you are contributing to (depending on the value of the dropdown) and a "0" for an argument called "limit" that doesn't seem to be exposed in the interface to a function called buyWithLimit()

Hope that was helpful :)

Coin Marketplace

STEEM 0.21
TRX 0.24
JST 0.038
BTC 94514.58
ETH 3259.44
USDT 1.00
SBD 3.16