fbpx

Earn $10 in MATIC

Polygon for Builders

Learn how to create tokens and NFTs on Polygon, a side-chain of Ethereum and earn free MATIC tokens.

Lesson 5

• 5 mins

Create a Token

This guide will teach you how to create an ERC20 token on the Polygon network.

The first step is to get a polygon node. You can get a Polygon node through Moralis.io. Moralis is a leading Web3 development platform for building high-performance dapps. 

Go to the speedy nodes tab and add both the mainnet endpoints and the Mumbai testnet to your Metamask.

The second step is to get some test tokens. Test token is needed to pay transaction fees on the network. You can get testnet token from this faucet:  https://faucet.polygon.technology/

The third step is to program your own smart contract. Head to https://remix.ethereum.org. Remix is an open-source web and desktop application that has a rich set of plugins with intuitive GUIs. 

An ERC20 token is also a Smart Contract and there are plenty of templates available for use on Remix.

On the left tab of Remix, right-click on contracts and then add a new file. For this tutorial can just name it Token.sol.

We will use the OpenZeppelin contracts in Remix because all the smart contracts from OpenZeppelin are secure and battle tested.

The fourth step is to paste the following code on the Token.sol file:

// SPDX-License-Identifier: MIT
 
pragma solidity ^0.8.0;
 
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
 
contract EnratsToken is ERC20 {
   uint256 constant _initial_supply = 100 * (10**18);
 
   constructor() ERC20("Enrats Token", "ERT") {
       _mint(msg.sender, _initial_supply);
   }
}

Step five is to flatten and save the contract. Flattening the smart contract will combine all Solidity code into one file.

Step 6 is to copy the License to the flattened .sol file and then paste it onto the flattened file. 

// SPDX-License-Identifier: MIT

Last but not least, it’s time to deploy the Smart Contract.

Once the Smart Contract has been successfully deployed, it can be verified on Remix itself and on Polygonscan.

It’s just that simple! Next up, let’s learn about Cross-Chain tokens.

Join Our Mailing List

Subscribe to get the latest updates on crypto education and resources.

Research Reports
Cryptocurrency

Into the Metaverse – A Comprehensive Report

Cryptocurrency

Avalanche: Scaling Towards Digitizing the World’s Assets in a Decentralized Manner

Beginner's Guide
Protocols
DeFi
Learn & Earn Crypto

Earn $5 in BTC

BTC

Learn the basics of cryptocurrency and how to protect yourself from crypto scams with this 6-part beginner-friendly course, created in collaboration with Luno Discover.

Earn $5 in USDC

USDC

Not sure what to do with your crypto? It’s time to learn some popular strategies for investing.

Notable Trending Projects
Polygon Bridge & Staking
(MATIC)
$0.4790
5.13% 24H
-19.27% 7D
Voyager
(VGX)
$0.2647
3.35% 24H
-31.23% 7D
Synthetix
(SNX)
$2.7019
15.14% 24H
-6.88% 7D
Octopus Network
(OCT)
$0.3367
0.46% 24H
-7.32% 7D
Bastion Protocol
(BSTN)
$0.0033
0.00% 24H
-30.33% 7D

About Us

Crypto and blockchain have changed one of the most important aspects of the world: money.

Chain Debrief aims to inform, educate, and connect the global investment community through our crypto guides, news, analyses, and opinion pieces.

What can we help you find?