How to get started building an ICO Smart Contract

ICO (Initial Coin Offering) is a new way to raise fund for startups.  There are many steps we have to be done before launching an ICO. One of them is writing ICO Smart Contract. Actually, ICO Smart Contract source code is quite simple. I think that, in the near future, there will be ICO Platform to help you create Smart Contract in some of mouse clicks.

However, Blockchain and Smart Contract is still new with developers, and Smart Contract development process is still complicated. So developer will think that there are a lot of things to learn before creating an ICO Smart Contract.

I created a documents to guide developers who have experiences in development but are new in Blockchain and Smart Contract. The document will show you step by step to create an Simple ICO Smart Contract and deploy it to Local Environment or Testnet (Ropsten).

For the document, you can take a look to link: https://erc20token.sonnguyen.ws

The document is open source under MIT License, now there is only English version.  So contributions are always appreciated. The source code of documents and demos are published to Github at link: https://github.com/thanhson1085/DemoCoin.

The smart contract that we used in my tutorial is very simple and only for education purpose. In fact, the scenario for ICO is more complicate and we need to comply the law of country where you want to sell your token.

Beside the law, you should concern to the security issue for your smart contract. Try to make your contract as simple as possible (Security loves simple). And reading the smart contract best practice document, learn from the fails (as DAO, Parity MutliSig Wallet) before start coding.

Get started Ethereum/Solidity ICO Smart Contract

The below is commands when I start to learn Ethereum/Solidity . Assume that we installed Geth and Solidity Compiler in our machine.

Install Ethereum

Install NodeJS

Install Solc

Run an Ethereum Node in testnet:

Run an Ethereum Node in Ropsten Testnet:

Run a private blockchain:

Open another terminal, connect to the exist node:


Strart mining

Check hashrate

Stop mining

Sync status

Remove Ethereum Database

Check balance in Ether

Send a transaction:

Send with gas, gasPrice:


Specification: https://theethereum.wiki/w/index.php/ERC20_Token_Standard#Approve_And_TransferFrom_Token_Balance