deployer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCCA Deployment
CCA 部署
Deploy Continuous Clearing Auction (CCA) smart contracts using the with CREATE2 for consistent addresses across chains.
ContinuousClearingAuctionFactoryRuntime Compatibility: This skill usesfor interactive prompts. IfAskUserQuestionis not available in your runtime, collect the same parameters through natural language conversation instead.AskUserQuestion
使用结合CREATE2机制部署CCA(持续清算拍卖)智能合约,可在不同链上获得一致的合约地址。
ContinuousClearingAuctionFactory运行时兼容性: 本技能使用进行交互式提示。如果你的运行环境中没有AskUserQuestion,请通过自然语言对话收集相同的参数。AskUserQuestion
Instructions for Claude Code
Claude Code 使用说明
When the user invokes this skill, guide them through the CCA deployment process with appropriate safety warnings and validation.
当用户调用本技能时,需引导他们完成CCA部署流程,并提供适当的安全警告和验证步骤。
Pre-Deployment Requirements
部署前要求
Before proceeding with deployment, you MUST:
- Show educational disclaimer and get user acknowledgment
- Validate configuration file if provided
- Verify factory address for the target network
- Confirm deployment parameters with user
在开始部署前,你必须:
- 展示教育免责声明并获得用户确认
- 验证配置文件(若用户提供)
- 验证目标网络的工厂合约地址
- 与用户确认部署参数
Deployment Workflow
部署流程
- Show Educational Disclaimer (REQUIRED)
- Load or Request Configuration
- Validate Configuration
- Display Deployment Plan
- Get User Confirmation
- Provide Deployment Commands
- Post-Deployment Steps
- 展示教育免责声明(必填)
- 加载或请求配置信息
- 验证配置有效性
- 展示部署计划
- 获取用户确认
- 提供部署命令
- 部署后步骤指导
⚠️ Educational Use Disclaimer
⚠️ 教育用途免责声明
IMPORTANT: Before proceeding with deployment, you must acknowledge:
This tool and all deployment instructions are provided for educational purposes only. AI-generated deployment commands may contain errors or security vulnerabilities.
You must:
- ✅ Review all configurations carefully before deploying
- ✅ Verify all parameters (addresses, pricing, schedules) are correct
- ✅ Test on testnets first before deploying to mainnet
- ✅ Audit your contracts before deploying with real funds
Use AskUserQuestion to confirm the user acknowledges these warnings before proceeding with deployment steps.
重要提示:在开始部署前,你必须确认已知晓以下内容:
本工具及所有部署说明仅用于教育目的。AI生成的部署命令可能存在错误或安全漏洞。
你必须:
- ✅ 在部署前仔细检查所有配置
- ✅ 验证所有参数(地址、定价、时间安排)的正确性
- ✅ 先在测试网进行测试,再部署到主网
- ✅ 在部署带有真实资金的合约前进行审计
在继续部署步骤前,请使用AskUserQuestion确认用户已认可这些警告。
🔐 Private Key Security
🔐 私钥安全
CRITICAL: Handling private keys safely is essential for secure deployments.
关键提示:安全处理私钥是保障部署安全的核心。
⚠️ Never Do These
⚠️ 绝对禁止的操作
- ❌ Never store private keys in git repositories or config files
- ❌ Never paste private keys directly in command line (visible in shell history)
- ❌ Never share private keys or store them in shared environments
- ❌ Never use mainnet private keys on untrusted computers
- ❌ 绝对不要将私钥存储在Git仓库或配置文件中
- ❌ 绝对不要直接在命令行中粘贴私钥(会显示在Shell历史记录中)
- ❌ 绝对不要分享私钥或在共享环境中存储私钥
- ❌ 绝对不要在不可信的电脑上使用主网私钥
✅ Recommended Practices
✅ 推荐实践
Option 1: Hardware Wallets (Most Secure)
选项1:硬件钱包(最安全)
Use Ledger or Trezor hardware wallets with the flag:
--ledgerbash
forge script script/Example.s.sol:ExampleScript \
--rpc-url $RPC_URL \
--broadcast \
--ledger使用Ledger或Trezor硬件钱包,并添加参数:
--ledgerbash
forge script script/Example.s.sol:ExampleScript \
--rpc-url $RPC_URL \
--broadcast \
--ledgerOption 2: Encrypted Keystore
选项2:加密密钥库
Create an encrypted keystore with :
cast wallet importbash
undefined使用创建加密密钥库:
cast wallet importbash
undefinedImport private key to encrypted keystore (one-time setup)
一次性设置:将私钥导入加密密钥库
cast wallet import deployer --interactive
cast wallet import deployer --interactive
Use keystore for deployment
使用密钥库进行部署
forge script script/Example.s.sol:ExampleScript
--rpc-url $RPC_URL
--broadcast
--account deployer
--sender $DEPLOYER_ADDRESS
--rpc-url $RPC_URL
--broadcast
--account deployer
--sender $DEPLOYER_ADDRESS
undefinedforge script script/Example.s.sol:ExampleScript
--rpc-url $RPC_URL
--broadcast
--account deployer
--sender $DEPLOYER_ADDRESS
--rpc-url $RPC_URL
--broadcast
--account deployer
--sender $DEPLOYER_ADDRESS
undefinedOption 3: Environment Variables (For Testing Only)
选项3:环境变量(仅用于测试)
If using environment variables, ensure they are:
- Set in a secure file (never committed to git)
.env - Loaded via or
source .envdotenv - Only used on trusted, secure computers
- Use testnet keys for development
Example:
bash
undefined如果使用环境变量,请确保:
- 存储在安全的文件中(绝对不要提交到Git)
.env - 通过或
source .env加载dotenv - 仅在可信、安全的电脑上使用
- 开发时使用测试网私钥
示例:
bash
undefined.env file (add to .gitignore)
.env文件(需添加到.gitignore)
PRIVATE_KEY=0x...
RPC_URL=https://...
PRIVATE_KEY=0x...
RPC_URL=https://...
Load environment
加载环境变量
source .env
source .env
Deploy
部署
forge script ... --private-key $PRIVATE_KEY
undefinedforge script ... --private-key $PRIVATE_KEY
undefinedTestnet First
先在测试网验证
Always test on testnets before mainnet:
- Sepolia (testnet): Get free ETH from faucets
- Base Sepolia: Free ETH for testing on Base
- Deploy and verify full workflow on testnet
- Only deploy to mainnet after thorough testing
始终先在测试网验证,再部署到主网:
- Sepolia(测试网):可从水龙头获取免费ETH
- Base Sepolia:Base测试网免费ETH
- 在测试网部署并验证完整流程
- 仅在彻底测试后部署到主网
Deployment Guide
部署指南
Factory Deployment
工厂合约部署
CCA instances are deployed via the contract, which uses CREATE2 for consistent addresses across chains.
ContinuousClearingAuctionFactoryCCA实例通过合约部署,该合约使用CREATE2机制实现跨链一致的合约地址。
ContinuousClearingAuctionFactoryFactory Addresses
工厂合约地址
| Version | Address | Status |
|---|---|---|
| v1.1.0 | | Recommended |
| 版本 | 地址 | 状态 |
|---|---|---|
| v1.1.0 | | 推荐使用 |
Deploying an Auction Instance
部署拍卖合约实例
Step 0: Clone the CCA Repository
步骤0:克隆CCA仓库
If you don't already have the CCA contracts locally, clone the repository and install dependencies:
bash
git clone https://github.com/Uniswap/continuous-clearing-auction.git
cd continuous-clearing-auction
forge installThis gives you access to the deployment scripts, contract ABIs, and test helpers referenced in later steps.
如果本地没有CCA合约代码,请克隆仓库并安装依赖:
bash
git clone https://github.com/Uniswap/continuous-clearing-auction.git
cd continuous-clearing-auction
forge install完成后你将获得部署脚本、合约ABI和测试工具的访问权限。
Step 1: Prepare Configuration
步骤1:准备配置文件
Ensure you have a valid configuration file (generated via the skill or manually created).
configuratorExample configuration file structure:
json
{
"1": {
"token": "0x...",
"totalSupply": 1e29,
"currency": "0x0000000000000000000000000000000000000000",
"tokensRecipient": "0x...",
"fundsRecipient": "0x...",
"startBlock": 24321000,
"endBlock": 24327001,
"claimBlock": 24327001,
"tickSpacing": 79228162514264337593543950,
"validationHook": "0x0000000000000000000000000000000000000000",
"floorPrice": 7922816251426433759354395000,
"requiredCurrencyRaised": 0,
"supplySchedule": [
{ "mps": 1000, "blockDelta": 6000 },
{ "mps": 4000000, "blockDelta": 1 }
]
}
}确保你有有效的配置文件(可通过技能生成或手动创建)。
configurator示例配置文件结构:
json
{
"1": {
"token": "0x...",
"totalSupply": 1e29,
"currency": "0x0000000000000000000000000000000000000000",
"tokensRecipient": "0x...",
"fundsRecipient": "0x...",
"startBlock": 24321000,
"endBlock": 24327001,
"claimBlock": 24327001,
"tickSpacing": 79228162514264337593543950,
"validationHook": "0x0000000000000000000000000000000000000000",
"floorPrice": 7922816251426433759354395000,
"requiredCurrencyRaised": 0,
"supplySchedule": [
{ "mps": 1000, "blockDelta": 6000 },
{ "mps": 4000000, "blockDelta": 1 }
]
}
}Step 2: Validate Configuration
步骤2:验证配置有效性
Before deployment, verify the configuration passes all validation rules (see Validation Rules section).
部署前,请确认配置通过所有验证规则(详见验证规则部分)。
Step 3: Deploy via Factory
步骤3:通过工厂合约部署
The factory has a simple interface:
solidity
function initializeDistribution(
address token,
uint256 amount,
bytes calldata configData,
bytes32 salt
) external returns (IDistributionContract);Where:
- : Address of the token to be sold
token - : Amount of tokens to sell in the auction
amount - : ABI-encoded
configDatastructAuctionParameters - : Optional bytes32 value for vanity address mining
salt
工厂合约提供简单的调用接口:
solidity
function initializeDistribution(
address token,
uint256 amount,
bytes calldata configData,
bytes32 salt
) external returns (IDistributionContract);参数说明:
- :待拍卖代币的合约地址
token - :拍卖的代币总量
amount - :ABI编码后的
configData结构体AuctionParameters - :可选的bytes32值,用于生成自定义合约地址
salt
Step 3.5: Encode Configuration to configData
步骤3.5:将配置编码为configData
The factory's expects as ABI-encoded . Convert your JSON config to encoded bytes:
initializeDistributionconfigDataAuctionParametersUsing cast (Foundry CLI):
bash
undefined工厂合约的方法要求为ABI编码后的结构体。请将JSON配置转换为编码后的字节数据:
initializeDistributionconfigDataAuctionParameters使用cast(Foundry CLI):
bash
undefinedEncode the AuctionParameters struct
编码AuctionParameters结构体
cast abi-encode "initializeDistribution(address,uint256,bytes,bytes32)"
"$TOKEN_ADDRESS"
"$TOTAL_SUPPLY"
"$(cast abi-encode "(address,address,address,uint64,uint64,uint64,uint256,address,uint256,uint128,bytes)"
"$CURRENCY"
"$TOKENS_RECIPIENT"
"$FUNDS_RECIPIENT"
"$START_BLOCK"
"$END_BLOCK"
"$CLAIM_BLOCK"
"$TICK_SPACING"
"$VALIDATION_HOOK"
"$FLOOR_PRICE"
"$REQUIRED_CURRENCY_RAISED"
"$ENCODED_SUPPLY_SCHEDULE")"
"0x0000000000000000000000000000000000000000000000000000000000000000"
"$TOKEN_ADDRESS"
"$TOTAL_SUPPLY"
"$(cast abi-encode "(address,address,address,uint64,uint64,uint64,uint256,address,uint256,uint128,bytes)"
"$CURRENCY"
"$TOKENS_RECIPIENT"
"$FUNDS_RECIPIENT"
"$START_BLOCK"
"$END_BLOCK"
"$CLAIM_BLOCK"
"$TICK_SPACING"
"$VALIDATION_HOOK"
"$FLOOR_PRICE"
"$REQUIRED_CURRENCY_RAISED"
"$ENCODED_SUPPLY_SCHEDULE")"
"0x0000000000000000000000000000000000000000000000000000000000000000"
**Using a Foundry Script:**
```solidity
// script/DeployAuction.s.sol
pragma solidity ^0.8.24;
import "forge-std/Script.sol";
interface ICCAFactory {
function initializeDistribution(
address token,
uint256 amount,
bytes calldata configData,
bytes32 salt
) external returns (address);
}
contract DeployAuction is Script {
function run() external {
// Load config values
address token = vm.envAddress("TOKEN");
uint256 amount = vm.envUint("TOTAL_SUPPLY");
// Encode AuctionParameters
bytes memory configData = abi.encode(
vm.envAddress("CURRENCY"),
vm.envAddress("TOKENS_RECIPIENT"),
vm.envAddress("FUNDS_RECIPIENT"),
uint64(vm.envUint("START_BLOCK")),
uint64(vm.envUint("END_BLOCK")),
uint64(vm.envUint("CLAIM_BLOCK")),
vm.envUint("TICK_SPACING"),
vm.envAddress("VALIDATION_HOOK"),
vm.envUint("FLOOR_PRICE"),
uint128(vm.envUint("REQUIRED_CURRENCY_RAISED")),
vm.envBytes("ENCODED_SUPPLY_SCHEDULE")
);
vm.startBroadcast();
// Approve token transfer to factory
IERC20(token).approve(
0xCCccCcCAE7503Cac057829BF2811De42E16e0bD5,
amount
);
// Deploy auction
address auction = ICCAFactory(
0xCCccCcCAE7503Cac057829BF2811De42E16e0bD5
).initializeDistribution(
token,
amount,
configData,
bytes32(0) // salt
);
vm.stopBroadcast();
console.log("Auction deployed at:", auction);
}
}Important: You must approve the token transfer to the factory before calling . The factory will transfer tokens from your address to the newly created auction contract.
initializeDistributionamountcast abi-encode "initializeDistribution(address,uint256,bytes,bytes32)"
"$TOKEN_ADDRESS"
"$TOTAL_SUPPLY"
"$(cast abi-encode "(address,address,address,uint64,uint64,uint64,uint256,address,uint256,uint128,bytes)"
"$CURRENCY"
"$TOKENS_RECIPIENT"
"$FUNDS_RECIPIENT"
"$START_BLOCK"
"$END_BLOCK"
"$CLAIM_BLOCK"
"$TICK_SPACING"
"$VALIDATION_HOOK"
"$FLOOR_PRICE"
"$REQUIRED_CURRENCY_RAISED"
"$ENCODED_SUPPLY_SCHEDULE")"
"0x0000000000000000000000000000000000000000000000000000000000000000"
"$TOKEN_ADDRESS"
"$TOTAL_SUPPLY"
"$(cast abi-encode "(address,address,address,uint64,uint64,uint64,uint256,address,uint256,uint128,bytes)"
"$CURRENCY"
"$TOKENS_RECIPIENT"
"$FUNDS_RECIPIENT"
"$START_BLOCK"
"$END_BLOCK"
"$CLAIM_BLOCK"
"$TICK_SPACING"
"$VALIDATION_HOOK"
"$FLOOR_PRICE"
"$REQUIRED_CURRENCY_RAISED"
"$ENCODED_SUPPLY_SCHEDULE")"
"0x0000000000000000000000000000000000000000000000000000000000000000"
**使用Foundry脚本:**
```solidity
// script/DeployAuction.s.sol
pragma solidity ^0.8.24;
import "forge-std/Script.sol";
interface ICCAFactory {
function initializeDistribution(
address token,
uint256 amount,
bytes calldata configData,
bytes32 salt
) external returns (address);
}
contract DeployAuction is Script {
function run() external {
// 加载配置值
address token = vm.envAddress("TOKEN");
uint256 amount = vm.envUint("TOTAL_SUPPLY");
// 编码AuctionParameters
bytes memory configData = abi.encode(
vm.envAddress("CURRENCY"),
vm.envAddress("TOKENS_RECIPIENT"),
vm.envAddress("FUNDS_RECIPIENT"),
uint64(vm.envUint("START_BLOCK")),
uint64(vm.envUint("END_BLOCK")),
uint64(vm.envUint("CLAIM_BLOCK")),
vm.envUint("TICK_SPACING"),
vm.envAddress("VALIDATION_HOOK"),
vm.envUint("FLOOR_PRICE"),
uint128(vm.envUint("REQUIRED_CURRENCY_RAISED")),
vm.envBytes("ENCODED_SUPPLY_SCHEDULE")
);
vm.startBroadcast();
// 授权工厂合约转移代币
IERC20(token).approve(
0xCCccCcCAE7503Cac057829BF2811De42E16e0bD5,
amount
);
// 部署拍卖合约
address auction = ICCAFactory(
0xCCccCcCAE7503Cac057829BF2811De42E16e0bD5
).initializeDistribution(
token,
amount,
configData,
bytes32(0) // salt值
);
vm.stopBroadcast();
console.log("Auction deployed at:", auction);
}
}重要提示: 在调用前,你必须授权工厂合约转移代币。工厂合约会将数量的代币从你的地址转移到新创建的拍卖合约中。
initializeDistributionamountStep 4: Using Foundry Script
步骤4:使用Foundry脚本部署
bash
undefinedbash
undefinedDeploy factory (if needed on new network)
部署工厂合约(若目标网络未部署)
forge script script/deploy/DeployContinuousAuctionFactory.s.sol:DeployContinuousAuctionFactoryScript
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
forge script script/deploy/DeployContinuousAuctionFactory.s.sol:DeployContinuousAuctionFactoryScript
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
Deploy auction instance
部署拍卖合约实例
forge script script/Example.s.sol:ExampleScript
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
undefinedforge script script/Example.s.sol:ExampleScript
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
--rpc-url $RPC_URL
--broadcast
--private-key $PRIVATE_KEY
undefinedStep 5: Post-Deployment
步骤5:部署后操作
After deployment, you must call to notify the auction that tokens have been transferred:
onTokensReceived()bash
cast send $AUCTION_ADDRESS "onTokensReceived()" --rpc-url $RPC_URL --private-key $PRIVATE_KEYThis is a required prerequisite before the auction can accept bids.
部署完成后,你必须调用方法通知拍卖合约代币已转移:
onTokensReceived()bash
cast send $AUCTION_ADDRESS "onTokensReceived()" --rpc-url $RPC_URL --private-key $PRIVATE_KEY这是拍卖合约接受出价前的必填前置步骤。
Alternative: Deploy via Constructor
替代方案:通过构造函数直接部署
You can also deploy directly via the constructor:
solidity
constructor(
address token,
uint128 amount,
AuctionParameters memory parameters
) {}This approach doesn't require a salt parameter but won't benefit from CREATE2's deterministic addressing.
你也可以直接通过构造函数部署:
solidity
constructor(
address token,
uint128 amount,
AuctionParameters memory parameters
) {}这种方式不需要salt参数,但无法利用CREATE2的确定性地址特性。
Verification on Block Explorers
在区块浏览器上验证合约
Generate standard JSON input for verification:
bash
forge verify-contract $AUCTION_ADDRESS \
src/ContinuousClearingAuction.sol:ContinuousClearingAuction \
--rpc-url $RPC_URL \
--show-standard-json-input > standard-json-input.jsonUpload this file to block explorers for verification.
生成标准JSON输入用于验证:
bash
forge verify-contract $AUCTION_ADDRESS \
src/ContinuousClearingAuction.sol:ContinuousClearingAuction \
--rpc-url $RPC_URL \
--show-standard-json-input > standard-json-input.json将该文件上传到区块浏览器完成合约验证。
Validation Rules
验证规则
Before deployment, ensure:
- Block constraints:
startBlock < endBlock <= claimBlock - Valid addresses: All addresses are valid Ethereum addresses (0x + 40 hex chars)
- Non-negative values: All numeric values >= 0
- Floor price alignment: Floor price must be a multiple of tick spacing
- Tick spacing: At least 1 basis point of floor price (1%, 10% recommended)
- Supply schedule: Last block sells significant tokens (~30%+)
- Total supply bounds: Max 1e30 wei (1 trillion 18-decimal tokens)
- No FoT tokens: Fee-on-transfer tokens not supported
- Minimum decimals: Do not use tokens with < 6 decimals
部署前,请确保配置满足以下规则:
- 区块约束:
startBlock < endBlock <= claimBlock - 有效地址:所有地址均为有效的以太坊地址(0x开头+40位十六进制字符)
- 非负数值:所有数值均≥0
- 底价对齐:底价必须是tick spacing的整数倍
- tick spacing:至少为底价的1个基点(推荐1%或10%)
- 供应计划:最后一个区块需售出大量代币(约30%以上)
- 总供应量限制:最大为1e30 wei(1万亿个18位小数代币)
- 不支持FoT代币:不支持转账即收费(Fee-on-Transfer)代币
- 最小小数位数:不要使用小数位数<6的代币
Technical Overview
技术概述
Q96 Fixed-Point Math
Q96定点数运算
The auction uses Q96 fixed-point arithmetic:
solidity
library FixedPoint96 {
uint8 internal constant RESOLUTION = 96;
uint256 internal constant Q96 = 0x1000000000000000000000000; // 2^96
}- Price: Q96 fixed-point number for fractional price ratios
- Demand: Currency amounts scaled by Q96
拍卖合约使用Q96定点数算术:
solidity
library FixedPoint96 {
uint8 internal constant RESOLUTION = 96;
uint256 internal constant Q96 = 0x1000000000000000000000000; // 2^96
}- 价格:使用Q96定点数表示 fractional price ratios(价格比率)
- 需求:货币金额按Q96缩放
Auction Steps (Supply Issuance)
拍卖步骤(代币发行)
Steps are packed into bytes, where each step is a :
uint64- First 24 bits: (per-block issuance rate in MPS)
mps - Last 40 bits: (number of blocks)
blockDelta
solidity
function parse(bytes8 data) internal pure returns (uint24 mps, uint40 blockDelta) {
mps = uint24(bytes3(data));
blockDelta = uint40(uint64(data));
}The data is deployed to an external SSTORE2 contract for cheaper reads.
发行步骤被打包为字节数据,每个步骤为类型:
uint64- 前24位:(每区块发行速率,单位MPS)
mps - 后40位:(区块数量)
blockDelta
solidity
function parse(bytes8 data) internal pure returns (uint24 mps, uint40 blockDelta) {
mps = uint24(bytes3(data));
blockDelta = uint40(uint64(data));
}该数据会部署到外部SSTORE2合约中以降低读取成本。
Key Contract Functions
核心合约函数
submitBid()
submitBid()
Users submit bids with:
- : Maximum price willing to pay (Q96)
maxPrice - : Currency amount to bid
amount - : Address to receive tokens/refunds
owner - : Hint for gas optimization
prevTickPrice - : Optional data for validation hooks
hookData
用户提交出价时需提供:
- :愿意支付的最高价格(Q96格式)
maxPrice - :出价的货币金额
amount - :接收代币/退款的地址
owner - :用于优化Gas费用的提示值
prevTickPrice - :验证钩子的可选数据
hookData
checkpoint()
checkpoint()
Auction is checkpointed once per block with a new bid. Checkpoints determine token allocations.
每收到一个新出价,拍卖合约会在当前区块创建一个检查点。检查点用于确定代币分配。
exitBid() / exitPartiallyFilledBid()
exitBid() / exitPartiallyFilledBid()
Bids can be exited when outbid or when auction ends (only after graduation).
当用户被超越出价或拍卖结束后(仅在拍卖达标后),可退出出价。
isGraduated()
isGraduated()
Returns true if . No bids can exit before graduation.
currencyRaised >= requiredCurrencyRaised当时返回true。达标前无法退出出价。
currencyRaised >= requiredCurrencyRaisedclaimTokens()
claimTokens()
Users claim purchased tokens after (only for graduated auctions).
claimBlock用户可在之后领取购买的代币(仅适用于达标的拍卖)。
claimBlocksweepCurrency() / sweepUnsoldTokens()
sweepCurrency() / sweepUnsoldTokens()
After auction ends:
- : Withdraw raised currency (graduated only)
sweepCurrency() - : Withdraw unsold tokens
sweepUnsoldTokens()
拍卖结束后:
- :提取筹集的货币(仅适用于达标的拍卖)
sweepCurrency() - :提取未售出的代币
sweepUnsoldTokens()
Supported Chains
支持的链
CCA is deployed to canonical addresses across select EVM chains:
| Chain ID | Network | Block Time |
|---|---|---|
| 1 | Mainnet | 12s |
| 130 | Unichain | 1s |
| 1301 | Unichain Sepolia | 2s |
| 8453 | Base | 2s |
| 42161 | Arbitrum | 2s |
| 11155111 | Sepolia | 12s |
CCA已在以下精选EVM链上部署了标准地址:
| 链ID | 网络 | 区块时间 |
|---|---|---|
| 1 | 主网 | 12s |
| 130 | Unichain | 1s |
| 1301 | Unichain Sepolia | 2s |
| 8453 | Base | 2s |
| 42161 | Arbitrum | 2s |
| 11155111 | Sepolia | 12s |
Troubleshooting
故障排查
Common Issues
常见问题
| Issue | Solution |
|---|---|
| "Invalid block sequence" | Ensure startBlock < endBlock <= claimBlock |
| "Floor price not aligned" | Round floor price to multiple of tick spacing |
| "Tick spacing too small" | Use at least 1% of floor price |
| "Total supply too large" | Max 1e30 wei (1 trillion 18-decimal tokens) |
| "Gas inefficiency" | Increase tick spacing |
| "Invalid address" | Verify addresses are 42 characters starting with 0x |
| 问题 | 解决方案 |
|---|---|
| "Invalid block sequence" | 确保 |
| "Floor price not aligned" | 将底价调整为tick spacing的整数倍 |
| "Tick spacing too small" | 设置tick spacing至少为底价的1% |
| "Total supply too large" | 总供应量不超过1e30 wei(1万亿个18位小数代币) |
| "Gas inefficiency" | 增大tick spacing |
| "Invalid address" | 验证地址为0x开头的42位有效以太坊地址 |
Validation Checklist
验证清单
Before deployment:
- Block sequence is valid (start < end <= claim)
- Floor price is multiple of tick spacing
- Tick spacing >= 1% of floor price
- All addresses are valid Ethereum addresses
- Total supply <= 1e30 wei
- Currency is more valuable than token
- Block times match network (12s mainnet, 2s L2s)
- Recipients addresses are set (not placeholders)
- Currency address is correct for network
- Last supply step sells ~30%+ of tokens
- No fee-on-transfer tokens used
- Token decimals >= 6
- called post-deployment
onTokensReceived()
部署前请确认:
- 区块顺序有效(start < end <= claim)
- 底价是tick spacing的整数倍
- tick spacing ≥ 底价的1%
- 所有地址均为有效以太坊地址
- 总供应量 ≤ 1e30 wei
- 货币价值高于代币
- 区块时间与目标网络匹配(主网12s,L2网络2s)
- 接收地址已正确设置(非占位符)
- 货币地址与目标网络一致
- 最后一个供应步骤售出约30%以上的代币
- 未使用转账即收费代币
- 代币小数位数 ≥6
- 部署后已调用
onTokensReceived()
Additional Resources
额外资源
- CCA Repository: https://github.com/Uniswap/continuous-clearing-auction
- Technical Documentation: See in repo
docs/TechnicalDocumentation.md - Deployment Guide: See in repo
docs/DeploymentGuide.md - Whitepaper: See in repo
docs/assets/whitepaper.pdf - Audits: See in repo
docs/audits/README.md - Uniswap Docs: https://docs.uniswap.org/contracts/liquidity-launchpad/CCA
- Bug Bounty: https://cantina.xyz/code/f9df94db-c7b1-434b-bb06-d1360abdd1be/overview
- CCA仓库:https://github.com/Uniswap/continuous-clearing-auction
- 技术文档:查看仓库中的
docs/TechnicalDocumentation.md - 部署指南:查看仓库中的
docs/DeploymentGuide.md - 白皮书:查看仓库中的
docs/assets/whitepaper.pdf - 审计报告:查看仓库中的
docs/audits/README.md - Uniswap文档:https://docs.uniswap.org/contracts/liquidity-launchpad/CCA
- 漏洞赏金:https://cantina.xyz/code/f9df94db-c7b1-434b-bb06-d1360abdd1be/overview