RWA API 参考
完整的预编译合约地址映射、输入输出格式、Gas 成本参考。
预编译合约完整列表
合规模块 (0x01xx)
| 地址 | 功能 | 输入格式 | 输出格式 | Gas |
|---|---|---|---|---|
0x0100 | KYC 检查 | [32 bytes address] | [32 bytes status]1=批准, 0=未批准 | 1,000 |
0x0101 | 合规转账检查 | [32 from][32 to][32 value] | [32 status][32 error] | 2,000 |
0x0102 | 投资者类型查询 | [32 bytes address] | [32 bytes type]0=Retail, 1=Accredited... | 1,000 |
0x0103 | 管辖权查询 | [32 bytes address] | [32 bytes jurisdiction] | 1,000 |
0x0104 | 冻结地址 | [32 address][1 byte flag] | [32 bytes status] | 1,500 |
0x0105 | 设置 KYC 记录 | [20 addr][1 status][1 type][32 jur][32 exp][32 flags] | [32 bytes status] | 3,000 |
ERC-3643 模块 (0x02xx)
| 地址 | 功能 | 输入格式 | 输出格式 | Gas |
|---|---|---|---|---|
0x0200 | ERC3643 转账 | [32 from][32 to][32 amount] | [32 bytes success] | 3,000 |
0x0201 | ERC3643 铸造 | [32 to][32 amount] | [32 bytes success] | 5,000 |
0x0202 | ERC3643 销毁 | [32 from][32 amount] | [32 bytes success] | 5,000 |
0x0203 | 余额查询 | [32 bytes address] | [32 bytes balance] | 1,000 |
0x0204 | 白名单管理 | [32 address][1 byte add] | [32 bytes success] | 2,000 |
0x0205 | 冻结管理 | [32 address][1 byte freeze] | [32 bytes success] | 2,000 |
ZKP 模块 (0x03xx)
| 地址 | 功能 | 输入格式 | 输出格式 | Gas |
|---|---|---|---|---|
0x0300 | Groth16 验证 | [32 vk_hash][proof_data][public_inputs] | [32 bytes valid] | 150,000+ |
0x0301 | Plonk 验证 | [32 vk_hash][proof_data][public_inputs] | [32 bytes valid] | 200,000+ |
0x0302 | KYC 证明验证 | [32 commitment][32 jur][32 type][32 proof] | [32 bytes valid] | 100,000 |
0x0303 | 范围证明验证 | [32 commitment][32 proof] | [32 bytes valid] | 80,000 |
Go SDK 调用示例
cm := state.NewComplianceManager()
record := &state.KYCRecord{
Address: common.HexToAddress("0x123..."),
Status: state.KYCStatusApproved,
InvestorType: state.InvestorTypeAccredited,
Jurisdiction: state.JurisdictionHK,
ComplianceFlags: state.FlagWhitelisted,
VerifiedBy: "0xVerifier",
VerifiedAt: time.Now(),
ExpiresAt: time.Now().Add(365 * 24 * time.Hour),
}
cm.SetKYCRecord(record)
canTransact := cm.CanTransact(addr)
完整文档
查看完整的开发者指南:RWA_DEVELOPER_GUIDE.md