Tatum
Search…
How to create an ERC-20 token
Create your own token in one simple step.
An ERC-20 token is a standardized smart contract with a predefined set of features. It represents fungible tokens, which can be interchanged. The ERC-20 token is used as a blockchain representation of the currency.
To create your own ERC-20 token, you need to deploy a smart contract. Creating your own smart contract is not easy at all. As a developer, you must do a few things:
    Solidity - you have to be able to write smart contracts in Solidity or the smart contract programming language used by the given blockchain.
    Run the Solidity compiler
    Run the Solidity development IDE
    Deploy the compiled Smart Contract
It is a lot to know. For developers who only need the basic features of ERC-20 tokens, Tatum offers ready-to-go, standardized ERC-20 smart contracts that can be deployed on the following blockchains:
    Ethereum
    Polygon (Matic)
    Celo
    Harmony.ONE
    Flow
    Tron
    Binance Smart Chain
Feel free to check out the source code to our ERC-20 smart contract on GitHub.

Deploying an ERC-20 Smart Contract

To create and deploy an ERC-20 token using Tatum, all you need is one simple API call. This API call deploys a standard, validated ERC-20 Smart Contract to the Ethereum blockchain. The required parameters are the name and symbol of the deployed token, the initial supply of the tokens, and the recipient address where the initial supply will be transferred.
Securely signing transactions
In this guide, we are signing transactions with a private key via API. This is fine for testing and demo purposes, but should not be used for production purposes. Your private keys and mnemonics should never leave your security perimeter. To correctly and securely sign a transaction you can use Tatum CLI from the command line, a specific language library like Tatum JS, the local middleware API, or our complex key management system, Tatum KMS.
Request
Response
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/blockchain/token/deploy' \
2
--header 'x-api-key: YOUR_API_KEY' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"symbol": "SMBL",
6
"chain": "ETH",
7
"name": "DemoToken",
8
"supply": "10000000",
9
"digits": 18,
10
"address": "0x28cbeb0681bca9a07165c98cdb05051Fdf7Dc3F3",
11
"fromPrivateKey": "0xd3d46d51fa3780cd952821498951e07307dfcfbbf2937d1c54123d6582032fa6"
12
}'
Copied!
1
{
2
"txId": "0x75808516abfb2fa4e44fd2fc85863d15e11bdc3f90769962e3f34d7a17df4f0f"
3
}
Copied!

Getting the details of the blockchain transaction

The response is the transaction ID, from which the created token address can be obtained. You can see the property contractAddress, which is the address of the ERC-20 token.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/blockchain/sc/address/ETH/0x75808516abfb2fa4e44fd2fc85863d15e11bdc3f90769962e3f34d7a17df4f0f' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
{
2
"contractAddress": "0x316e52b83c66E8FB3936bdc2C8Ed8437441774cE"
3
}
Copied!

Transferring ERC-20 tokens to another blockchain address

To transfer the tokens from the address where they were issued to another blockchain address, you can use the Transfer ERC20 token endpoint from the Fungible Token section. You need the private key of the address where tokens are located (address from the first call where the initial supply is distributed).
Request
Response
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/blockchain/token/transaction' \
2
--header 'x-api-key: YOUR_API_KEY' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"chain": "ETH",
6
"to": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
7
"amount": "50000",
8
"contractAddress": "0x316e52b83c66E8FB3936bdc2C8Ed8437441774cE",
9
"digits": 18,
10
"fromPrivateKey": "0xd3d46d51fa3780cd952821498951e07307dfcfbbf2937d1c54123d6582032fa6"
11
}'
Copied!
1
{
2
"txId": "0xc330005e40aa36b1256f6629ebbf8c0a1b73bf1b517ed4fecf862d422b190ec3"
3
}
Copied!
And the response is again the transaction ID of the tokens.
That wasn't too bad at all, right? With just three calls to Tatum, you were able to deploy your own token and transfer it. You don't have to install anything, learn Solidity, etc.
To find out more about the API calls we have just used, visit our API Reference.
Last modified 1mo ago