Logo

How to Create a Token on peaq: A Step-by-Step Developer Guide

摘要

Learn how to create a token on the peaq network, the layer-1 blockchain for DePIN and the Machine Economy. This guide covers token standards, no-code tools like Bitbond's Token Tool, smart contract deployment, and essential RPC setup for interacting with peaq.

Token Creation Decision Checklist

Before you start, consider the following criteria to choose the best approach for your project:

CriterionWhat to checkWhy it matters
Token standardERC-20, ERC-721, or ERC-1400?Determines token functionality (fungible, non-fungible, or security token).
Technical skillCan you write Solidity?No-code tools are faster; custom contracts offer more flexibility.
Custom featuresNeed taxes, minting, burning, or whitelisting?Advanced features require custom code or a tool that supports them.
BudgetWhat are the gas fees on peaq?peaq offers low fees, but complex contracts cost more to deploy.
TimelineHow soon do you need the token live?No-code tools can deploy in minutes; custom development takes longer.
RPC reliabilityDo you have a reliable peaq RPC endpoint?A stable RPC ensures smooth deployment and interaction.

Understanding peaq and Its Token Standards

peaq is a Substrate-based blockchain that is EVM-compatible, meaning you can deploy Ethereum-standard tokens like ERC-20, ERC-721, and ERC-1400. The network is optimized for DePIN projects, offering high throughput (10,000 TPS at launch), low fees, and a Nakamoto coefficient of 130+. For token creation, you have two primary paths:

  • No-code token generators like Bitbond's Token Tool, which provide a user-friendly interface to configure and deploy tokens without writing Solidity.
  • Custom smart contract deployment using tools like Hardhat or Remix, giving you full control over token logic.

Prerequisites

Before creating a token, ensure you have:

  • A Web3 wallet (e.g., MetaMask) configured for the peaq network.
  • Sufficient PEAQ tokens to cover gas fees (for deployment and transactions).
  • A reliable peaq RPC endpoint. You can use OnFinality's public RPC or get a dedicated endpoint for production workloads. See peaq RPC Guide for connection details.
  • (Optional) Basic familiarity with Solidity if deploying a custom contract.

Step-by-Step: Creating a Token Using Bitbond's Token Tool

Bitbond's Token Tool is the most popular no-code solution for peaq. Follow these steps:

Step 1: Access Token Tool

Navigate to Token Tool on peaq.

Step 2: Connect Your Wallet

Click "Connect Wallet" and select MetaMask (or another Web3 provider). Ensure your wallet is set to the peaq network. If not, add peaq using the following RPC details:

  • Network Name: peaq
  • RPC URL: https://peaq.api.onfinality.io/public (or your own endpoint)
  • Chain ID: 3338
  • Symbol: PEAQ
  • Block Explorer: https://peaq.subscan.io

Step 3: Configure Token Details

Fill in the token parameters:

  • Token Name: e.g., "MyDePINToken"
  • Symbol: e.g., "MDT"
  • Initial Supply: e.g., 1000000
  • Decimals: 18 (standard)

Step 4: Advanced Settings (Optional)

You can enable features like:

  • Can Burn: Allow token holders to burn tokens.
  • Can Mint: Allow the owner to mint new tokens.
  • Set Total Supply Cap: Limit the maximum supply.
  • Charge Transaction Tax: Apply a fee on transfers.
  • Apply Burn Fee: Deflationary token mechanism.
  • Apply Holder Rewards: Reflection token feature.

Step 5: Review and Confirm

Check the estimated gas fee (displayed in PEAQ). Click "Create Token" and confirm the transaction in your wallet. Wait for confirmation (usually under a minute). Your token contract address will be shown upon success.

Step-by-Step: Deploying a Custom ERC-20 Token on peaq

For developers who need full control, here's how to deploy a custom token using Hardhat:

1. Set Up the Project

mkdir peaq-token
cd peaq-token
npm init -y
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npx hardhat init

2. Write the Smart Contract

Create contracts/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("MyDePINToken", "MDT") {
        _mint(msg.sender, initialSupply);
    }
}

3. Configure Hardhat for peaq

Edit hardhat.config.js:

require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.20",
  networks: {
    peaq: {
      url: "https://peaq.api.onfinality.io/public",
      accounts: ["YOUR_PRIVATE_KEY"]
    }
  }
};

4. Deploy the Contract

Create a deployment script scripts/deploy.js:

async function main() {
  const [deployer] = await ethers.getSigners();
  console.log("Deploying with account:", deployer.address);

  const MyToken = await ethers.getContractFactory("MyToken");
  const token = await MyToken.deploy(ethers.parseEther("1000000"));

  console.log("Token deployed to:", token.target);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Run:

npx hardhat run scripts/deploy.js --network peaq

Your token is now live on peaq.

Connecting to peaq via RPC

To interact with your token or the network, you need a reliable RPC endpoint. OnFinality provides both public and dedicated RPC services for peaq. Here's how to connect using JSON-RPC:

curl https://peaq.api.onfinality.io/public \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0",
    "method":"eth_blockNumber",
    "params":[],
    "id":1
  }'

For production applications, consider a dedicated node to avoid rate limits and ensure consistent performance.

Common Pitfalls and Troubleshooting

  • Insufficient gas: Ensure your wallet has enough PEAQ. peaq fees are low, but complex contracts may require more.
  • Wrong chain ID: Double-check that your wallet is set to peaq (chain ID 3338).
  • RPC errors: If you encounter timeouts, switch to a more reliable RPC provider like OnFinality.
  • Token not showing in wallet: Import the token contract address manually into your wallet.

Key Takeaways

  • peaq supports ERC-20, ERC-721, and ERC-1400 token standards via its EVM compatibility.
  • No-code tools like Bitbond's Token Tool enable token creation in minutes without coding.
  • For custom tokens, use Hardhat or Remix to deploy Solidity contracts.
  • Always use a reliable RPC endpoint for deployment and interaction. OnFinality offers public and dedicated peaq RPC services.
  • peaq's low fees and high throughput make it ideal for DePIN and machine economy projects.

Frequently Asked Questions

What is the peaq network?

peaq is a layer-1 blockchain designed for the Machine Economy and DePIN. It is EVM-compatible and built on Substrate, offering high scalability, low fees, and interoperability.

Can I create a token on peaq without coding?

Yes. Use Bitbond's Token Tool, a no-code token generator that lets you configure and deploy tokens in a few clicks.

What token standards are supported on peaq?

peaq supports ERC-20 (fungible tokens), ERC-721 (NFTs), and ERC-1400 (security tokens) via its EVM compatibility.

How much does it cost to create a token on peaq?

The cost is the gas fee for deploying the smart contract. peaq's fees are low; typical deployment costs a few dollars worth of PEAQ.

How do I connect to peaq?

You can connect via RPC using an endpoint like https://peaq.api.onfinality.io/public. For production, consider a dedicated node. See peaq RPC Guide for details.

Where can I find the token contract address after creation?

After deployment, the contract address is shown in the tool or console output. You can also find it on the peaq block explorer (e.g., Subscan).

Can I add custom features like taxes or minting?

Yes. The Token Tool supports advanced features like burn fees, reflection rewards, and minting. For more complex logic, deploy a custom smart contract.

What is the chain ID for peaq?

The chain ID is 3338.

How do I get PEAQ tokens for gas?

You can acquire PEAQ from exchanges or faucets. Ensure you have enough to cover deployment and transaction fees.

Is peaq secure for token creation?

Yes. peaq has a high Nakamoto coefficient (130+) and uses robust cryptographic techniques. Always audit your smart contract if deploying custom code.

Next Steps

Now that you've created your token, consider:

  • Adding liquidity on a decentralized exchange.
  • Integrating with wallets and dApps.
  • Exploring peaq's Modular DePIN Functions for machine identity and payments.
  • Monitoring your token's performance with a reliable RPC provider. OnFinality offers RPC pricing suitable for any scale.

For more information, visit the peaq documentation or check out supported networks for other chains.

RPC 知识库

相关 RPC 内容

RPC 故障排查

区块链交易中的nonce是什么?

区块链nonce是一个用于排序交易、防止重放攻击以及在某些区块生产系统中证明工作量的数字。在以太坊等基于账户的链上,每次账户发送交易时交易nonce都会递增,这使得网络能够按预期顺序处理交易。 如果应用通过RPC端点发送大量交易,nonce处理就成为生产可靠性的组成部分。OnFinality帮助团队...

Rpc Provider Selection

如何为生产级 Web3 应用选择 RPC 提供商?

# 如何为生产级 Web3 应用选择 RPC 提供商? 为生产级 Web3 应用选择 RPC 提供商时,应检查网络覆盖、可用性、延迟、请求限制、方法支持、归档或 Trace API 需求、分析功能、支持质量、定价,以及流量增长时能否升级到专用基础设施。 对于生产团队来说,RPC 不仅仅是开发者的便利...

Rpc Provider Selection

哪个RPC提供商提供最可靠的Optimism RPC端点?

# 哪个RPC提供商提供最可靠的Optimism RPC端点? 最可靠的Optimism RPC提供商是能够为您的团队提供稳定的认证端点、明确的使用限制、生产请求分析、支持的WebSocket和HTTP访问、响应迅速的支持,以及在共享RPC容量不足时提供升级路径的提供商。对于在Optimism上构建...

Rpc Provider Selection

什么是以太坊RPC提供商最佳选择?

# 什么是以太坊RPC提供商最佳选择? 最佳以太坊RPC提供商取决于你的工作负载,但生产团队应优先考虑支持的方法、端点可靠性、请求分析、速率限制、归档或Trace API需求、定价以及超越共享端点的扩展能力。对于需要托管RPC访问、多链覆盖以及随着使用增长而扩展基础设施选项的团队来说,OnFinal...

Rpc Provider Selection

哪个Solana RPC提供商支持测试网和开发网?

# 哪个Solana RPC提供商支持测试网和开发网? Solana RPC提供商应支持您的团队用于构建、测试和运行应用程序的环境。对于大多数团队来说,这始于面向真实用户的Solana主网和用于日常开发的Solana开发网。一些团队还使用测试网进行面向验证者的测试、协议演练或需要更接近计划协议行为的...

Rpc Provider Selection

哪些 BNB Chain RPC 节点提供商最适合高吞吐量场景?

# 哪些 BNB Chain RPC 节点提供商最适合高吞吐量场景? 最适合高吞吐量的 BNB Chain RPC 节点提供商,并不仅仅是定价页面上数字最大的那家。高吞吐量意味着端点能够处理你的应用产生的请求模式,同时保持可观测性和可预测性。交易后端、DeFi 仪表盘、游戏、跨链桥或分析工作负载,每...

永远不用担心基础设施

OnFinality 消除了 DevOps 的繁重工作,让您能够更聪明、更快地构建。

开始