How to run ICO on Ethereum's smart contracts?

in #cryptocurrency7 years ago

logo.png

Hello! Today we have a lot if ICO's and ICO aren't run only lazy people. For organization you need a lot of time\money for writing white paper, advertisement on forum, creating landing page, creating community and the most important you should have a good idea and possibility to implement it. I am not going to tell you about all steps but only about creating smart contracts that accepts money(ethereum) and sends tokens according to the exchange rate.

Preparing

We are going to use Ethereum wallet for uploading contracts and for test we will upload contracts to TEST NET. For this you need to run Ethereum wallet and switch to TEST NET. Wait some time until blocks are loaded, that can take few hours. For uploading our contract we need some test ethereum (testnet ropsten). You can get it on site http://faucet.ropsten.be:3001/ or write on comments I will send you a bit.

Creating and uploading contract

We will create contract, that mint tokens when someone sends money to contract address. Contract will send back tokens according to the rate exchange. Also, ICO will work till defined block number and after that it will stop minting tokens. On the top select Contract, then Deploy new contract, copy and paste contract code https://gist.github.com/FerumFlex/1e35b45e13bf3fcadc45e2ae46245451. After this select contract name Crowdsale(name of contract) in the drop down fill other variables like on screenshot:

Few words about params

Start block - Number of block when ICO starts. You can set block in the past and ICO starts immediately. I selected block number 1290000.

End block - Number of block when ICO ends. I selected 1400000, this is approximately 76 days.

Rate - this exchange rate. How many tokens will be minted for 1 ETH.

Wallet - Address of YOUR wallet, contract will send ether to this wallet.

Then click Deploy and set gas limit around 2000000 or greater and click Send.

Testing

So your transaction was committed, and You need address of ICO contract and address of token(two different addressed). To get ICO contract address click on the transaction and click on link To: Crowdsale. See screenshot:

At the top you can see name of the contract (Crowdsale) and below it you can find address of the ICO contract (for my screenshot this is 0x9BeC1ABc21e7C60FfAacA5bAD561234C0f90c90A). At the end of the page you can find address of token(for my case this is 0x4E686a74dF3a00e68c451980585b5FC361aC118f). To add token to the list, click on Contracts and find button Watch Token at the bottom. You need to copy your token address at the input and click Ok. And now when someone sends ether to the ICO contract we will get ether in our wallet. Awesome :)

This is awesome, but I do not want to repeat these steps...

You can use contracts that I uploaded, Send ether(ONLY in testnet ropsten) to address 0x9BeC1ABc21e7C60FfAacA5bAD561234C0f90c90A and you will get your tokens. Test ether you can get on site http://faucet.ropsten.be:3001/ or write me your address. Do not forget to add token to watching list.

Conclusion

This is simple example of the ICO contract, but you can find more examples at https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts

Happy ICO!!!

Sort:  

Good explanation!
I'm following you :)

Please read this before you buy any Token from ICO site.. you can buy token at much less price at exchange

https://steemit.com/trueflip/@cryptolover82/ico-and-hitbtc-exchange

Very good article. Really appreciate you bring this to our attention. I've been asking myself. How many people really do a proper background check before seriously investing in an ICO? Do you know this interesting site? https://www.coincheckup.com The best crypto analysis site by far. Complete in depth investment analysis.

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.027
BTC 60701.29
ETH 2637.06
USDT 1.00
SBD 2.52