Launch a token
This page is a guide on how to create your custom ERC20 token on Specular.
Table of contents
Deploy an ERC20 demo
Add it to the Token List
Add liquidity to the DEX
Launch a Token
To launch a token on the Specular network using Hardhat, follow these steps:
Prerequisites
Ensure you have the following prerequisites:
JavaScript knowledge.
Node.js and NPM/Yarn installed on your computer.
Rust installed.
Foundry installed.
Get started
Initialize a new Foundry project with the following command:
This creates a new project named deploy_erc20
.
Write the ERC20 contract
Write your ERC20 token contract. For example:
Build
Compile your contracts using the following command:
This command compiles your contracts located in the src
folder and generates a new out
folder where all the compiled contract artifacts reside.
Test
Execute your Solidity test files located under the test
folder to ensure your smart contract functions as intended:
Deploy your token
Export your private key as a variable:
Deploy your token contract to the Specular network using the following command:
Replace <YOUR_PRIVATE_KEY>
with your actual private key. Ensure that you keep your private key secure and never share it publicly.
Upon successful deployment, you'll receive the address your contract is deployed to and the transaction hash.
Congratulations! You've successfully launched your token on the Specular network using Hardhat and Foundry.
Last updated