How to create your own ERC20 token ?

Do repost and rate:

Didn't anyone think, one day, about making its own erc20 token ? I'll explain you how to make that here ! 

So, let's go !

 

1 - Requirements

If you want to deploy contract, you need to have METAMASK installed and some ether for transaction fees. Here, I will deploy my token on ropsten testnet so I won't have to pay txn fees.

If you doesn't know how to switch network (on metamask), look at this screenshot:

And if you want for test-ETH (ropsten), you can get some for free on the faucet

 

2 - Codebase

An erc20 depends on a smart contract so here I'll give u the base contract code !

Github link : https://github.com/ygboucherk/erc20-token-template/blob/main/token.sol

 

3 - Editing it for matching with your requirements (name, ticker...)

For editing and deploying token contract, you need to open it in Remix Ide (remix.ethereum.org).

Then, edit erc20 variables :

Important note : total supply should include decimals, so if total supply (without decimals) is 1000 and there's 8 decimals, total suppy with decimals is 1000*10^8 (= 100000000000)

Another important note : balances are treated as integers, so we add decimals for correctly placing the point on display (wallet, DEXes)

 

4 - Deploying it

First, connect IDE to metamask !

Then, deploy contract. Pay attention to select ERC20Token contract because of it's master contract ! 

 

And approve transaction (if u are on mainnet, be aware of gas fees) :

Now deployment is finished, and contract can be found here : 0x44ae185ffbee4299a206487789b2c64e2e3bec65

If you applied this tutorial, feel free of putting contract address (or block explorer link) in the comments :D

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость