LogoLogo
  • Kite AI Docs
  • Core Concepts
  • Core ideas and workflow
  • Use cases
  • Kite AI Testnet tools
  • Building smart contract on KiteAI
    • Counter Smart contract
    • Voting Smart contract
  • Sample dApps built on KiteAI
    • Counter dApp
    • Voting dApp
    • Token Minter
  • Smart contracts list
  • Community and Ecosystem
  • FAQs
Powered by GitBook
On this page
  • Deploying an ERC-20 Token on the KiteAI Testnet
  • Overview
  • Understanding the KiteAI Network
  • What You Will Do
  • What You Will Need
  • Understanding ERC-20 Token?
  • Method 1: Deploying via Remix IDE
  • Method 2: Deploying via Foundry
  • Conclusion
  1. Sample dApps built on KiteAI

Token Minter

PreviousVoting dAppNextSmart contracts list

Last updated 1 day ago

Deploying an ERC-20 Token on the KiteAI Testnet

Overview

This guide provides a comprehensive walkthrough for deploying an ERC-20 token on the KiteAI Testnet. It covers two primary methods:

  1. Remix IDE: A beginner-friendly, browser-based approach.

  2. Foundry: A command-line toolchain suitable for advanced users.

Before diving into the deployment steps, it's essential to understand the KiteAI network and the significance of deploying on this platform.


Understanding the KiteAI Network

What is KiteAI?

KiteAI is an EVM-compatible L1 blockchain designed to empower decentralized AI economies using, powered by Proof of AI (PoAI). This innovative consensus mechanism that ensures fair attribution and transparent rewards for contributors across agents, models, and data.

Key Features:

  • Chain ID: 2368 (0x940)

  • Native Currency: KITE

  • Block Gas Limit: 400,000,000

  • Testnet Faucet:

  • Network Addition:

Why Deploy on KiteAI?

Deploying on the KiteAI network allows developers to:

  • Test and validate smart contracts in an AI-enhanced environment.

  • Participate in a forward-thinking ecosystem that combines blockchain and AI technologies.


What You Will Do

  • Create an ERC-20 token smart contract using OpenZeppelin's standard implementation.

  • Deploy the contract to the KiteAI Testnet using:

    • Remix IDE (beginner-friendly)

    • Foundry (advanced CLI tool)


What You Will Need

  • A Web3 wallet (e.g., MetaMask)

  • Basic knowledge of Solidity and smart contract development.


Understanding ERC-20 Token?

An ERC-20 token is a standardized smart contract on Ethereum and EVM-compatible blockchains that defines a set of rules for fungible tokens. These rules include how tokens are transferred, how users can access data about a token, and the total supply of tokens.

Key Functions:

  • totalSupply(): Returns the total token supply.

  • balanceOf(address): Returns the account balance of another account with address address.

  • transfer(address, uint256): Transfers amount of tokens to address recipient.

  • approve(address, uint256): Allows spender to withdraw from your account multiple times, up to the amount.

  • transferFrom(address, address, uint256): Transfers amount tokens from address sender to address recipient.

  • allowance(address, address): Returns the amount which spender is still allowed to withdraw from the owner.


Method 1: Deploying via Remix IDE

Step 1: Add KiteAI Testnet to MetaMask

  1. Connect your MetaMask wallet.

  2. Add the KiteAI Testnet to your networks.

Step 2: Obtain Test Kite Tokens

  1. Connect your MetaMask wallet.

  2. Request 0.5 Kite tokens.

Step 3: Write the Smart Contract

  1. Create a new file named ”MyToken.sol”.

Paste the following code:

// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { constructor(uint256 initialSupply) ERC20("MyToken", "MTK") { _mint(msg.sender, initialSupply); } }

  1. This contract uses OpenZeppelin's ERC-20 implementation to create a token named "MyToken" with the symbol "MTK".

Step 4: Compile the Contract

  1. Navigate to the "Solidity Compiler" tab in Remix.

  2. Ensure the compiler version is set to 0.8.20 or higher.

  3. Click "Compile MyToken.sol".

Step 5: Deploy the Contract

  1. Go to the "Deploy & Run Transactions" tab.

  2. Set the environment to "Injected Provider - MetaMask".

  3. Ensure MetaMask is connected to the KiteAI Testnet.

  4. Enter the initial supply (e.g., 1000000 for 1 million tokens).

  5. Click "Deploy".

  6. Confirm the transaction in MetaMask.

Once deployed, your ERC-20 token will be live on the KiteAI Testnet.


Method 2: Deploying via Foundry

Step 1: Install Foundry

If you haven't installed Foundry:

curl -L https://foundry.paradigm.xyz | bash foundryup

Step 2: Initialize the Project

forge init MyTokenProject cd MyTokenProject

Step 3: Install OpenZeppelin Contracts

forge install OpenZeppelin/openzeppelin-contracts

Step 4: Configure Remappings

In foundry.toml, add:

[profile.default] remappings = ["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/"]

Step 5: Write the Smart Contract

Create a new file at src/MyToken.sol:

// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { constructor(uint256 initialSupply) ERC20("MyToken", "MTK") { _mint(msg.sender, initialSupply); } }

Step 6: Create Deployment Script

Create a new file at script/Deploy.s.sol:

// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "forge-std/Script.sol"; import "../src/MyToken.sol"; contract DeployScript is Script { function run() external { vm.startBroadcast(); new MyToken(1000000 * 10 ** 18); vm.stopBroadcast(); } }

Step 7: Set Environment Variables

Create a .env file in the root directory:

PRIVATE_KEY=your_private_key RPC_URL=https://rpc-testnet.gokite.ai

Replace your_private_key with your wallet's private key that holds Kite tokens.

Step 8: Build and Deploy

source .env forge build forge script script/Deploy.s.sol:DeployScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

After deployment, Foundry will provide the contract address and transaction details.


Conclusion

Deploying an ERC-20 token on the KiteAI Testnet is straightforward using either Remix IDE or Foundry. By following this guide, developers can:

  • Understand the KiteAI network and its unique features.

  • Write and deploy ERC-20 tokens efficiently.

  • Choose the deployment method that best suits their experience level.

For further exploration, consider integrating additional functionalities into your token, such as minting, burning, or pausing transfers, using OpenZeppelin's extensive library of smart contract modules.

Test Kite tokens (claim from )

Access to the KiteAI Testnet via MetaMask. (via )

Visit .

Visit the .

Open .

https://faucet.gokite.ai/
Chainlist - KiteAI Testnet
faucet.gokite.ai
Chainlist
Chainlist - KiteAI Testnet
KiteAI Faucet
Remix IDE