Skip to main content
Tutorial
Beginner

How to create your own limited supply token (ERC20)

In this tutorial, we will create your own token. The fixed supply version of this standard guarantees no token will ever be created after the initial emission. Fungible tokens are token from which the value of each token is equal to another.

You will need:

  • a wallet address with funds: You can use your default Starton wallet, at creation Starton provides you with faucets.
  • definitiveName: The name of your smart contract which will be reflected on-chain.
  • definitiveSymbol: The symbol of your smart contract which will be reflected on-chain
  • definitiveSupply: The total amount of tokens that will ever be minted.
  • initialOwnerOrMultisigContract: The address that will own the ERC20 contract.

In this tutorial, we will:

Deploying the Smart contract from our template

const axios = require("axios")

const axiosInstance = axios.create({
baseURL: "https://api.starton.com",
headers: {
"x-api-key": "PUT HERE YOUR API KEY",
},
})

axiosInstance
.post("/v3/smart-contract/from-template", {
network: "", // The blockchain network on which you want to deploy your smart contract
signerWallet: "", // The address of the signer wallet
templateId: "ERC20_META_TRANSACTION",
name: "", // The name of the contract on Starton
description: "", // The description of the contract on Starton
params: [
"", // The name of your smart contract which will be reflected on-chain.
"", // The symbol of your smart contract which will be reflected on-chain
"", // The total amount of tokens that will ever be minted.
"", // The address that will own the ERC20 contract.
],
})
.then((response) => {
console.log(response.data)
})

Transferring your first token

You will need the following information:

  • Wallet: the signer wallet
  • To: the wallet receiving your transfer
  • Amount: amount to transfer
const axios = require("axios")

const axiosInstance = axios.create({
baseURL: "https://api.starton.com",
headers: {
"x-api-key": "PUT HERE YOUR API KEY",
},
})

axiosInstance
.post("/v3/smart-contract/YOUR_SMART_CONTRACT_NETWORK/YOUR_SMART_CONTRACT_ADDRESS/call", {
functionName: "transfer(address,uint256)",
params: [
"", // Enter the wallet receiving tokens.
"", //amount of token transferred
],
signerWallet: "", // Enter the wallet from which tokens will be transferred.
speed: "average",
})
.then((response) => {
console.log(response.data)
})

Congratulations! You've transferred your first token.

Loubna Benzaama

Lead technical writer


Created:

April 3, 2024

Reading time:

4 min


Content
  • Deploying the Smart contract from our template
  • Transferring your first token