DeFi Daily News
Tuesday, June 17, 2025
Advertisement
  • Cryptocurrency
    • Bitcoin
    • Ethereum
    • Altcoins
    • DeFi-IRA
  • DeFi
    • NFT
    • Metaverse
    • Web 3
  • Finance
    • Business Finance
    • Personal Finance
  • Markets
    • Crypto Market
    • Stock Market
    • Analysis
  • Other News
    • World & US
    • Politics
    • Entertainment
    • Tech
    • Sports
    • Health
  • Videos
No Result
View All Result
DeFi Daily News
  • Cryptocurrency
    • Bitcoin
    • Ethereum
    • Altcoins
    • DeFi-IRA
  • DeFi
    • NFT
    • Metaverse
    • Web 3
  • Finance
    • Business Finance
    • Personal Finance
  • Markets
    • Crypto Market
    • Stock Market
    • Analysis
  • Other News
    • World & US
    • Politics
    • Entertainment
    • Tech
    • Sports
    • Health
  • Videos
No Result
View All Result
DeFi Daily News
No Result
View All Result
Home DeFi Web 3

Creating an ERC-20 Token Using Base and Interchain Token Service in 5 Simple Steps – Moralis Web3 | Advanced Web3 APIs

David Olsson by David Olsson
July 18, 2024
in Web 3
0 0
0
Creating an ERC-20 Token Using Base and Interchain Token Service in 5 Simple Steps – Moralis Web3 | Advanced Web3 APIs
0
SHARES
0
VIEWS
Share on FacebookShare on TwitterShare on Telegram
Listen to this article

This step-by-step guide will teach you how to mint a multichain ERC-20 token on the Base network using Axelar’s Interchain Token Service (ITS) and use the Moralis Token API to easily retrieve token balances.

Step 1: Prerequisites

You will need:

Step 2: Set up a new project and required ABIs

In this step, you will need to create a new project and set up the required ABIs to interact with ITS and mint your ERC-20 token on the Base network.

Open your terminal and navigate to any directory of your choice. Run the following commands to create and initiate a project:

mkdir mint-token && cd mint-token
npm init -y

Install Hardhat and Moralis

Install Hardhat and Moralis with the following commands:

npm install –save-dev @nomiclabs/hardhat-ethers ethers moralis

Set up project ABIs

Next, set up the ABI for the Interchain Token Factory as it will be needed during deployment. Create a new file called interchainTokenFactoryABI.json and add the Interchain Token Factory ABI.

Create an .env file

To make sure you’re not accidentally publishing your private key, create an .env file to store it in:

touch .env

Add your private key to .env

Export your private key and add it to the .env file you just created:

PRIVATE_KEY= // Add your account private key here

💡 If you will push this project on GitHub, create a .gitignore file and include .env.

Step 3: Set up the remote procedure call (RPC)

Next, you’ll need to set up the RPC. Navigate to the directory where you installed Hardhat and run the following command:

npx hardhat init

Select “Create an empty hardhat.config.js” with your keyboard and hit enter.

Next, update hardhat.config.js with the following code snippet:

/** @type import(‘hardhat/config’).HardhatUserConfig */
require(“@nomiclabs/hardhat-ethers”);
require(“dotenv”).config({ path: “.env” });

const PRIVATE_KEY = process.env.PRIVATE_KEY;

/** @type import(‘hardhat/config’).HardhatUserConfig */
module.exports = {
solidity: “0.8.19”,
networks: {
base: {
url: “<https://base-sepolia-rpc.publicnode.com>”,
chainId: 84532,
accounts: [PRIVATE_KEY],
},
},
};

Hardhat runs by locating the nearest hardhat.config.js from the current directory, typically found at the root of your project. Even an empty hardhat.config.js allows Hardhat to function, as your entire setup is housed in this file.

Step 4: Mint an ERC-20 token with ITS

Now that you’ve set up a Base Sepolia testnet RPC, you can mint a multichain ERC-20 token. For this tutorial, you will create a token using the following information:

Name: My New Token
Symbol: MNT
Decimals: 18

Create a new file named script.js. Import the necessary dependencies:

  • Ethers.js
  • Moralis
  • The contract ABI
  • The InterchainTokenFactory contract address
  • Your token information

Create a mintToken() function

Create a mintToken() function for minting a new token on the Base Sepolia testnet:

Add a main() function

Add a main() function for executing script.js. It will handle any errors that may arise:

Run script.js to deploy your token to the Base Sepolia testnet

Run the script in your terminal to create and mint the token, specifying the Base Sepolia testnet:

Step 5: Check the minted token balance with the Moralis API

Now that you have successfully minted your new token, it’s time to retrieve the balance.

Add the Moralis API key to .env

Get your token balance

Add the following in the script.js file:

Update main() to get the token balance

Update main() to execute getBalance() :

Run the script in your terminal to retrieve your token:

Summary

The tutorial provides a step-by-step guide on minting a multichain ERC-20 token on the Base Sepolia network using Axelar’s Interchain Token Service (ITS). The process involves setting up prerequisites, creating a new project and ABIs, setting up a remote procedure call (RPC), minting the ERC-20 token with ITS, and checking the minted token balance with the Moralis API.

References

Now that you know how to mint a multichain token, check out the following:

For more trending news articles like this, visit DeFi Daily News

Conclusion: A Dive into the World of Multichain ERC-20 Tokens

Congratulations! You have successfully navigated the intricate process of minting a multichain ERC-20 token on the Base Sepolia network. By following the detailed steps outlined in this guide, you have not only gained valuable insights into the interplay of various technologies such as Axelar’s Interchain Token Service (ITS) and the Moralis Token API but also honed your skills in setting up projects, interacting with ABIs, and deploying smart contracts.

As you embark on your journey in the realm of decentralized finance (DeFi), the ability to mint custom tokens on multiple chains opens up a world of possibilities. Whether you aim to create a unique digital asset, facilitate cross-chain interactions, or explore innovative use cases, mastering the art of creating multichain ERC-20 tokens equips you with a powerful tool in the ever-evolving landscape of blockchain technology.

Remember, the potential of DeFi extends far beyond token minting. Stay informed, stay curious, and keep exploring the latest developments in the decentralized finance space. For a daily dose of DeFi news, don’t forget to visit DeFi Daily News for captivating insights, trending articles, and expert analyses that will fuel your passion for the decentralized future.



Source link

Tags: AdvancedAPIsBaseCreatingERC20InterchainMoralisServicesimpleStepstokenWeb3
ShareTweetShare
Previous Post

This year’s summer rally has gotten healthier, says Bank of America’s Stephen Suttmeier

Next Post

“I Don’t Know How I’m Going To Pay This Stuff Off”

Next Post
“I Don’t Know How I’m Going To Pay This Stuff Off”

“I Don’t Know How I’m Going To Pay This Stuff Off”

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
  • Trending
  • Comments
  • Latest
Changelly Collaborates with BRLA Digital and Announces Zero-Fee Campaign – Cryptocurrency Insights & Trading Guidance on Changelly’s Blog

Changelly Collaborates with BRLA Digital and Announces Zero-Fee Campaign – Cryptocurrency Insights & Trading Guidance on Changelly’s Blog

July 25, 2024
I Built The DREAM Office Setup!

I Built The DREAM Office Setup!

November 30, 2024
rewrite this title with good SEO Bitcoin Could Explode On Bessent’s 0 Billion Deregulation Shock

rewrite this title with good SEO Bitcoin Could Explode On Bessent’s $250 Billion Deregulation Shock

May 28, 2025
Rough N’ Rowdy 25 FREE PREVIEW | Watch 20 Fights + Ring Girl Contest TONIGHT

Rough N’ Rowdy 25 FREE PREVIEW | Watch 20 Fights + Ring Girl Contest TONIGHT

August 9, 2024
rewrite this title All 20 Premier League clubs ranked by their 2024/25 wage bill

rewrite this title All 20 Premier League clubs ranked by their 2024/25 wage bill

February 8, 2025
My Ex-Wife and Baby Momma Are Now Buddies (Half My Income Goes Towards Legal Debt)

My Ex-Wife and Baby Momma Are Now Buddies (Half My Income Goes Towards Legal Debt)

June 15, 2025
rewrite this title and make it good for SEOJD.Com: Hidden Value In A Fragile Environment (NASDAQ:JD)

rewrite this title and make it good for SEOJD.Com: Hidden Value In A Fragile Environment (NASDAQ:JD)

June 17, 2025
rewrite this title Grammarly Taps Gr4vy to Power Modular, Scalable Payments – Finovate

rewrite this title Grammarly Taps Gr4vy to Power Modular, Scalable Payments – Finovate

June 17, 2025
rewrite this title with good SEO BBVA Tells Wealthy Clients To Invest Up To 7% In Bitcoin

rewrite this title with good SEO BBVA Tells Wealthy Clients To Invest Up To 7% In Bitcoin

June 17, 2025
rewrite this title Nasdaq-traded Chinese herb stock with no revenues rallies 58,000% to top Lululemon in market value

rewrite this title Nasdaq-traded Chinese herb stock with no revenues rallies 58,000% to top Lululemon in market value

June 17, 2025
My Mom Secretly Racked Up 6,000 Of Debt In My Name and Ruined My Credit Score

My Mom Secretly Racked Up $186,000 Of Debt In My Name and Ruined My Credit Score

June 17, 2025
rewrite this title XRP Must Complete Right Shoulder Before Takeoff—But How Low First?

rewrite this title XRP Must Complete Right Shoulder Before Takeoff—But How Low First?

June 17, 2025
DeFi Daily

Stay updated with DeFi Daily, your trusted source for the latest news, insights, and analysis in finance and cryptocurrency. Explore breaking news, expert analysis, market data, and educational resources to navigate the world of decentralized finance.

  • About Us
  • Blogs
  • DeFi-IRA | Learn More.
  • Advertise with Us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2024 Defi Daily.
Defi Daily is not responsible for the content of external sites.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Cryptocurrency
    • Bitcoin
    • Ethereum
    • Altcoins
    • DeFi-IRA
  • DeFi
    • NFT
    • Metaverse
    • Web 3
  • Finance
    • Business Finance
    • Personal Finance
  • Markets
    • Crypto Market
    • Stock Market
    • Analysis
  • Other News
    • World & US
    • Politics
    • Entertainment
    • Tech
    • Sports
    • Health
  • Videos

Copyright © 2024 Defi Daily.
Defi Daily is not responsible for the content of external sites.