Dissecting the EOS ICO Distribution App, how does it interface with the EOSCrowdsale Contract?
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
- Button to Generate EOS Keypar client-side via JS.
- Step to remind you to store your key-pair and nags for a private key confirmation.
- 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. - 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 :)