clanker by bankrbot/openclaw-skills
npx skills add https://github.com/bankrbot/openclaw-skills --skill clanker使用官方的 Clanker TypeScript SDK 部署具备内置流动性池的生产就绪型 ERC20 代币。
Clanker 是一种代币部署协议,可在单笔交易中创建带有 Uniswap V4 流动性池的 ERC20 代币。该 SDK 提供了一个 TypeScript 接口,用于部署具有归属、空投和可定制奖励分配等高级功能的代币。
npm install clanker-sdk viem
# 或
yarn add clanker-sdk viem
# 或
pnpm add clanker-sdk viem
使用您的私钥创建一个 .env 文件:
PRIVATE_KEY=0x...your_private_key_here
import { Clanker } from 'clanker-sdk';
import { createPublicClient, createWalletClient, http, type PublicClient } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';
const PRIVATE_KEY = process.env.PRIVATE_KEY as `0x${string}`;
const account = privateKeyToAccount(PRIVATE_KEY);
const publicClient = createPublicClient({
chain: base,
transport: http(),
}) as PublicClient;
const wallet = createWalletClient({
account,
chain: base,
transport: http(),
});
const clanker = new Clanker({ wallet, publicClient });
const { txHash, waitForTransaction, error } = await clanker.deploy({
name: 'My Token',
symbol: 'TKN',
image: 'ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi',
tokenAdmin: account.address,
metadata: {
description: 'My awesome token',
},
context: {
interface: 'Clanker SDK',
},
vanity: true,
});
if (error) throw error;
const { address: tokenAddress } = await waitForTransaction();
console.log('Token deployed at:', tokenAddress);
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
部署具有完全可定制性的代币,包括元数据、社交链接和池配置。
基础部署:
锁定一定百分比的代币,并设置锁仓期和归属期:
vault: {
percentage: 10, // 代币供应量的 10%
lockupDuration: 2592000, // 30 天锁仓期(以秒为单位)
vestingDuration: 2592000, // 30 天线性归属期
recipient: account.address,
}
使用默克尔树证明向多个地址分发代币:
import { createAirdrop, registerAirdrop } from 'clanker-sdk/v4/extensions';
const { tree, airdrop } = createAirdrop([
{ account: '0x...', amount: 200_000_000 },
{ account: '0x...', amount: 50_000_000 },
]);
// 在部署中包含
airdrop: {
...airdrop,
lockupDuration: 86_400, // 1 天
vestingDuration: 86_400, // 1 天
}
配置交易手续费分配:
rewards: {
recipients: [
{
recipient: account.address,
admin: account.address,
bps: 5000, // 手续费的 50%
token: 'Both', // 接收两种代币
},
{
recipient: '0x...',
admin: '0x...',
bps: 5000, // 手续费的 50%
token: 'Both',
},
],
}
选择每个接收者从交易手续费中接收哪种代币:
| 代币类型 | 描述 |
|---|---|
'Clanker' | 仅接收部署的代币 |
'Paired' | 仅接收配对代币(例如,WETH) |
'Both' | 接收两种代币 |
通过 Bankr 部署时,使用此默认奖励配置,包含 20% 的接口费用:
// Bankr 接口费用接收地址
const BANKR_INTERFACE_ADDRESS = '0xF60633D02690e2A15A54AB919925F3d038Df163e';
rewards: {
recipients: [
{
recipient: account.address, // 创建者
admin: account.address,
bps: 8000, // 80% 给创建者
token: 'Paired', // 接收配对代币 (WETH)
},
{
recipient: BANKR_INTERFACE_ADDRESS, // Bankr 接口
admin: BANKR_INTERFACE_ADDRESS,
bps: 2000, // 20% 给 Bankr
token: 'Paired', // 接收配对代币 (WETH)
},
],
}
在部署中包含初始代币购买:
devBuy: {
ethAmount: 0.1, // 使用 0.1 ETH 购买
recipient: account.address,
}
设置初始代币价格/市值:
import { getTickFromMarketCap } from 'clanker-sdk';
const customPool = getTickFromMarketCap(5); // 5 ETH 市值
pool: {
...customPool,
positions: [
{
tickLower: customPool.tickIfToken0IsClanker,
tickUpper: -120000,
positionBps: 10_000,
},
],
}
配置费用衰减以防止狙击:
sniperFees: {
startingFee: 666_777, // 66.6777% 起始费用
endingFee: 41_673, // 4.1673% 结束费用
secondsToDecay: 15, // 15 秒衰减期
}
| 参数 | 值 | 说明 |
|---|---|---|
| 代币供应量 | 1000 亿 | 固定为 100,000,000,000,精度 18 位小数 |
| 最大扩展 BPS | 9000 (90%) | 分配给扩展的最大代币比例,至少 10% 给流动性池 |
| 最大扩展数 | 10 | 每次部署的最大扩展数量 |
| 金库最小锁定期 | 7 天 | 归属的最小锁定期 |
| 空投最小锁定期 | 1 天 | 空投的最小锁定期 |
| 最大流动性池费用 | 10% | 正常交易费用上限 |
| 最大狙击费用 | 80% | 最大 MEV/狙击保护费用 |
| 狙击费用衰减 | 最多 2 分钟 | 狙击费用衰减的最长时间 |
| 最大奖励接收者 | 7 | 费用分配的最大接收者数量 |
| 最大流动性头寸 | 7 | 最大流动性头寸数量 |
| 链 | 链 ID | 原生代币 | 状态 |
|---|---|---|---|
| Base | 8453 | ETH | ✅ 完全支持 |
| Ethereum | 1 | ETH | ✅ 完全支持 |
| Arbitrum | 42161 | ETH | ✅ 完全支持 |
| Unichain | - | ETH | ✅ 完全支持 |
| Monad | - | MON | ✅ 仅支持静态费用 |
const claimable = await clanker.getVaultClaimableAmount({ token: TOKEN_ADDRESS });
if (claimable > 0n) {
const { txHash } = await clanker.claimVaultedTokens({ token: TOKEN_ADDRESS });
}
// 检查可用奖励
const availableFees = await clanker.availableRewards({
token: TOKEN_ADDRESS,
rewardRecipient: FEE_OWNER_ADDRESS,
});
// 申领奖励
const { txHash } = await clanker.claimRewards({
token: TOKEN_ADDRESS,
rewardRecipient: FEE_OWNER_ADDRESS,
});
const metadata = JSON.stringify({
description: 'Updated description',
socialMediaUrls: [
{ platform: 'twitter', url: 'https://twitter.com/mytoken' },
{ platform: 'telegram', url: 'https://t.me/mytoken' },
],
});
const { txHash } = await clanker.updateMetadata({
token: TOKEN_ADDRESS,
metadata,
});
const { txHash } = await clanker.updateImage({
token: TOKEN_ADDRESS,
image: 'ipfs://new_image_hash',
});
createAirdrop() 创建默克尔树// Bankr 接口费用接收地址 (20%)
const BANKR_INTERFACE_ADDRESS = '0xF60633D02690e2A15A54AB919925F3d038Df163e';
const tokenConfig = {
chainId: 8453, // Base
name: 'My Token',
symbol: 'TKN',
image: 'ipfs://...',
tokenAdmin: account.address,
metadata: {
description: 'Token description',
socialMediaUrls: [
{ platform: 'twitter', url: '...' },
{ platform: 'telegram', url: '...' },
],
},
context: {
interface: 'Bankr',
platform: 'farcaster',
messageId: '',
id: '',
},
vault: {
percentage: 10,
lockupDuration: 2592000,
vestingDuration: 2592000,
recipient: account.address,
},
devBuy: {
ethAmount: 0,
recipient: account.address,
},
// 默认:80% 创建者,20% Bankr 接口(全部为配对代币)
rewards: {
recipients: [
{
recipient: account.address,
admin: account.address,
bps: 8000, // 80% 给创建者
token: 'Paired', // 接收配对代币 (WETH)
},
{
recipient: BANKR_INTERFACE_ADDRESS,
admin: BANKR_INTERFACE_ADDRESS,
bps: 2000, // 20% 给 Bankr
token: 'Paired', // 接收配对代币 (WETH)
},
],
},
pool: {
pairedToken: '0x4200000000000000000000000000000000000006', // WETH
positions: 'Standard',
},
fees: 'StaticBasic',
vanity: true,
sniperFees: {
startingFee: 666_777,
endingFee: 41_673,
secondsToDecay: 15,
},
};
*Simulate 方法💡 专业提示 : 始终使用 vanity: true 选项以获得易记的合约地址。
⚠️ 安全提示 : 切勿提交私钥。使用 .env 文件并将其添加到 .gitignore。
🚀 快速入门 : 从简单的部署示例开始,然后根据需要添加归属和奖励等功能。
每周安装量
100
代码仓库
GitHub 星标数
993
首次出现
2026年2月2日
安全审计
安装于
openclaw95
opencode78
codex72
cursor71
kimi-cli70
gemini-cli70
Deploy production-ready ERC20 tokens with built-in liquidity pools using the official Clanker TypeScript SDK.
Clanker is a token deployment protocol that creates ERC20 tokens with Uniswap V4 liquidity pools in a single transaction. The SDK provides a TypeScript interface for deploying tokens with advanced features like vesting, airdrops, and customizable reward distribution.
npm install clanker-sdk viem
# or
yarn add clanker-sdk viem
# or
pnpm add clanker-sdk viem
Create a .env file with your private key:
PRIVATE_KEY=0x...your_private_key_here
import { Clanker } from 'clanker-sdk';
import { createPublicClient, createWalletClient, http, type PublicClient } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';
const PRIVATE_KEY = process.env.PRIVATE_KEY as `0x${string}`;
const account = privateKeyToAccount(PRIVATE_KEY);
const publicClient = createPublicClient({
chain: base,
transport: http(),
}) as PublicClient;
const wallet = createWalletClient({
account,
chain: base,
transport: http(),
});
const clanker = new Clanker({ wallet, publicClient });
const { txHash, waitForTransaction, error } = await clanker.deploy({
name: 'My Token',
symbol: 'TKN',
image: 'ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi',
tokenAdmin: account.address,
metadata: {
description: 'My awesome token',
},
context: {
interface: 'Clanker SDK',
},
vanity: true,
});
if (error) throw error;
const { address: tokenAddress } = await waitForTransaction();
console.log('Token deployed at:', tokenAddress);
Deploy tokens with full customization including metadata, social links, and pool configuration.
Basic deployment:
Reference: references/deployment.md
Lock a percentage of tokens with lockup and vesting periods:
vault: {
percentage: 10, // 10% of token supply
lockupDuration: 2592000, // 30 days cliff (in seconds)
vestingDuration: 2592000, // 30 days linear vesting
recipient: account.address,
}
Reference: references/vesting.md
Distribute tokens to multiple addresses using Merkle tree proofs:
import { createAirdrop, registerAirdrop } from 'clanker-sdk/v4/extensions';
const { tree, airdrop } = createAirdrop([
{ account: '0x...', amount: 200_000_000 },
{ account: '0x...', amount: 50_000_000 },
]);
// Include in deployment
airdrop: {
...airdrop,
lockupDuration: 86_400, // 1 day
vestingDuration: 86_400, // 1 day
}
Reference: references/airdrops.md
Configure trading fee distribution:
rewards: {
recipients: [
{
recipient: account.address,
admin: account.address,
bps: 5000, // 50% of fees
token: 'Both', // Receive both tokens
},
{
recipient: '0x...',
admin: '0x...',
bps: 5000, // 50% of fees
token: 'Both',
},
],
}
Choose which tokens each recipient receives from trading fees:
| Token Type | Description |
|---|---|
'Clanker' | Receive only the deployed token |
'Paired' | Receive only the paired token (e.g., WETH) |
'Both' | Receive both tokens |
When deploying via Bankr, use this default rewards configuration with 20% interface fee:
// Bankr interface fee recipient
const BANKR_INTERFACE_ADDRESS = '0xF60633D02690e2A15A54AB919925F3d038Df163e';
rewards: {
recipients: [
{
recipient: account.address, // Creator
admin: account.address,
bps: 8000, // 80% to creator
token: 'Paired', // Receive paired token (WETH)
},
{
recipient: BANKR_INTERFACE_ADDRESS, // Bankr interface
admin: BANKR_INTERFACE_ADDRESS,
bps: 2000, // 20% to Bankr
token: 'Paired', // Receive paired token (WETH)
},
],
}
Reference: references/rewards.md
Include an initial token purchase in the deployment:
devBuy: {
ethAmount: 0.1, // Buy with 0.1 ETH
recipient: account.address,
}
Set initial token price/market cap:
import { getTickFromMarketCap } from 'clanker-sdk';
const customPool = getTickFromMarketCap(5); // 5 ETH market cap
pool: {
...customPool,
positions: [
{
tickLower: customPool.tickIfToken0IsClanker,
tickUpper: -120000,
positionBps: 10_000,
},
],
}
Reference: references/pool-config.md
Configure fee decay to protect against snipers:
sniperFees: {
startingFee: 666_777, // 66.6777% starting fee
endingFee: 41_673, // 4.1673% ending fee
secondsToDecay: 15, // 15 seconds decay
}
| Parameter | Value | Notes |
|---|---|---|
| Token Supply | 100 billion | Fixed at 100,000,000,000 with 18 decimals |
| Max Extension BPS | 9000 (90%) | Max tokens to extensions, min 10% to LP |
| Max Extensions | 10 | Maximum number of extensions per deployment |
| Vault Min Lockup | 7 days | Minimum lockup duration for vesting |
| Airdrop Min Lockup | 1 day | Minimum lockup duration for airdrops |
| Max LP Fee | 10% | Normal trading fee cap |
| Max Sniper Fee | 80% | Maximum MEV/sniper protection fee |
| Sniper Fee Decay | 2 minutes max | Maximum time for sniper fee decay |
| Max Reward Recipients | 7 | Maximum fee distribution recipients |
| Chain | Chain ID | Native Token | Status |
|---|---|---|---|
| Base | 8453 | ETH | ✅ Full support |
| Ethereum | 1 | ETH | ✅ Full support |
| Arbitrum | 42161 | ETH | ✅ Full support |
| Unichain | - | ETH | ✅ Full support |
| Monad | - | MON | ✅ Static fees only |
const claimable = await clanker.getVaultClaimableAmount({ token: TOKEN_ADDRESS });
if (claimable > 0n) {
const { txHash } = await clanker.claimVaultedTokens({ token: TOKEN_ADDRESS });
}
// Check available rewards
const availableFees = await clanker.availableRewards({
token: TOKEN_ADDRESS,
rewardRecipient: FEE_OWNER_ADDRESS,
});
// Claim rewards
const { txHash } = await clanker.claimRewards({
token: TOKEN_ADDRESS,
rewardRecipient: FEE_OWNER_ADDRESS,
});
const metadata = JSON.stringify({
description: 'Updated description',
socialMediaUrls: [
{ platform: 'twitter', url: 'https://twitter.com/mytoken' },
{ platform: 'telegram', url: 'https://t.me/mytoken' },
],
});
const { txHash } = await clanker.updateMetadata({
token: TOKEN_ADDRESS,
metadata,
});
const { txHash } = await clanker.updateImage({
token: TOKEN_ADDRESS,
image: 'ipfs://new_image_hash',
});
createAirdrop()// Bankr interface fee recipient (20%)
const BANKR_INTERFACE_ADDRESS = '0xF60633D02690e2A15A54AB919925F3d038Df163e';
const tokenConfig = {
chainId: 8453, // Base
name: 'My Token',
symbol: 'TKN',
image: 'ipfs://...',
tokenAdmin: account.address,
metadata: {
description: 'Token description',
socialMediaUrls: [
{ platform: 'twitter', url: '...' },
{ platform: 'telegram', url: '...' },
],
},
context: {
interface: 'Bankr',
platform: 'farcaster',
messageId: '',
id: '',
},
vault: {
percentage: 10,
lockupDuration: 2592000,
vestingDuration: 2592000,
recipient: account.address,
},
devBuy: {
ethAmount: 0,
recipient: account.address,
},
// Default: 80% creator, 20% Bankr interface (all in paired token)
rewards: {
recipients: [
{
recipient: account.address,
admin: account.address,
bps: 8000, // 80% to creator
token: 'Paired', // Receive paired token (WETH)
},
{
recipient: BANKR_INTERFACE_ADDRESS,
admin: BANKR_INTERFACE_ADDRESS,
bps: 2000, // 20% to Bankr
token: 'Paired', // Receive paired token (WETH)
},
],
},
pool: {
pairedToken: '0x4200000000000000000000000000000000000006', // WETH
positions: 'Standard',
},
fees: 'StaticBasic',
vanity: true,
sniperFees: {
startingFee: 666_777,
endingFee: 41_673,
secondsToDecay: 15,
},
};
*Simulate methods before execution💡 Pro Tip : Always use the vanity: true option for memorable contract addresses.
⚠️ Security : Never commit private keys. Use .env files and add them to .gitignore.
🚀 Quick Win : Start with the simple deployment example, then add features like vesting and rewards as needed.
Weekly Installs
100
Repository
GitHub Stars
993
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
openclaw95
opencode78
codex72
cursor71
kimi-cli70
gemini-cli70
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
116,600 周安装
| Max LP Positions | 7 | Maximum liquidity positions |