代币铸造器

luokai02026-10-27查看 825复制 1623

在 EVM 网络上生成、构建和部署自定义 ERC20 代币。适用于用户想要创建和部署具有自定义参数(如名称、符号、小数位数和初始供应量)的自己的 ERC20 代币。支持部署到包括 Sepolia 测试网在内的各种网络,并需要 Foundry(forge/cast)进行区块链交互。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2492 chars
---
author: luo-kai
name: token-minter
description: Generate, build, and deploy custom ERC20 tokens on EVM networks. Use when users want to create and deploy their own ERC20 tokens with custom parameters like name, symbol, decimals, and initial supply. Supports deployment to various networks including Sepolia testnet and requires Foundry (forge/cast) for blockchain interactions.
---

# Token Minter

## Overview

This skill enables users to create custom ERC20 tokens by collecting parameters, generating Solidity code, setting up a Foundry project, building the contract, and deploying to a target EVM network.

## Workflow

### Step 1: Collect Information
Collect the following parameters from the user:
- Token name (e.g., "MyToken")
- Token symbol (e.g., "MTK")
- Decimals (default: 18)
- Initial supply (default: 1000000)
- Target network (default: sepolia)

### Step 2: Generate ERC20 Contract
Use the provided script to generate the ERC20 contract code based on user parameters.
- Run `python scripts/generate_contract.py <name> <symbol> <decimals> <initial_supply>` to generate the contract
- The generated contract uses OpenZeppelin ERC20 standard

### Step 3: Initialize Forge Project
- Create a temporary directory under `./tmp/`
- Initialize a new Foundry project: `forge init`
- Place the generated contract in `src/Contract.sol`

### Step 4: Build Contract
- Install dependencies: `forge install OpenZeppelin/openzeppelin-contracts`
- Build the contract: `forge build`

### Step 5: Deploy to Network
- Ensure a local cast wallet is created (prerequisite)
- Get RPC URL for target network from https://chainlist.org/rpcs.json
  - Find the network entry and use a reliable HTTPS RPC URL
  - For Sepolia: typically "https://ethereum-sepolia.publicnode.com" or similar
- Deploy using: `forge create --rpc-url <network_rpc> --account <account_name> src/Contract.sol:MyToken --constructor-args <initial_supply> --broadcast`
- Verify deployment on the target network

## Prerequisites
- Foundry installed (forge, cast commands available)
- Local cast wallet created with `cast wallet new`
- Sufficient funds on the deployment account for gas fees

## Resources

### scripts/
- `generate_contract.py`: Python script to generate ERC20 contract code with custom parameters

### references/
- `erc20_guide.md`: Overview of ERC20 standard, required functions, events, and deployment considerations

### assets/
- `ERC20Template.sol`: Template Solidity file for ERC20 contract generation
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧