How to Create a Token on Polygon (The Easy Way)

Опубликовано: 24 Июль 2026
на канале: Dev Oskii
755
15

Get help / consulting from me:
☕ https://www.buymeacoffee.com/oskii

How to create a token on polygon. This is a tutorial about how to deploy an ERC20 token to the polygon network. You can deploy your own cryptocurrency to polygon using truffle by following this guide. By the end of this guide you will have created your own ERC20 token on the polygon network.

Put this at the top of your truffle config file:
const HDWalletProvider = require('@truffle/hdwallet-provider');

Commands / Installations:
Install VSCode
Install WSL
npm install truffle
truffle init
npm install @openzeppelin/contracts
npm install @truffle/hdwallet-provider

How to connect your metamask wallet to polygon:
https://umbria.network/connect/polygon

How to install WSL:
https://docs.microsoft.com/en-us/wind...

How to install VScode:
https://code.visualstudio.com/

How to download Metamask:
https://metamask.io/

Contract code:

pragma solidity ^0.8.12;

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

/**
@title TanganyTestToken
@dev Very simple ERC20 Token example, where all 10000 tokens are pre-assigned to the creator.
*/
contract MyToken is ERC20PresetFixedSupply {
/**
@dev Constructor that gives msg.sender all of existing tokens.
*/

uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(18)); // Initially Mint 10000 tokens

uint256 public constant MINTED_SUPPLY = 10000 * (10 ** uint256(18)); // Then Mint another 10000 tokens

constructor () public ERC20PresetFixedSupply("MyToken", "MT", INITIAL_SUPPLY, msg.sender) {
_mint(msg.sender, MINTED_SUPPLY);
}
}