Thursday 29 November 2018

AlexToken - technical explanation


The short instruction


The short instruction is:
Write your Smart Contract code on Solidity language, go to the online compiler: https://remix.ethereum.org

  • Copy/Paste your source code there. 
  • Do not forget choice correct version of the compiler. 
  • Choose AlexToken in the "Swarm" list
  • Push the button "Start the compile"
  • Everything must be green at the bottom
  • Push the "Details" button to get the compilation results



Copy very long string of the "object" field. It is the "binary code" of the Smart Contract:



Now we are going to deploy the Smart Contract to the Ethereum network. Go to your favorite Ethereum wallet (mine is https://www.myetherwallet.com):
  • Go to the "Contracts" menu item, click on the "Deploy Contract" link
  • Paste into the "Byte Code" field our string
  • Look at the Gas Limit 2144779 and Gas Price 42 Gwei and calculate the contract deployment price:
(42000000000 × 2144779) / 1000000000000000000 = 0,090080718 ETH

  • So the contract deployment will cost about 0.09 Ethereum or about 720 RUB for the current price: 8000 RUB for 1 ETH
  • Authentificate yourself




Sign the transaction and deploy the contract:







Go to the contract: https://etherscan.io/address/0x41104edb2cefbb66cc28b17d507f0b4ba559f455
Now it is nesessary to "Verify and Publish" the contrat. Go to "Code" and click the link "Verify and Publish". I do not have one because I already done the task:



After you click the "Verify and Publish" link you'll get the form in which you need correctly:
  • Set the contract number
  • Set the contract name: AlexToken
  • Paste the source code 
  • Set the exact compiler version
  • Set optimisation to "No" if you are not sure about setting "Yes"
If everything is correct you'll get some green text. After that you can interact with the contract. For this copy the "Contract ABI" string:


Go to https://www.myetherwallet.com/ and paste the string, choice the function and get the result:




Amazing you can interact with you contract without logging into the wallet and not to spend any Ethereum!


Full instruction

Follow the tech manual:

"6 Steps to ERC20 Tokens and ICO Smart Contracts"
https://medium.com/coinmonks/6-steps-to-erc20-tokens-and-ico-smart-contracts-e90523afafa1




No comments:

Post a Comment