Create token contract
This guide explains how you can create an ERC20 smart contract on the blockchain.
What is an ERC20 token contract?
An ERC-20 smart contract is like a set of rules for creating digital tokens on the Ethereum blockchain. These rules make sure that tokens work smoothly with different apps, wallets, and platforms.
Think of it as a blueprint ensuring the tokens can be easily traded, stored, and used across the Ethereum network. This standard helps developers create new tokens that everyone can trust and use without worrying about compatibility issues.
Use cases
- Create new cryptocurrencies for trading and payments.
- Facilitate fundraising through Initial Coin Offerings (ICOs).
- Issue stablecoins that maintain a fixed value.
- Power digital loyalty and reward programs for businesses.
- Serve as in-game currencies in blockchain-based games.
Create ERC20 token contract
Let's start by defining your first contract. We will create a contract on the MATIC testnet chain.
Request Endpoint: reference
POST /api/v3/erc20/contracts/deployments
Request Body:
Parameter | Description | Type | Required |
---|---|---|---|
chain | This is the blockchain on which you want to create the token contract on | String | ✅ |
name | The name of your token contract | String | ✅ |
symbol | The symbol for your token contract | String | ❌ |
maxSupply | The maximum amount of tokens allowed to be minted | Integer | ❌ |
burnable | Indication whether the tokens will be burnable or not. Burning tokens is the act of sending tokens to a wallet that cannot be accessed | Boolean | ❌ |
owner | The wallet address who will be the owner of this token contract. The owner will have admin rights on the token contract | String | ❌ |
{
"chain": "MATIC",
"name": "Infinity Token",
"symbol": "IFT",
"maxSupply": "100",
"burnable": "true",
"owner": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9"
}
Response Body:
- Save the
result.id
from the response body. This is the deployment ID and it is used to check the status of the contract creation request.- The
transactionHash
that is returned is the transction that created the contract on-chain.- The
status
attribute indicates if the transaction has been mined yet.
{
"success": true,
"result": {
"id": "7eae57cb-6769-4a2a-84c8-32e72f0aaee7",
"chain": "MATIC",
"name": "Infinity Token",
"symbol": "IFT",
"maxSupply": 100,
"burnable": true,
"owner": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9",
"transactionHash": "0x7dd053caa4a77f84d70c38478bc14dd25766765d018740b0633eabf3b1307c6d",
"status": "PENDING"
}
}
Updated 17 days ago