In this project we had to build a custom token using Solidity and deploy it to Avalanche Fuji Testnet using Hardhat.
- Make sure you have a Web3 wallet such as Metamask.
- Visit a Avalanche Fuji Testnet faucet to recieve tokens in your wallet, which will be used to pay the transaction fee
npm i
WALLET_PRIVATE_KEY="YOUR PRIVATE KEY"
SNOWTRACE_API_KEY="YOUR API KEY"
FORK_FUJI = true // if you wish to fork the testnet, else false
FORK_MAINNET = true // if you wish to fork the mainnet, else false
// Replace "SELECTED_NETWORK" with either fuji or mainnet
npx hardhat run --network "SELECTED_NETWORK" scripts/deploy.js
After the script executes successfully, the contract will be deployed on the selected net, and the address of the token would be printed.
You can verify the Token creation on Snowtrace by pasting its address.
To interact with the token, we'll be using Remix IDE
- Open Remix IDE on a browser
- Upload the same contract and press Ctrl+S to save and compile it
- In the deploy tab, set the environment to Injected Provider
- Approve the connection to your Web3 wallet, and the IDE will be connected to the net, and account will be loaded automatically.
- Paste your token address and click At Address. This will load up the contract, and you will be able to interact with it.