News

What are Ethereum Tokens and How Can You Make Your Own?

Lincoln Murr

Summary: Ethereum tokens are the backbone of the decentralized finance ecosystem, and may one day be the backbone of the global financial system, however are widely misunderstood. Let’s look at what exactly a token is and how anyone can create their own with zero programming experience. When Ethereum was released in 2015, one of its most ...

Ethereum tokens are the backbone of the decentralized finance ecosystem, and may one day be the backbone of the global financial system, however are widely misunderstood. Let’s look at what exactly a token is and how anyone can create their own with zero programming experience.

When Ethereum was released in 2015, one of its most revolutionary features was the ability to create and publish smart contracts on its blockchain. For context, traditional contacts are written in regular language and enforced by the laws of a specific country. This means that people engaging in contracts trust that the legal system and the country they reside in will protect them in the case that one party in the contract does not hold up their end of the deal. 

1650923747501561.png

On the other hand, smart contracts are written in code and have self-executing properties, meaning that the correct outcome will always occur if it is programmed correctly. So even if one of the parties engaged in the contract tries to act maliciously, they will be unable to and the contract will execute as intended. There are limitless possibilities for smart contracts and how they can make business, finance, and other industries more efficient, trustless, and secure.

One of the most common uses of smart contracts is to create cryptocurrencies. For example, someone could create a smart contract, and in the code of that smart contract they could write a line that makes them the owner of 100 XYZ coins. When this is published to the blockchain, it will also be published that the owner has given themself 100 XYZ coins. Even though this person simply made up this coin and it has no value, they could now use it for many different applications, like trading with friends, holding as a collector’s item, or even create a company and give out the coin like they are shares in the company. In fact, this is similar to the goal of company tZERO, who are trying to tokenize shares of companies so that they can be traded and exchanged on the blockchain.

1650923853978700.png

Many of the largest cryptocurrencies either started or are still tokens on Ethereum. For example, Tron was only a token on Ethereum’s blockchain until their own mainnet went live. Other examples of tokens include Chainlink, all stablecoins, Shiba Inu, and FTX Token.

Now that we know a bit about tokens and their history, let’s learn how to create our own with no coding experience required.

The first step is to download and setup a MetaMask Wallet. This can be done at https://metamask.io/. MetaMask is a browser-based Ethereum wallet that allows us to interact with the blockchain. When going through the setup process, make sure to write down your private key, as it is the only way to access your wallet if you lose your computer. When the setup is done, your MetaMask should look something like this:

Screenshot 2022-04-25 164127.png

Next, change the network to the Ropsten testnet. Since everything put on the Ethereum blockchain is final and has economic implications, there are test networks where developers can deploy smart contracts with a free version of Etheruem. To do this, click the “Ethereum Mainnet” button at the top of MetaMask, click “show/hide test networks,” and choose the Ropsten testnet.

Now we need to get some of the free Ethereum to use to create a token. To do that, go to https://faucet.dimensions.network/, enter your Ethereum address, and wait 5-10 minutes for the Ethereum to show up in your wallet.

Now, we are ready to code! To start, head to https://remix.ethereum.org, which is an online developer environment for creating and publishing smart contracts. Then, click the “create new file” icon immediately above the contracts folder, and name it “TokenName.sol.” To get the token created, copy and paste the following code in:

//SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.4.22<0.9.0;

 

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

 

contract TestCoin is ERC20 {

    constructor() ERC20("TestCoin", "TEST")  {

        _mint(msg.sender, 100000000000000000000000000);

    }

}

You can change the name from “TestCoin” and “TEST” to whatever you like, as well as modifying the initial supply, which is the large number next to the “mint” function.

Finally, hit control + s on your keyboard to save and compile the code, then click the icon on the side of the screen to open the deployer.

Screenshot 2022-04-25 164828.png

Here, change the environment from JavaScript VM (London) to Injected Web3, and connect your MetaMask when prompted. The final step is to choose the contract you just created from the ‘Contract’ drop-down menu and click deploy.

Now, if you go to https://ropsten.etherscan.io, and search for your address, you will now be able to see your new tokens in your account, and you can do whatever you want with them. Congratulations!

By Lincoln Murr

Last Update:

Tags: ,,,,
Link: What are Ethereum Tokens and How Can You Make Your Own?   [Copy]
  • Ethereum All Core Developers Execution Call #192 Writeup 2 days ago
  • The Product Gap in Blockchain: Shifting Focus from Infrastructure to User-Centric Appli... 4 days ago
  • What Would a Trump Presidency Mean for Bitcoin? 5 days ago
  • Google’s move on Wiz: a cybersecurity game-changer, or another pointless splurge? 7 days ago
  • The Risks and Rewards of Staking 7 days ago
  • You need to login to comment.