Skip to main content
Tutorial
Beginner

How to create your own cryptocurrency (ERC20)

In this tutorial, we will create your own token. The mintable 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
  • initialSupply: The initial amount of tokens that will 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_MINT_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)
})

Congrats on deploying your smart contract.

Process your first token transfer

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:

January 31, 2024

Reading time:

4 min


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