KYC 地址标签系统

状态层 KYC 管理,为每个地址绑定 KYC 状态、投资者类型、管辖权等信息,是所有 RWA 合规的基础。

核心概念

KYC 状态 (KYCStatus)

状态说明
Unknown0未知/未认证
Pending1审核中
Approved2已批准
Rejected3已拒绝
Expired4已过期
Revoked5已撤销

投资者类型 (InvestorType)

类型说明
Retail0零售投资者
Accredited1合格投资者
Institutional2机构投资者
Professional3专业投资者

Go 调用示例

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)

文件位置

pkg/state/compliance.go - 约 300 行