ICO is a hot topic in the crypto world today. In this article, I will attempt to explain how to create your own token for an ICO project.
First of all, you need to set up a private Ethereum, before you can proceed to create the token. After setting up the private network, you need to run it. (The detail steps for setting up a private Ethereum network is discussed in another article)
Next, you need to install the Ethereum wallet before you proceed. Follow the steps below to install the Ethereum Wallet.
- Install Ethereum Mist Wallet for Windows 10.
- Visit the link https://github.com/ethereum/mist/releases
- Download Ethereum-Wallet-win64-0-11-0.zip
- Create a folder Ethereum under the Program Files folder and extract the zip files there.
Launch the Ethereum wallet after successful installation. Also, create an account in the wallet.
Next, Open the Wallet app and then go to the Contracts tab as shown in the figure below:
Click on DEPLOY NEW CONTRACT and bring up the Solidity Contract Source code text editor as shown the following figure:
Now type the following smart contract code in the code editor.
pragma solidity ^0.4.24;contract BestToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
string public name;
string public symbol;
uint8 public decimals;/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol,
uint8 decimalUnits
) public {
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
}/* Send coins */ function transfer(address _to, uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient return true; }
}
Don’t worry about the code first, I will explain them in another article.
If the code compiles without any error, you should see a “pick a contract” drop-down list on the right, as shown in the figure below:
Click Pick a contract button and select the “BestToken” contract. On the right column, you’ll see all the parameters you need to personalize your own token. You can tweak them as you like, I use the following parameters: 10,000 as the supply, BestCoin for the token name, “#” as the symbol and 2 decimal places. Your wallet should be looking like this:
Scroll to the end of the page and you’ll see an estimate of the computation cost of that contract and you can select a fee on how much Ether you are willing to pay for it. Any excess Ether you don’t spend will be returned to you so you can leave the default settings if you wish. Press “deploy”, type your account password and wait a few seconds for your transaction to be picked up.
Now click the DEPLOY button to deploy the smart contract, the output dialog is as follows:
Upon entering the password for your account and click send transaction, the contract is successfully deployed, as follows:
Now the new token Best Token is shown in your wallet, as follows:
Tokens are currencies and other fungibles built on the Ethereum platform. In order for accounts to watch for tokens and send them, you have to add their address to this list. Proceed to add BestCoin to the list, as shown in the following figure.
Now the new token BestCoin will be shown in the list, as shown in the figure below.
Now you can send some funds from BestCoin to a wallet, as shown in the figure below:
Posted from my blog with SteemPress : http://www.blockchainguide.biz/creating-your-own-token-for-ico/
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://www.ethereum.org/token
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit