Académique Documents
Professionnel Documents
Culture Documents
Thankfully, Ethereum already has smart contracts built into their network, so instead of having to
create our own cryptocurrency from scratch, we can use the tools that they have provided.
Ethereum has a token standard called “ERC20,” which stands for “Ethereum request for
comments.” The main part of what differentiates these ERC20 tokens from standalone currencies
is that they are integrated into the Ethereum network, and use the hashing transactions that come
with ETH.
ERC20 is closer to a set of rules that defines an Ethereum coin, also known as a token standard.
It allows for developers to program their own functions within the Ethereum network. Many
ERC20 tokens exist already, with more being created every day. You can see the list here:
https://etherscan.io/tokens
EOS – probably one of the most notorious and well-known is EOS. At the time of writing, EOS
has the 9th highest market cap of all cryptocurrencies, coming in before big coins such as IOTA,
Dash, and Monero. The decentralized network allows for parallel processing and ICO’s, and
anything else decentralized.
We’re going to need a few things before you start the project.
For the token to work like an ETH-based token, it’s going to need a few variables that you will
create yourself.
1. The name: Call it whatever you want, but I would recommend something on the shorter
side. Naming something easy to remember is a plus.
2. The total supply: This will be the total number of coins in circulation. This means that
whatever you set cannot be added or subtracted (with exceptions).
3. The decimal places. Will this be a coin that can be divided into many pieces? The number
of decimal places will determine how far you can divide it. For example, 1 decimal place
means you can go to 100.1 coins, whereas 2 decimal places will allow you to go to
100.18 coins.
4. The symbol: A nice acronym or shortened name. Ex. Ethereum -> (ETH)
Now I’m going to lovingly borrow* some source code which you can access here.
https://docs.google.com/document/d/1zRGg5bMh944JhPVWcBx_YDK9cJxD3953pCI-
GZ5YLCs/edit?usp=sharing
It’s open-sourced, so anyone can access, use, and improve upon it.
If you scroll towards the bottom, you can see that there is this section of code:
function ERC20Token( ) {
balances[msg.sender] = NUMBER_OF_TOKENS_HERE; // Give the creator all
initial tokens (100000 for example)
totalSupply = NUMBER_OF_TOKENS_HERE; // Update total supply
(100000 for example)
name = "NAME OF YOUR TOKEN HERE"; // Set the name for
display purposes
decimals = 0; // Amount of decimals for display purposes
symbol = "SYM"; // Set the symbol for display purposes
}
Easily enough, you can just fill in the blanks. For the name and symbol, make sure to put the
name in quotations, otherwise it won’t compile properly. Edit what is highlighted in red.
function ERC20Token( ) {
balances[msg.sender] = 1000000; // Give the creator all initial tokens (100000 for
example)
totalSupply = 1000000; // Update total supply (100000 for example)
name = "JoshsCoin"; // Set the name for display purposes
decimals = 1; // Amount of decimals for display purposes
symbol = "JSH"; // Set the symbol for display purposes
}
Next, you should change the function name to be something related to your project. The two
lines below determine the name of the function
function ERC20Token(
These two lines determine what the function is called, so name them something appropriate.
Make sure that whatever name you put in matches!
Note: For those who want to go above and beyond and are familiar with coding, you can research
functions and implement them yourself. There are many different open-source functions you can
find that do things such as allow for the supply to fluctuate, be compatible with other
blockchains, etc.
Copy-and-paste your code into the text field, and then look towards the right where it says
“compile,” “run,” “settings,” and so on. In the settings tab, you will find a text field that lets you
choose your solidity version. Pick the most recent one (0.4.19 at time of writing) that is not a
nightly solidity. Nightly compilers aren’t finished products so it’s best to stay with the releases.
You’re going to want to remember what compiler you used for step 6.
Now go to the “Run” tab and hit “Create.” This should prompt you to pay with Metamask, which
you would accept. If you go back to the metamask extension, you will find that under the “Sent”
tab, there should be a transaction for “Contract Published.” Go to the transaction information,
and copy the address that the contract is being sent to. Keep this page open, it will also come in
handy for step 6. If you go back to the metamask “Tokens” tab, you will be able to add your
token by pasting the address you just copied into the “Token Contract Address.” The info for the
symbol and the decimals should automatically fill out.
And just like that, your very first crypto is born! You can send it to people by going on
MyEtherWallet. Metamask does not currently have a way to send ERC20’s via the extension, so
you can go to https://www.myetherwallet.com and select Metamask as your wallet option. You
can “Add Custom Token” to show your personal token using the contract address from before.
6. Verification
Verification is important, especially when you deal with a legitimate business model.
Go back to the contract creation transaction page. Click on the contract address that you copied
earlier, and go to the “Contract Code” tab. You want to click on “Verify and Publish” in order to
verify your code as being true.
The next screen you’re brought to requires the Contract Address (Filled in), the Contract name,
the compiler, and optimization. The contract name is whatever your function’s name was in the
code. The compiler would be the version that you used in step 5. Turn off optimization. Then,
copy your source code into the text field that says “Enter the Solidity Contract Code below.” The
rest of the text fields you can ignore. If done correctly, your code should be verified.
7. Verified on Etherscan
To verify your coin, you need to go to https://etherscan.io/contactus and select option 4. Once
you fill out the information, you can send it to them and let them verify it. The main 4 elements
you will need are the Contract address, the Official site URL (your own website), a logo, and a
contact email address.
This step is only if you want to go further in making your project grow.