ERC20 Tokenomics Builder
End-to-end token launch readiness: allocation design → vesting contracts → liquidity math → investor docs.
Workflow
- 1. Gather inputs — total supply, allocations, unlock schedules, raise target, listing price
- Build allocation table — categories, amounts, percentages, unlock logic
- Generate vesting schedules — cliff + linear using OpenZeppelin VestingWallet
- Model Uniswap liquidity — initial price, pool depth, slippage targets
- Draft investor documentation — token sale summary, SAFT context, vesting proof
1. Allocation Table
Standard allocation buckets (adjust to project):
| Category | % Supply | Cliff | Vesting | TGE Unlock |
|---|
| Team | 15–20% | 12 mo | 36 mo | 0% |
| Investors (seed) |
10–15% | 6 mo | 24 mo | 0–5% |
| Investors (priv)| 8–12% | 3 mo | 18 mo | 5–10% |
| Ecosystem/DAO | 20–30% | 0 | 48 mo | 5% |
| Community/Airdrop| 10–15% | 0 | 0–12 mo | 100% |
| Liquidity | 5–10% | 0 | 0 | 100% |
| Reserve/Treasury| 10–20% | 0 | Governance| 0–5% |
Output format: Markdown table + CSV for investor decks.
2. OpenZeppelin VestingWallet
OZ VestingWallet handles cliff + linear release natively.
CODEBLOCK0
Key methods:
- -
release(token) — beneficiary calls to claim vested tokens - INLINECODE2 — query how much is unlockable
- INLINECODE3 — current claimable balance
Cliff pattern: Set startTimestamp = TGE + cliffDuration. Vesting begins linearly after cliff with no special code needed.
Multi-beneficiary factory pattern: See references/vesting-factory.md
3. Vesting Schedule Modeling
Calculate monthly unlock amounts for each category:
CODEBLOCK1
Circulating supply projection formula:
CS(t) = Σ [tge_i + max(0, (t - cliff_i) / vest_i) × (1 - tge_pct_i)] × supply_i
Where
t = months since TGE,
i = each allocation bucket.
Model month-by-month in a table through month 48. Flag any month where unlock > 5% of circulating supply (selling pressure risk).
4. Uniswap Liquidity Math
v2 Pool Setup (constant product: x * y = k)
CODEBLOCK3
Example: Target $10k retail trade at <1% impact
→ Need $1M TVL in the pool
v3 Concentrated Liquidity
- - Define price range:
[P_low, P_high] where P = token price in ETH/USDC - Recommended initial range: ±20–30% from listing price
- Concentrated liquidity = ~10x capital efficiency vs v2 in-range
- Use
tickLower / tickUpper = INLINECODE11
Listing price discovery:
CODEBLOCK4
See references/uniswap-math.md for deeper tick/range calculations.
5. Investor Documentation Templates
Token Sale Summary (SAFT context)
CODEBLOCK5
Vesting Proof for Investor
After deploying VestingWallet, provide:
- - Contract address
- Etherscan link
- INLINECODE13 call
- Next release milestone date
6. Common Pitfalls
- - Too much TGE unlock for team → dump signal; keep 0% until cliff
- Liquidity < 5% of MC → vulnerable to price manipulation
- No vesting cliff for advisors → cheap paper hands
- FDV too high at listing → suppresses price for years
- Missing
release() automation → beneficiaries forget; use a keeper script - Single VestingWallet per team → use individual wallets per person for clean cap table
References
- -
references/vesting-factory.md — Solidity VestingWallet factory + batch deployment - INLINECODE16 — Detailed Uniswap v2/v3 tick math and liquidity formulas
- INLINECODE17 — Pre-built allocation tables for DeFi, GameFi, DAO, Infrastructure
NOT This Skill
- - Already-deployed contract audit → use INLINECODE18
- LP position monitoring / IL tracking → use INLINECODE19
- Safe/multisig treasury management → use INLINECODE20
- General ERC20 contract upgrades → use INLINECODE21
ERC20 Tokenomics Builder
端到端代币发行准备:分配设计 → 归属合约 → 流动性数学 → 投资者文档。
工作流程
- 1. 收集输入 — 总供应量、分配方案、解锁时间表、募资目标、上市价格
- 构建分配表 — 类别、数量、百分比、解锁逻辑
- 生成归属时间表 — 使用OpenZeppelin VestingWallet实现悬崖期+线性释放
- 建模Uniswap流动性 — 初始价格、池深度、滑点目标
- 起草投资者文档 — 代币销售摘要、SAFT背景、归属证明
1. 分配表
标准分配桶(可根据项目调整):
| 类别 | 供应量占比 | 悬崖期 | 归属期 | TGE解锁 |
|---|
| 团队 | 15–20% | 12个月 | 36个月 | 0% |
| 投资者(种子轮) |
10–15% | 6个月 | 24个月 | 0–5% |
| 投资者(私募轮)| 8–12% | 3个月 | 18个月 | 5–10% |
| 生态/DAO | 20–30% | 0 | 48个月 | 5% |
| 社区/空投 | 10–15% | 0 | 0–12个月 | 100% |
| 流动性 | 5–10% | 0 | 0 | 100% |
| 储备/财库 | 10–20% | 0 | 治理决定 | 0–5% |
输出格式: Markdown表格 + CSV格式(用于投资者演示文稿)。
2. OpenZeppelin VestingWallet
OZ VestingWallet 原生支持悬崖期+线性释放。
solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import @openzeppelin/contracts/finance/VestingWallet.sol;
// 为每个受益人部署一个合约(或使用工厂模式)
// constructor(address beneficiary, uint64 startTimestamp, uint64 durationSeconds)
// 示例:团队成员12个月悬崖期+24个月线性释放
// start = TGE时间戳 + 12个月(通过设置start = 悬崖期结束时间来实现悬崖期)
// duration = 24个月(start之后的线性释放)
VestingWallet teamVest = new VestingWallet(
teamMemberAddress,
uint64(tgeTimestamp + 365 days), // 12个月悬崖期后开始
uint64(730 days) // 24个月线性归属
);
关键方法:
- - release(token) — 受益人调用以领取已归属代币
- vestedAmount(token, timestamp) — 查询可解锁数量
- releasable(token) — 当前可领取余额
悬崖期模式: 设置 startTimestamp = TGE + cliffDuration。悬崖期后开始线性归属,无需特殊代码。
多受益人工厂模式: 参见 references/vesting-factory.md
3. 归属时间表建模
计算每个类别的每月解锁量:
每月解锁量(悬崖期后)= (分配代币数量 / 归属月份数)
TGE解锁量 = 分配代币数量 × TGE解锁百分比
剩余代币 = 分配代币数量 × (1 - TGE解锁百分比)
每月线性释放量 = 剩余代币 / 悬崖期后归属月份数
流通供应量预测公式:
CS(t) = Σ [tgei + max(0, (t - cliffi) / vesti) × (1 - tgepcti)] × supplyi
其中 t = TGE后的月份数,i = 每个分配桶。
按月建模表格,持续至第48个月。标记任何解锁量超过流通供应量5%的月份(抛售压力风险)。
4. Uniswap流动性数学
v2池设置(恒定乘积:x * y = k)
初始价格 = ETH数量 / TOKEN数量
k = ETH数量 × TOKEN数量
交易规模S的滑点:
价格影响 = S / (ETH储备量 + S)
代币输出量 = TOKEN储备量 × S / (ETH储备量 + S)
建议:典型散户交易规模的价格影响 < 1%
→ 池深度 = 交易规模 / 0.01
示例: 目标1万美元散户交易,价格影响<1%
→ 池中需要100万美元TVL
v3集中流动性
- - 定义价格范围:[Plow, Phigh],其中P = 代币价格(以ETH/USDC计价)
- 建议初始范围:上市价格的±20–30%
- 集中流动性 = 在范围内相比v2约10倍资本效率
- 使用 tickLower / tickUpper = log(price) / log(1.0001)
上市价格发现:
FDV目标 = 总供应量 × 上市价格
隐含市值 = 流通供应量 × 上市价格
流动性比率 = 池TVL / 市值 → 健康上市目标为5–15%
更深入的tick/范围计算参见 references/uniswap-math.md。
5. 投资者文档模板
代币销售摘要(SAFT背景)
markdown
代币:[名称]($代码)
- - 总供应量:X,000,000,000
- TGE日期:[日期]
- 网络:以太坊 / [L2]
- 合约地址:[0x...]
本轮融资
- - 轮次:种子轮 / 私募轮 / 战略轮
- 募资金额:X美元,单价Y美元/代币 → Z美元FDV
- 分配比例:供应量的X%
- 归属条件:X个月悬崖期,X个月线性释放,TGE解锁X%
- 归属钱包:[合约地址 或 待部署]
代币释放时间表
[该批次的逐月解锁表]
资金用途
[明细]
投资者归属证明
部署VestingWallet后,提供:
- - 合约地址
- Etherscan链接
- vestedAmount(tokenAddress, block.timestamp) 调用结果
- 下一个释放里程碑日期
6. 常见陷阱
- - 团队TGE解锁过多 → 抛售信号;悬崖期前保持0%
- 流动性低于市值的5% → 易受价格操纵
- 顾问无归属悬崖期 → 廉价纸手
- 上市时FDV过高 → 长期压制价格
- 缺少release()自动化 → 受益人遗忘;使用守护脚本
- 团队共用单一VestingWallet → 为每人使用独立钱包以保持清晰的股权结构表
参考资料
- - references/vesting-factory.md — Solidity VestingWallet工厂+批量部署
- references/uniswap-math.md — 详细的Uniswap v2/v3 tick数学和流动性公式
- references/allocation-templates.md — 为DeFi、GameFi、DAO、基础设施预构建的分配表
非本技能范围
- - 已部署合约审计 → 使用 solidity-audit-precheck
- LP头寸监控/无常损失追踪 → 使用 defi-position-tracker
- Safe/多签财库管理 → 使用 multi-sig-treasury
- 通用ERC20合约升级 → 使用 upgrade-solidity-contracts