Using ethereum, it’s very simple to create your own token coin. I did it in less than 5 minutes and will show you how.
If you want to watch the video:
If you rather read:
First, let’s get the code. This will be the code we will use as a blueprint for our token. You will be able to create a initial supply as well as transfer it to people.
pragma solidity ^ 0.4.2;
contract SimpleToken {
/* Public variables of the token */
string public standard = 'Token 0.1';
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
/* This creates an array with all balances */
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function SimpleToken(
uint256 initialSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol
) {
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
totalSupply = initialSupply; // Update total supply
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) {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
}
Next, we open up the Mist wallet, you can also use MyEtherWallet or MetaMask. But I use the Mist wallet because it’s developed by the Ethereum developers. It’s kind’ve annoying because it requires you to run a full node which means that every time you start it up, it updates. This should get a lot better in the future once sharding is implemented. Here is where you can download mist: ethereum/mist.
Once on mist, Click on wallets and then contracts. Select the account you want to you use. In the “SOLIDITY CONTRACT SOURCE CODE” field, we will paste the code from above. You can also get this code from github at charlesmarino1/simpleToken.
After pasting the code, select the contract called “Simple Token”. Next, fill in the fields. Initial supply will be how many coins will be credited to your account. Token name will be the name of your coin. Decimal units will be how many decimal units your coin will have, for your first just use “0”. Token Symbol will be the symbol used to recognize your coin. “ETH”, “BTC”, “GNT” are examples.
Choose a maximum fee. This fee will go to miners. Miners need to be paid for executing your code. I recommend using the estimated amount. Put in your wallet password and click on “Send Transaction”.
The wallet should give you a transaction id which you can use to track your progress on etherscan. This usually takes around 3-15 minutes depending on how much gas you used.
Once it gets processed, they will go to the wallet that executed the contract.
In the picture above, you can see that I now hold “1,00o CTW”. We can now send them to our friends or “Hodl” them. I hope this showed you how easy it is to create your own coin. Let me know what type of tutorials you’d like to see next, maybe we’ll all create an ICO.
Hasta La Vista Baby!
Github Link: https://github.com/charlesmarino1/sim...
Mist Wallet: https://github.com/ethereum/mist/rele...
SUBSCRIBE FOR MORE VIDEOS: http://bit.ly/sub2CW
FB GROUP: http://bit.ly/cryptowatchersfb
BUY BTC/ETH and get $10: http://bit.ly/CBReferral
What an awesome idea for a Steemit post. I always wondered how this was done and it's terrifyingly straight-forward. I hope your hard work is rewarded with lots of up-votes.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @cryptowatchers! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
My Analysis nailed the last BTC bottom and has made many accurate price calls! Please check it out: https://steemit.com/@haejin
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit