diff --git a/docs/rwa-legal-framework/RWA_LEGAL_FRAMEWORK_WORKLOG.md b/docs/rwa-legal-framework/RWA_LEGAL_FRAMEWORK_WORKLOG.md new file mode 100644 index 0000000..dc19b0f --- /dev/null +++ b/docs/rwa-legal-framework/RWA_LEGAL_FRAMEWORK_WORKLOG.md @@ -0,0 +1,73 @@ +# NAC RWA 全球资产法律要素体系 — 工单日志 + +**完成时间**: 2026-03-07 +**部署服务器**: 103.96.148.7:22000 +**代码库**: https://git.newassetchain.io/nacadmin/NAC_Blockchain +**总测试数**: 92 个,全部通过,零警告,零错误 + +--- + +## 背景与动机 + +原有辖区规则仅覆盖金融合规层(AML/KYC),不足以支撑 RWA 资产上链的完整法律要素需求。 +NAC 作为全球 RWA 公链,需要支持全球用户(不仅限于中国)的资产上链, +因此需要构建覆盖不动产/动产产权、税收、跨境贸易、知识产权、伊斯兰合规的完整法律要素体系。 + +--- + +## 五阶段实施结果 + +### 第一阶段:RWA 抽象数据模型(nac-rwa-legal-model) +- **测试数**: 38 个,全部通过 +- **覆盖内容**: + - 资产类型枚举(不动产/动产/知识产权/金融资产/数字资产) + - 产权结构(所有权/共有/信托/Sharia合规) + - 合约要件(必填字段/可选字段/附件清单) + - 税收要素(增值税/资本利得税/预提税/印花税) + - 跨境要素(原产地规则/关税/技术标准/资本流动) + - 四大法律体系(大陆法/普通法/伊斯兰法/混合法) + +### 第二阶段:11个核心辖区适配器(nac-rwa-jurisdiction-adapters) +- **测试数**: 13 个,全部通过 +- **覆盖辖区**: CN/HK/SG/AE/US/EU-DE/EU-FR/JP/KR/AU/GB +- **每个辖区包含**: 不动产/动产/知识产权的完整法律要求、税收规则、合规要求 + +### 第三阶段:合约模板库(nac-rwa-contract-templates) +- **测试数**: 13 个,全部通过 +- **模板类型**: + - 不动产买卖:CN/HK/SG/AE/US/DE/JP/KR/AU/GB/FR(11个辖区) + - 商品跨境买卖:CN-US/CN-EU/CN-JP/CN-SG/EU-US/EU-JP/CN-HK(7个贸易对) + - 知识产权许可:CN/US/EU/JP 作为许可方(4个许可方) + +### 第四阶段:双边贸易规则矩阵(nac-rwa-bilateral-rules) +- **测试数**: 13 个,全部通过 +- **贸易对**: CN-EU/CN-JP/CN-US/CN-SG/EU-US/EU-JP(含双向共12对) +- **每对包含**: 贸易协定、关税规则(双向)、技术标准互认、投资规则、争议解决、RWA上链特殊要求 + +### 第五阶段:伊斯兰合规合约层(nac-rwa-sharia-compliance) +- **测试数**: 15 个,全部通过 +- **覆盖辖区**: AE(阿联酋)/SA(沙特)/MY(马来西亚) +- **核心原则**: 禁止Riba(利息)/禁止Gharar(不确定性)/禁止Maysir(赌博)/禁止Haram商品 +- **支持结构**: Murabaha/Ijara/Musharakah/Mudarabah/Sukuk/Istisna/Salam/Wakalah/Takaful + +--- + +## 关键设计决策 + +1. **全球视角**:设计以全球法律体系为基础,中立支持每一个辖区,而非以中国为中心 +2. **四大法律体系**:大陆法系(CN/JP/DE/FR)/ 普通法系(US/GB/HK/SG)/ 伊斯兰法系(AE/SA/MY)/ 混合法系 +3. **资产类型×辖区矩阵**:不存在通用合约,每种资产在每个辖区都有其特定法律要求 +4. **双边规则矩阵**:跨境交易须同时满足两个辖区的法律要求 +5. **Sharia 合规独立层**:伊斯兰金融有独特的禁止原则,须作为独立层处理 + +--- + +## 后台管理账号 + +| 服务 | 地址 | 账号 | 密码 | +|------|------|------|------| +| SSH | 103.96.148.7:22000 | root | XKUigTFMJXhH | +| 宝塔面板 | http://103.96.148.7:12/btwest | cproot | vajngkvf | +| Gitea | http://localhost:3333 | nacadmin | NACadmin2026! | +| MongoDB | 103.96.148.7 | root | idP0ZaRGyLsTUA3a | + diff --git a/nac-rwa-bilateral-rules/Cargo.lock b/nac-rwa-bilateral-rules/Cargo.lock new file mode 100644 index 0000000..48b4dcb --- /dev/null +++ b/nac-rwa-bilateral-rules/Cargo.lock @@ -0,0 +1,96 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "nac-rwa-bilateral-rules" +version = "1.0.0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/nac-rwa-bilateral-rules/Cargo.toml b/nac-rwa-bilateral-rules/Cargo.toml new file mode 100644 index 0000000..08f522c --- /dev/null +++ b/nac-rwa-bilateral-rules/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "nac-rwa-bilateral-rules" +version = "1.0.0" +edition = "2021" +description = "NAC RWA 双边贸易规则矩阵 — CN-EU/CN-JP/CN-US/CN-SG/EU-US/EU-JP" +authors = ["NAC Development Team"] + +[lib] +name = "nac_rwa_bilateral_rules" +path = "src/lib.rs" + +[lints.rust] +warnings = "deny" + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" diff --git a/nac-rwa-bilateral-rules/src/lib.rs b/nac-rwa-bilateral-rules/src/lib.rs new file mode 100644 index 0000000..849e3d7 --- /dev/null +++ b/nac-rwa-bilateral-rules/src/lib.rs @@ -0,0 +1,973 @@ +// NAC RWA 双边贸易规则矩阵 +// 版本:1.0.0 +// +// 覆盖贸易对: +// CN-EU(中欧)、CN-JP(中日)、CN-US(中美)、CN-SG(中新) +// EU-US(欧美)、EU-JP(欧日) +// +// 每个贸易对包含: +// - 适用贸易协定 +// - 关税规则 +// - 技术标准互认 +// - 投资限制 +// - 争议解决机制 +// - 适用法律选择 +// - 资产上链特殊要求 + +use serde::{Deserialize, Serialize}; + +/// 贸易协定类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TradeAgreement { + /// 世界贸易组织(WTO) + Wto, + /// 区域全面经济伙伴关系协定(RCEP) + Rcep, + /// 中国-新加坡自贸协定(CSFTA) + CsfTa, + /// 欧日经济伙伴协定(EU-Japan EPA) + EuJapanEpa, + /// 欧盟-新加坡自贸协定(EUSFTA) + Eusfta, + /// 无特别协定(仅WTO MFN) + WtoMfnOnly, +} + +/// 关税规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TariffRule { + /// 贸易协定 + pub agreement: TradeAgreement, + /// 一般商品MFN税率描述 + pub mfn_rate_description: String, + /// 优惠税率描述(如有协定) + pub preferential_rate_description: Option, + /// 获得优惠税率的条件 + pub preferential_conditions: Vec, + /// 主要受限商品(高关税或禁止) + pub restricted_goods: Vec, + /// 反倾销/反补贴税情况 + pub anti_dumping_note: Option, +} + +/// 技术标准互认 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TechnicalStandardMutualRecognition { + /// 是否有正式MRA协议 + pub formal_mra: bool, + /// MRA覆盖领域 + pub covered_sectors: Vec, + /// 各方标准体系 + pub standard_systems: Vec, + /// 产品合规要求说明 + pub compliance_notes: Vec, +} + +/// 投资规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InvestmentRules { + /// 是否有双边投资协定(BIT) + pub has_bit: bool, + /// BIT名称(如有) + pub bit_name: Option, + /// 投资审查机制 + pub investment_review: Vec, + /// 不动产外资限制 + pub real_estate_restrictions: Vec, + /// 金融投资限制 + pub financial_investment_restrictions: Vec, +} + +/// 争议解决机制 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DisputeResolutionMechanism { + /// 推荐仲裁机构 + pub recommended_arbitration: Vec, + /// 是否均为《纽约公约》成员 + pub both_new_york_convention: bool, + /// 司法协助协定 + pub judicial_assistance: Option, + /// 判决承认与执行 + pub judgment_enforcement_note: String, +} + +/// 双边 RWA 资产上链特殊要求 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BilateralRwaRequirements { + /// 不动产跨境上链要求 + pub real_estate_requirements: Vec, + /// 商品跨境上链要求 + pub goods_requirements: Vec, + /// 知识产权跨境上链要求 + pub ip_requirements: Vec, + /// 资金跨境要求 + pub capital_flow_requirements: Vec, + /// 数据跨境要求 + pub data_cross_border_requirements: Vec, +} + +/// 双边贸易规则完整矩阵 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BilateralTradeMatrix { + /// 辖区A(通常为出口方/卖方) + pub jurisdiction_a: String, + /// 辖区B(通常为进口方/买方) + pub jurisdiction_b: String, + /// 矩阵名称 + pub name: String, + /// 贸易关系描述 + pub relationship_description: String, + /// 适用贸易协定 + pub trade_agreements: Vec, + /// 关税规则(A→B方向) + pub tariff_a_to_b: TariffRule, + /// 关税规则(B→A方向) + pub tariff_b_to_a: TariffRule, + /// 技术标准互认 + pub technical_standards: TechnicalStandardMutualRecognition, + /// 投资规则 + pub investment_rules: InvestmentRules, + /// 争议解决 + pub dispute_resolution: DisputeResolutionMechanism, + /// RWA 资产上链特殊要求 + pub rwa_requirements: BilateralRwaRequirements, + /// 适用法律建议 + pub governing_law_recommendation: String, + /// 重要风险提示 + pub risk_notes: Vec, +} + +/// 获取双边贸易规则矩阵 +pub fn get_bilateral_matrix(jurisdiction_a: &str, jurisdiction_b: &str) -> Option { + let pair = format!("{}-{}", jurisdiction_a.to_uppercase(), jurisdiction_b.to_uppercase()); + match pair.as_str() { + "CN-EU" | "CN-DE" | "CN-FR" => Some(cn_eu_matrix()), + "EU-CN" | "DE-CN" | "FR-CN" => Some(eu_cn_matrix()), + "CN-JP" => Some(cn_jp_matrix()), + "JP-CN" => Some(jp_cn_matrix()), + "CN-US" => Some(cn_us_matrix()), + "US-CN" => Some(us_cn_matrix()), + "CN-SG" => Some(cn_sg_matrix()), + "SG-CN" => Some(sg_cn_matrix()), + "EU-US" | "DE-US" | "FR-US" => Some(eu_us_matrix()), + "US-EU" | "US-DE" | "US-FR" => Some(us_eu_matrix()), + "EU-JP" | "DE-JP" | "FR-JP" => Some(eu_jp_matrix()), + "JP-EU" | "JP-DE" | "JP-FR" => Some(jp_eu_matrix()), + _ => None, + } +} + +/// 获取所有可用贸易对列表 +pub fn list_available_pairs() -> Vec<(&'static str, &'static str)> { + vec![ + ("CN", "EU"), ("EU", "CN"), + ("CN", "JP"), ("JP", "CN"), + ("CN", "US"), ("US", "CN"), + ("CN", "SG"), ("SG", "CN"), + ("EU", "US"), ("US", "EU"), + ("EU", "JP"), ("JP", "EU"), + ] +} + +fn cn_eu_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "EU".to_string(), + name: "中欧双边贸易规则矩阵".to_string(), + relationship_description: "中国与欧盟之间的贸易关系,适用WTO MFN税率,无全面自贸协定(CAI谈判已冻结)".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::WtoMfnOnly], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "欧盟对中国商品适用WTO MFN税率,平均约5%,但部分商品(纺织品、钢铁、电动车)税率较高".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![ + "电动汽车(2024年起额外关税17%-38%)".to_string(), + "钢铁(反倾销税)".to_string(), + "太阳能板(反倾销税)".to_string(), + "军民两用技术".to_string(), + ], + anti_dumping_note: Some("欧盟对中国多类商品征收反倾销税,须在合同中确认".to_string()), + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "中国对欧盟商品适用WTO MFN税率,平均约9%".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![ + "军事技术".to_string(), + "受管制两用物品".to_string(), + ], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: false, + covered_sectors: vec![], + standard_systems: vec![ + "中国:GB/T国家标准、CCC认证".to_string(), + "欧盟:CE认证、EN标准、REACH/RoHS".to_string(), + ], + compliance_notes: vec![ + "中国出口欧盟须符合CE认证(电气/机械/医疗器械等)".to_string(), + "化学品须符合欧盟REACH法规".to_string(), + "食品须符合欧盟食品安全法规".to_string(), + "欧盟出口中国须符合CCC认证(电气产品)".to_string(), + "无正式MRA,须各自独立认证".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: false, + bit_name: Some("中欧全面投资协定(CAI)——已于2021年冻结".to_string()), + investment_review: vec![ + "欧盟:FDI审查框架(各成员国实施)".to_string(), + "中国:外资负面清单制度".to_string(), + "中国:NDRC/MOFCOM审批(特定行业)".to_string(), + ], + real_estate_restrictions: vec![ + "中国:外资购买住宅须有工作/学习证明".to_string(), + "欧盟:各成员国规定不同,通常无限制".to_string(), + ], + financial_investment_restrictions: vec![ + "中国:QFII/RQFII制度".to_string(), + "欧盟:资本自由流动原则,但有国家安全例外".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "ICC仲裁院(巴黎)".to_string(), + "CIETAC仲裁委员会(北京)".to_string(), + "SIAC(新加坡,中立第三方)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: None, + judgment_enforcement_note: "中欧之间无司法协助条约,法院判决执行困难,强烈建议选择仲裁".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "中国不动产上链须完成不动产登记,获取不动产权证".to_string(), + "欧盟不动产上链须完成各成员国土地登记(如德国Grundbuch)".to_string(), + "跨境持有须遵守外汇管制(中国)和资本流动规定(欧盟)".to_string(), + ], + goods_requirements: vec![ + "须提供完整的贸易单据(发票、提单、原产地证明等)".to_string(), + "须确认是否受反倾销税令约束".to_string(), + "须符合进口方的产品安全认证要求".to_string(), + ], + ip_requirements: vec![ + "中国知识产权须在CNIPA完成登记".to_string(), + "欧盟知识产权须在EUIPO/EPO完成登记".to_string(), + "跨境许可须遵守各自的技术出口管制法规".to_string(), + "须预扣预提税(中国10%,欧盟各国不同)".to_string(), + ], + capital_flow_requirements: vec![ + "中国:外汇管理局(SAFE)审批,超过5万美元须申报".to_string(), + "欧盟:资本自由流动,但须遵守反洗钱规定".to_string(), + ], + data_cross_border_requirements: vec![ + "中国:《数据安全法》《个人信息保护法》,数据出境须评估".to_string(), + "欧盟:GDPR,数据传输至中国须有充分保护措施(SCCs等)".to_string(), + ], + }, + governing_law_recommendation: "建议选择新加坡法律(中立)或香港法律(普通法,中立);避免选择单方辖区法律".to_string(), + risk_notes: vec![ + "中欧CAI已冻结,双边投资保护缺乏专门协定".to_string(), + "欧盟对中国电动车、钢铁等商品征收额外关税,须在合同中明确关税承担方".to_string(), + "中国外汇管制可能影响资金跨境流动".to_string(), + "地缘政治风险较高,建议在合同中加入详细的不可抗力条款".to_string(), + ], + } +} + +fn eu_cn_matrix() -> BilateralTradeMatrix { + let mut m = cn_eu_matrix(); + m.jurisdiction_a = "EU".to_string(); + m.jurisdiction_b = "CN".to_string(); + m.name = "欧中双边贸易规则矩阵".to_string(); + m +} + +fn cn_jp_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "JP".to_string(), + name: "中日双边贸易规则矩阵".to_string(), + relationship_description: "中国与日本之间的贸易关系,适用RCEP优惠税率,双边贸易额全球前三".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::Rcep], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::Rcep, + mfn_rate_description: "日本对中国商品MFN税率平均约4%".to_string(), + preferential_rate_description: Some("RCEP优惠税率:逐步降至0%(20年内)".to_string()), + preferential_conditions: vec![ + "须提供RCEP原产地证书(Form RCEP)".to_string(), + "须满足RCEP原产地规则(区域价值成分或税则改变)".to_string(), + ], + restricted_goods: vec![ + "大米(高关税保护)".to_string(), + "乳制品".to_string(), + "军民两用技术".to_string(), + ], + anti_dumping_note: Some("日本对部分中国钢铁产品有反倾销措施".to_string()), + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::Rcep, + mfn_rate_description: "中国对日本商品MFN税率平均约9%".to_string(), + preferential_rate_description: Some("RCEP优惠税率:逐步降至0%".to_string()), + preferential_conditions: vec![ + "须提供RCEP原产地证书".to_string(), + ], + restricted_goods: vec![], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: false, + covered_sectors: vec![], + standard_systems: vec![ + "中国:GB/T国家标准、CCC认证".to_string(), + "日本:JIS标准、PSE/PSC/JAS认证".to_string(), + ], + compliance_notes: vec![ + "中国出口日本电气产品须符合PSE认证".to_string(), + "中国出口日本食品须符合《食品卫生法》".to_string(), + "日本出口中国汽车须符合中国强制性认证(CCC)".to_string(), + "无正式MRA,须各自独立认证".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: true, + bit_name: Some("中日韩投资协定(2012年,含BIT条款)".to_string()), + investment_review: vec![ + "日本:外为法审查(特定敏感行业)".to_string(), + "中国:外资负面清单制度".to_string(), + ], + real_estate_restrictions: vec![ + "日本:外资可自由购买不动产,须遵守外为法申报".to_string(), + "中国:外资购买住宅须有工作/学习证明".to_string(), + ], + financial_investment_restrictions: vec![ + "日本:特定敏感行业须事前申报".to_string(), + "中国:QFII/RQFII制度".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "JCAA仲裁院(东京)".to_string(), + "CIETAC仲裁委员会(北京)".to_string(), + "SIAC(新加坡,中立第三方)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: Some("中日司法协助条约(1984年)".to_string()), + judgment_enforcement_note: "中日有司法协助条约,但实践中仍建议选择仲裁".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "日本不动产上链须完成法务局登记".to_string(), + "中国不动产上链须完成不动产登记".to_string(), + "日本外资须遵守外为法申报要求".to_string(), + ], + goods_requirements: vec![ + "可申请RCEP优惠税率,须提供RCEP原产地证书".to_string(), + "须符合进口方的产品安全认证要求(PSE/CCC等)".to_string(), + ], + ip_requirements: vec![ + "可通过PCT申请在中日两国获得专利保护".to_string(), + "商标须分别在CNIPA和JPO注册".to_string(), + "日本预提税:20%(无DTA)/ 中日DTA可降低至10%".to_string(), + ], + capital_flow_requirements: vec![ + "中国:外汇管理局审批".to_string(), + "日本:外为法申报(超过一定金额)".to_string(), + ], + data_cross_border_requirements: vec![ + "中国:数据出境须评估".to_string(), + "日本:《个人信息保护法》(APPI)".to_string(), + ], + }, + governing_law_recommendation: "建议选择新加坡法律(中立)或香港法律".to_string(), + risk_notes: vec![ + "RCEP原产地规则较为复杂,须仔细核实商品是否满足要求".to_string(), + "中日之间存在历史和领土争议,地缘政治风险须关注".to_string(), + "日本外为法对特定行业投资有严格审查".to_string(), + ], + } +} + +fn jp_cn_matrix() -> BilateralTradeMatrix { + let mut m = cn_jp_matrix(); + m.jurisdiction_a = "JP".to_string(); + m.jurisdiction_b = "CN".to_string(); + m.name = "日中双边贸易规则矩阵".to_string(); + m +} + +fn cn_us_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "US".to_string(), + name: "中美双边贸易规则矩阵".to_string(), + relationship_description: "中国与美国之间的贸易关系,适用WTO MFN税率,但受301条款额外关税影响,贸易摩擦持续".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::WtoMfnOnly], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "美国对中国商品MFN税率平均约3.4%,但301条款额外关税7.5%-25%".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![ + "半导体及相关设备(出口管制)".to_string(), + "电信设备(华为等实体清单)".to_string(), + "钢铁铝材(232条款关税)".to_string(), + "太阳能板(201/301条款)".to_string(), + "电动汽车(100%关税)".to_string(), + ], + anti_dumping_note: Some("美国对大量中国商品征收反倾销/反补贴税,须逐一核实".to_string()), + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "中国对美国商品MFN税率平均约9%,但对部分美国商品有报复性关税".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![ + "农产品(大豆、猪肉等,报复性关税)".to_string(), + "军民两用技术".to_string(), + ], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: false, + covered_sectors: vec![], + standard_systems: vec![ + "中国:GB/T国家标准、CCC认证".to_string(), + "美国:ANSI/ASTM/UL标准,FDA/FCC/CPSC认证".to_string(), + ], + compliance_notes: vec![ + "中国出口美国电子产品须符合FCC认证".to_string(), + "中国出口美国食品须符合FDA要求".to_string(), + "中国出口美国消费品须符合CPSC安全标准".to_string(), + "美国出口中国须符合CCC认证(电气产品)".to_string(), + "无正式MRA".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: false, + bit_name: None, + investment_review: vec![ + "美国:CFIUS审查(外资并购审查,对中资尤为严格)".to_string(), + "美国:FIRRMA(外国投资风险审查现代化法案)".to_string(), + "中国:外资负面清单制度".to_string(), + "美国:对中国军事相关企业的投资限制(EO 13959)".to_string(), + ], + real_estate_restrictions: vec![ + "美国:部分州限制中国公民购买农业用地或军事基地附近不动产".to_string(), + "美国:CFIUS可审查外资不动产收购(军事基地附近)".to_string(), + "中国:外资购买住宅须有工作/学习证明".to_string(), + ], + financial_investment_restrictions: vec![ + "美国:对中国军事相关企业的证券投资限制".to_string(), + "中国:QFII/RQFII制度".to_string(), + "美国:OFAC制裁合规".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "ICC仲裁院(巴黎,中立第三方)".to_string(), + "SIAC(新加坡,中立第三方)".to_string(), + "HKIAC(香港,中立第三方)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: None, + judgment_enforcement_note: "中美之间无司法协助条约,法院判决执行极为困难,强烈建议选择仲裁".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "美国不动产上链须完成产权保险和地契登记".to_string(), + "中国公民/企业在美购买不动产须遵守CFIUS规定(军事基地附近)".to_string(), + "须遵守FIRPTA(外资卖方预扣15%税款)".to_string(), + "部分州立法限制中国公民购买农业用地".to_string(), + ], + goods_requirements: vec![ + "须确认是否受301条款额外关税影响(7.5%-25%)".to_string(), + "须确认是否受反倾销/反补贴税令约束".to_string(), + "须符合美国产品安全认证要求(FDA/FCC/CPSC等)".to_string(), + "须遵守OFAC制裁规定".to_string(), + ], + ip_requirements: vec![ + "须通过PCT申请在中美两国获得专利保护".to_string(), + "美国预提税:30%(无DTA)/ 中美DTA可降低至10%".to_string(), + "受EAR/ITAR管制的技术须申请出口许可证".to_string(), + ], + capital_flow_requirements: vec![ + "中国:外汇管理局审批,超过5万美元须申报".to_string(), + "美国:FinCEN反洗钱申报要求".to_string(), + "须遵守OFAC制裁规定".to_string(), + ], + data_cross_border_requirements: vec![ + "中国:数据出境须安全评估".to_string(), + "美国:CLOUD Act、FISA等数据访问法律".to_string(), + "TikTok/字节跳动案例表明数据主权风险极高".to_string(), + ], + }, + governing_law_recommendation: "强烈建议选择新加坡法律或香港法律(中立,普通法体系,两国均认可)".to_string(), + risk_notes: vec![ + "301条款额外关税(7.5%-25%)显著影响商品贸易成本,须在合同中明确承担方".to_string(), + "CFIUS审查对中资在美投资影响极大,须提前评估".to_string(), + "出口管制风险高(EAR/ITAR/实体清单),须仔细核实".to_string(), + "中美之间无司法协助条约,强烈建议选择仲裁".to_string(), + "地缘政治风险极高,建议在合同中加入详细的不可抗力和制裁条款".to_string(), + "部分州立法限制中国公民购买特定类型不动产".to_string(), + ], + } +} + +fn us_cn_matrix() -> BilateralTradeMatrix { + let mut m = cn_us_matrix(); + m.jurisdiction_a = "US".to_string(); + m.jurisdiction_b = "CN".to_string(); + m.name = "美中双边贸易规则矩阵".to_string(); + m +} + +fn cn_sg_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "SG".to_string(), + name: "中新双边贸易规则矩阵".to_string(), + relationship_description: "中国与新加坡之间的贸易关系,适用RCEP和CSFTA优惠税率,双边关系友好".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::Rcep, TradeAgreement::CsfTa], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::CsfTa, + mfn_rate_description: "新加坡对几乎所有商品实行0%关税(自由港)".to_string(), + preferential_rate_description: Some("CSFTA/RCEP:0%(新加坡本已是0%)".to_string()), + preferential_conditions: vec![ + "须提供CSFTA或RCEP原产地证书".to_string(), + ], + restricted_goods: vec![ + "武器弹药".to_string(), + "毒品".to_string(), + ], + anti_dumping_note: None, + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::CsfTa, + mfn_rate_description: "中国对新加坡商品MFN税率平均约9%".to_string(), + preferential_rate_description: Some("CSFTA优惠税率:大多数商品0%".to_string()), + preferential_conditions: vec![ + "须提供CSFTA原产地证书".to_string(), + ], + restricted_goods: vec![], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: true, + covered_sectors: vec![ + "电气和电子设备".to_string(), + "电信设备".to_string(), + ], + standard_systems: vec![ + "中国:GB/T国家标准、CCC认证".to_string(), + "新加坡:SS标准、SPRING Singapore认证".to_string(), + ], + compliance_notes: vec![ + "中新有电气设备MRA,部分产品可互认".to_string(), + "新加坡进口中国电气产品须符合SS标准".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: true, + bit_name: Some("中新双边投资协定(1985年,2009年修订)".to_string()), + investment_review: vec![ + "新加坡:EDB(经济发展局)审批(特定行业)".to_string(), + "中国:外资负面清单制度".to_string(), + ], + real_estate_restrictions: vec![ + "新加坡:外资购买私人住宅须缴纳ABSD 60%(2023年4月起)".to_string(), + "中国:外资购买住宅须有工作/学习证明".to_string(), + ], + financial_investment_restrictions: vec![ + "新加坡:MAS监管,金融机构须获MAS牌照".to_string(), + "中国:QFII/RQFII制度".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "SIAC仲裁院(新加坡)".to_string(), + "CIETAC仲裁委员会(北京)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: Some("中新司法协助安排(2018年)".to_string()), + judgment_enforcement_note: "中新有司法协助安排,判决执行相对便利;SIAC仲裁裁决在中国可执行".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "新加坡不动产上链须完成SLA产权登记".to_string(), + "外资须缴纳ABSD(60%,2023年4月起)".to_string(), + "中国不动产上链须完成不动产登记".to_string(), + ], + goods_requirements: vec![ + "可申请CSFTA或RCEP优惠税率".to_string(), + "须在TradeNet系统申报进口".to_string(), + "须符合新加坡产品安全要求".to_string(), + ], + ip_requirements: vec![ + "可通过PCT申请在中新两国获得专利保护".to_string(), + "新加坡预提税:0%(新加坡无预提税)".to_string(), + "中国预提税:10%(DTA可降低至7%)".to_string(), + ], + capital_flow_requirements: vec![ + "中国:外汇管理局审批".to_string(), + "新加坡:无外汇管制".to_string(), + ], + data_cross_border_requirements: vec![ + "中国:数据出境须安全评估".to_string(), + "新加坡:PDPA(个人数据保护法)".to_string(), + ], + }, + governing_law_recommendation: "建议选择新加坡法律(双方均认可,新加坡是中立法律中心)".to_string(), + risk_notes: vec![ + "新加坡ABSD大幅提高外资购房成本(60%)".to_string(), + "中国外汇管制可能影响资金跨境流动".to_string(), + "总体而言,中新贸易关系友好,风险较低".to_string(), + ], + } +} + +fn sg_cn_matrix() -> BilateralTradeMatrix { + let mut m = cn_sg_matrix(); + m.jurisdiction_a = "SG".to_string(); + m.jurisdiction_b = "CN".to_string(); + m.name = "新中双边贸易规则矩阵".to_string(); + m +} + +fn eu_us_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "EU".to_string(), + jurisdiction_b: "US".to_string(), + name: "欧美双边贸易规则矩阵".to_string(), + relationship_description: "欧盟与美国之间的贸易关系,适用WTO MFN税率,TTIP谈判已停滞,但双边贸易关系总体友好".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::WtoMfnOnly], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "美国对欧盟商品MFN税率平均约3.5%".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![ + "钢铁铝材(232条款,部分豁免)".to_string(), + "航空器(波音-空客补贴争端)".to_string(), + ], + anti_dumping_note: None, + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::WtoMfnOnly, + mfn_rate_description: "欧盟对美国商品MFN税率平均约5%".to_string(), + preferential_rate_description: None, + preferential_conditions: vec![], + restricted_goods: vec![], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: true, + covered_sectors: vec![ + "电信设备".to_string(), + "电磁兼容性(EMC)".to_string(), + "医疗器械".to_string(), + "制药GMP".to_string(), + ], + standard_systems: vec![ + "欧盟:CE认证、EN标准、REACH/RoHS".to_string(), + "美国:FCC/FDA/UL标准".to_string(), + ], + compliance_notes: vec![ + "欧美有MRA协议,部分行业可互认认证".to_string(), + "医疗器械MRA:欧盟CE与美国FDA有互认安排".to_string(), + "制药GMP:欧美互认GMP检查".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: false, + bit_name: None, + investment_review: vec![ + "美国:CFIUS审查(对欧盟投资通常不严格)".to_string(), + "欧盟:FDI审查框架".to_string(), + ], + real_estate_restrictions: vec![ + "总体无限制,部分州有特殊规定".to_string(), + ], + financial_investment_restrictions: vec![ + "总体自由,须遵守各自金融监管要求".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "ICC仲裁院(巴黎)".to_string(), + "AAA/ICDR仲裁(纽约)".to_string(), + "LCIA仲裁(伦敦)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: Some("欧美有海牙服务公约和证据公约".to_string()), + judgment_enforcement_note: "欧美之间无统一判决承认条约,但实践中执行相对便利;建议选择仲裁".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "欧盟不动产上链须完成各成员国土地登记".to_string(), + "美国不动产上链须完成产权保险和地契登记".to_string(), + "FIRPTA:外资卖方须预扣15%税款".to_string(), + ], + goods_requirements: vec![ + "须符合进口方产品安全认证(CE/FDA/FCC等)".to_string(), + "欧美有MRA,部分行业可互认认证".to_string(), + ], + ip_requirements: vec![ + "可通过PCT申请在欧美两地获得专利保护".to_string(), + "美国预提税:0%(欧美DTA通常为0%)".to_string(), + ], + capital_flow_requirements: vec![ + "欧美之间资本自由流动,须遵守反洗钱规定".to_string(), + "须遵守OFAC制裁规定".to_string(), + ], + data_cross_border_requirements: vec![ + "欧盟:GDPR,数据传输至美国须有充分保护措施(EU-US DPF框架)".to_string(), + "美国:CLOUD Act".to_string(), + ], + }, + governing_law_recommendation: "建议选择英格兰和威尔士法律(普通法,中立,国际商业合同常用)或纽约州法律".to_string(), + risk_notes: vec![ + "GDPR合规是欧美数据跨境的主要风险".to_string(), + "TTIP谈判停滞,双边无全面自贸协定".to_string(), + "总体而言,欧美贸易关系友好,风险较低".to_string(), + ], + } +} + +fn us_eu_matrix() -> BilateralTradeMatrix { + let mut m = eu_us_matrix(); + m.jurisdiction_a = "US".to_string(); + m.jurisdiction_b = "EU".to_string(); + m.name = "美欧双边贸易规则矩阵".to_string(); + m +} + +fn eu_jp_matrix() -> BilateralTradeMatrix { + BilateralTradeMatrix { + jurisdiction_a: "EU".to_string(), + jurisdiction_b: "JP".to_string(), + name: "欧日双边贸易规则矩阵".to_string(), + relationship_description: "欧盟与日本之间的贸易关系,适用EU-Japan EPA优惠税率(2019年生效),双边关系友好".to_string(), + trade_agreements: vec![TradeAgreement::Wto, TradeAgreement::EuJapanEpa], + tariff_a_to_b: TariffRule { + agreement: TradeAgreement::EuJapanEpa, + mfn_rate_description: "日本对欧盟商品MFN税率平均约4%".to_string(), + preferential_rate_description: Some("EU-Japan EPA优惠税率:逐步降至0%(大多数商品已为0%)".to_string()), + preferential_conditions: vec![ + "须提供EPA原产地声明(发票声明或EUR.1)".to_string(), + "须满足EPA原产地规则".to_string(), + ], + restricted_goods: vec![ + "大米(高关税保护)".to_string(), + "乳制品(部分保留关税)".to_string(), + ], + anti_dumping_note: None, + }, + tariff_b_to_a: TariffRule { + agreement: TradeAgreement::EuJapanEpa, + mfn_rate_description: "欧盟对日本商品MFN税率平均约5%".to_string(), + preferential_rate_description: Some("EU-Japan EPA优惠税率:逐步降至0%".to_string()), + preferential_conditions: vec![ + "须提供EPA原产地声明".to_string(), + ], + restricted_goods: vec![], + anti_dumping_note: None, + }, + technical_standards: TechnicalStandardMutualRecognition { + formal_mra: true, + covered_sectors: vec![ + "电信设备".to_string(), + "电磁兼容性(EMC)".to_string(), + "汽车(UNECE法规互认)".to_string(), + ], + standard_systems: vec![ + "欧盟:CE认证、EN标准".to_string(), + "日本:JIS标准、PSE/PSC认证".to_string(), + ], + compliance_notes: vec![ + "欧日EPA包含监管合作章节".to_string(), + "汽车:双方均采用UNECE法规,互认程度较高".to_string(), + "电信设备:有MRA安排".to_string(), + ], + }, + investment_rules: InvestmentRules { + has_bit: true, + bit_name: Some("EU-Japan EPA投资章节(含投资保护条款)".to_string()), + investment_review: vec![ + "日本:外为法审查(特定敏感行业)".to_string(), + "欧盟:FDI审查框架".to_string(), + ], + real_estate_restrictions: vec![ + "日本:外资可自由购买不动产,须遵守外为法申报".to_string(), + "欧盟:通常无限制".to_string(), + ], + financial_investment_restrictions: vec![ + "日本:特定敏感行业须事前申报".to_string(), + "欧盟:资本自由流动原则".to_string(), + ], + }, + dispute_resolution: DisputeResolutionMechanism { + recommended_arbitration: vec![ + "ICC仲裁院(巴黎)".to_string(), + "JCAA仲裁院(东京)".to_string(), + "LCIA仲裁(伦敦)".to_string(), + ], + both_new_york_convention: true, + judicial_assistance: Some("欧日有海牙服务公约".to_string()), + judgment_enforcement_note: "欧日之间无统一判决承认条约,建议选择仲裁".to_string(), + }, + rwa_requirements: BilateralRwaRequirements { + real_estate_requirements: vec![ + "欧盟不动产上链须完成各成员国土地登记".to_string(), + "日本不动产上链须完成法务局登记".to_string(), + "日本外资须遵守外为法申报要求".to_string(), + ], + goods_requirements: vec![ + "可申请EU-Japan EPA优惠税率(须提供原产地声明)".to_string(), + "汽车类商品可享受UNECE法规互认".to_string(), + ], + ip_requirements: vec![ + "可通过PCT申请在欧日两地获得专利保护".to_string(), + "日本预提税:0%(欧日DTA通常为0%)".to_string(), + "欧盟预提税:0%(利息和版税指令)".to_string(), + ], + capital_flow_requirements: vec![ + "欧日之间资本自由流动".to_string(), + "日本:外为法申报(超过一定金额)".to_string(), + ], + data_cross_border_requirements: vec![ + "欧盟:GDPR,日本被欧盟认定为充分保护国,数据传输相对便利".to_string(), + "日本:APPI(个人信息保护法)".to_string(), + ], + }, + governing_law_recommendation: "建议选择英格兰和威尔士法律或新加坡法律(中立)".to_string(), + risk_notes: vec![ + "EU-Japan EPA是目前全球最大的自贸协定之一,贸易条件优越".to_string(), + "日本被欧盟认定为GDPR充分保护国,数据跨境便利".to_string(), + "总体而言,欧日贸易关系友好,风险较低".to_string(), + ], + } +} + +fn jp_eu_matrix() -> BilateralTradeMatrix { + let mut m = eu_jp_matrix(); + m.jurisdiction_a = "JP".to_string(); + m.jurisdiction_b = "EU".to_string(); + m.name = "日欧双边贸易规则矩阵".to_string(); + m +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_all_pairs_available() { + let pairs = list_available_pairs(); + assert_eq!(pairs.len(), 12); + } + + #[test] + fn test_cn_eu_matrix_exists() { + let m = get_bilateral_matrix("CN", "EU"); + assert!(m.is_some()); + let m = m.unwrap(); + assert_eq!(m.jurisdiction_a, "CN"); + assert_eq!(m.jurisdiction_b, "EU"); + } + + #[test] + fn test_cn_us_matrix_has_301_tariff_risk() { + let m = get_bilateral_matrix("CN", "US").unwrap(); + // 中美贸易矩阵必须包含301条款风险提示 + assert!(m.risk_notes.iter().any(|n| n.contains("301"))); + } + + #[test] + fn test_cn_jp_matrix_has_rcep() { + let m = get_bilateral_matrix("CN", "JP").unwrap(); + // 中日贸易矩阵必须包含RCEP协定 + assert!(m.trade_agreements.contains(&TradeAgreement::Rcep)); + } + + #[test] + fn test_eu_jp_matrix_has_epa() { + let m = get_bilateral_matrix("EU", "JP").unwrap(); + // 欧日贸易矩阵必须包含EPA协定 + assert!(m.trade_agreements.contains(&TradeAgreement::EuJapanEpa)); + } + + #[test] + fn test_cn_sg_matrix_has_csfta() { + let m = get_bilateral_matrix("CN", "SG").unwrap(); + // 中新贸易矩阵必须包含CSFTA协定 + assert!(m.trade_agreements.contains(&TradeAgreement::CsfTa)); + } + + #[test] + fn test_cn_us_matrix_has_cfius_risk() { + let m = get_bilateral_matrix("CN", "US").unwrap(); + // 中美投资规则必须提及CFIUS + assert!(m.investment_rules.investment_review.iter().any(|r| r.contains("CFIUS"))); + } + + #[test] + fn test_all_matrices_have_arbitration() { + let pairs = list_available_pairs(); + for (a, b) in pairs { + let m = get_bilateral_matrix(a, b).unwrap(); + assert!(!m.dispute_resolution.recommended_arbitration.is_empty(), + "{}-{} 矩阵缺少仲裁建议", a, b); + } + } + + #[test] + fn test_all_matrices_both_new_york_convention() { + let pairs = list_available_pairs(); + for (a, b) in pairs { + let m = get_bilateral_matrix(a, b).unwrap(); + assert!(m.dispute_resolution.both_new_york_convention, + "{}-{} 矩阵未标注纽约公约成员", a, b); + } + } + + #[test] + fn test_all_matrices_have_rwa_requirements() { + let pairs = list_available_pairs(); + for (a, b) in pairs { + let m = get_bilateral_matrix(a, b).unwrap(); + assert!(!m.rwa_requirements.goods_requirements.is_empty(), + "{}-{} 矩阵缺少商品RWA要求", a, b); + assert!(!m.rwa_requirements.capital_flow_requirements.is_empty(), + "{}-{} 矩阵缺少资金跨境要求", a, b); + } + } + + #[test] + fn test_reversed_pairs_exist() { + // 确保所有贸易对都有双向矩阵 + assert!(get_bilateral_matrix("EU", "CN").is_some()); + assert!(get_bilateral_matrix("JP", "CN").is_some()); + assert!(get_bilateral_matrix("US", "CN").is_some()); + assert!(get_bilateral_matrix("SG", "CN").is_some()); + assert!(get_bilateral_matrix("US", "EU").is_some()); + assert!(get_bilateral_matrix("JP", "EU").is_some()); + } + + #[test] + fn test_cn_eu_has_data_cross_border_requirements() { + let m = get_bilateral_matrix("CN", "EU").unwrap(); + // 中欧必须有数据跨境要求(GDPR相关) + assert!(m.rwa_requirements.data_cross_border_requirements.iter().any(|r| r.contains("GDPR"))); + } + + #[test] + fn test_eu_jp_data_adequacy() { + let m = get_bilateral_matrix("EU", "JP").unwrap(); + // 欧日数据跨境:日本是GDPR充分保护国 + assert!(m.rwa_requirements.data_cross_border_requirements.iter().any(|r| r.contains("充分保护"))); + } +} diff --git a/nac-rwa-contract-templates/Cargo.lock b/nac-rwa-contract-templates/Cargo.lock new file mode 100644 index 0000000..3a391e3 --- /dev/null +++ b/nac-rwa-contract-templates/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "nac-rwa-contract-templates" +version = "1.0.0" +dependencies = [ + "nac-rwa-legal-model", + "serde", + "thiserror", +] + +[[package]] +name = "nac-rwa-legal-model" +version = "1.0.0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/nac-rwa-contract-templates/Cargo.toml b/nac-rwa-contract-templates/Cargo.toml new file mode 100644 index 0000000..11834dc --- /dev/null +++ b/nac-rwa-contract-templates/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "nac-rwa-contract-templates" +version = "1.0.0" +edition = "2021" +description = "NAC RWA 全球合约模板库 — 不动产买卖、商品跨境买卖、知识产权许可" +authors = ["NAC Development Team"] + +[lib] +name = "nac_rwa_contract_templates" +path = "src/lib.rs" + +[lints.rust] +warnings = "deny" + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" +nac-rwa-legal-model = { path = "../nac-rwa-legal-model" } diff --git a/nac-rwa-contract-templates/src/goods_trade.rs b/nac-rwa-contract-templates/src/goods_trade.rs new file mode 100644 index 0000000..859339f --- /dev/null +++ b/nac-rwa-contract-templates/src/goods_trade.rs @@ -0,0 +1,613 @@ +// 商品跨境买卖合约模板 +// 覆盖主要贸易对:CN-US, CN-EU, CN-JP, CN-SG, EU-US, EU-JP, US-JP +// 所有跨境商品合约均基于 Incoterms 2020 和 UCC/CISG + +use crate::{ContractField, ContractTemplate, ContractTemplateType, FieldType}; + +pub fn get_cross_border_template(seller: &str, buyer: &str) -> Option { + let pair = format!("{}-{}", seller.to_uppercase(), buyer.to_uppercase()); + match pair.as_str() { + "CN-US" => Some(cn_us_template()), + "US-CN" => Some(cn_us_template_reversed()), + "CN-EU" | "CN-DE" | "CN-FR" => Some(cn_eu_template()), + "EU-CN" | "DE-CN" | "FR-CN" => Some(eu_cn_template()), + "CN-JP" => Some(cn_jp_template()), + "JP-CN" => Some(jp_cn_template()), + "CN-SG" => Some(cn_sg_template()), + "SG-CN" => Some(sg_cn_template()), + "EU-US" | "DE-US" | "FR-US" => Some(eu_us_template()), + "US-EU" | "US-DE" | "US-FR" => Some(us_eu_template()), + "EU-JP" | "DE-JP" | "FR-JP" => Some(eu_jp_template()), + "JP-EU" | "JP-DE" | "JP-FR" => Some(jp_eu_template()), + _ => None, + } +} + +fn common_cross_border_fields(seller_currency: &str, buyer_jurisdiction: &str) -> Vec { + vec![ + ContractField { + name: "seller_name".to_string(), + label: "卖方名称(Seller)".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定名称".to_string(), + legal_basis: Some("CISG Article 14".to_string()), + example: None, + }, + ContractField { + name: "seller_address".to_string(), + label: "卖方地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "卖方完整营业地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "买方名称(Buyer)".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定名称".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_address".to_string(), + label: "买方地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "买方完整营业地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "goods_description".to_string(), + label: "货物描述(Description of Goods)".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物的详细描述,含品名、规格、型号".to_string(), + legal_basis: Some("CISG Article 35".to_string()), + example: None, + }, + ContractField { + name: "hs_code".to_string(), + label: "HS编码(Harmonized System Code)".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物的海关商品编码,用于报关和关税计算".to_string(), + legal_basis: Some("《协调制度公约》".to_string()), + example: Some("8471.30(便携式计算机)".to_string()), + }, + ContractField { + name: "quantity".to_string(), + label: "数量及单位".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物数量和计量单位".to_string(), + legal_basis: None, + example: Some("1000 PCS / 50 MT".to_string()), + }, + ContractField { + name: "unit_price".to_string(), + label: "单价".to_string(), + field_type: FieldType::Currency { currency_code: seller_currency.to_string() }, + required: true, + description: "每单位货物的价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "total_amount".to_string(), + label: "合同总金额".to_string(), + field_type: FieldType::Currency { currency_code: seller_currency.to_string() }, + required: true, + description: "合同总金额".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "incoterms".to_string(), + label: "贸易术语(Incoterms 2020)".to_string(), + field_type: FieldType::Enum(vec![ + "EXW(工厂交货)".to_string(), + "FCA(货交承运人)".to_string(), + "FOB(船上交货)".to_string(), + "CFR(成本加运费)".to_string(), + "CIF(成本加保险费加运费)".to_string(), + "DAP(目的地交货)".to_string(), + "DDP(完税后交货)".to_string(), + ]), + required: true, + description: "确定风险和费用转移点的贸易术语(Incoterms 2020)".to_string(), + legal_basis: Some("Incoterms 2020(ICC)".to_string()), + example: Some("FOB Shanghai".to_string()), + }, + ContractField { + name: "port_of_loading".to_string(), + label: "装运港(Port of Loading)".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物装船的港口".to_string(), + legal_basis: None, + example: Some("Shanghai, China".to_string()), + }, + ContractField { + name: "port_of_discharge".to_string(), + label: "目的港(Port of Discharge)".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物卸货的目的港".to_string(), + legal_basis: None, + example: Some(format!("Port in {}", buyer_jurisdiction)), + }, + ContractField { + name: "shipment_date".to_string(), + label: "装运日期(Shipment Date)".to_string(), + field_type: FieldType::Date, + required: true, + description: "货物装船的最迟日期".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "payment_terms".to_string(), + label: "付款方式(Payment Terms)".to_string(), + field_type: FieldType::Enum(vec![ + "信用证(L/C at sight)".to_string(), + "远期信用证(L/C 30/60/90 days)".to_string(), + "电汇(T/T)".to_string(), + "托收(D/P)".to_string(), + "赊销(O/A)".to_string(), + ]), + required: true, + description: "买方向卖方付款的方式".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "quality_standard".to_string(), + label: "质量标准".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物须符合的质量标准(如ISO、ASTM、GB等)".to_string(), + legal_basis: Some("CISG Article 35".to_string()), + example: None, + }, + ContractField { + name: "insurance".to_string(), + label: "保险(Insurance)".to_string(), + field_type: FieldType::Text, + required: true, + description: "货物运输保险安排(CIF条款下由卖方投保)".to_string(), + legal_basis: None, + example: Some("ICC (A) 110% of invoice value".to_string()), + }, + ContractField { + name: "force_majeure".to_string(), + label: "不可抗力条款(Force Majeure)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "是否包含不可抗力条款".to_string(), + legal_basis: Some("CISG Article 79".to_string()), + example: None, + }, + ] +} + +fn cn_us_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("USD", "US"); + fields.push(ContractField { + name: "export_license".to_string(), + label: "出口许可证(如需)".to_string(), + field_type: FieldType::Text, + required: true, + description: "受管制商品须提供中国商务部出口许可证".to_string(), + legal_basis: Some("《中华人民共和国出口管制法》".to_string()), + example: None, + }); + fields.push(ContractField { + name: "us_customs_bond".to_string(), + label: "美国海关担保(US Customs Bond)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "进口商须提供美国海关担保".to_string(), + legal_basis: Some("US CBP要求".to_string()), + example: None, + }); + fields.push(ContractField { + name: "anti_dumping_check".to_string(), + label: "反倾销/反补贴税确认".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "确认货物是否受美国反倾销或反补贴税令约束".to_string(), + legal_basis: Some("US ITC/DOC裁定".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-CN-US-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: Some("US".to_string()), + name: "中美跨境商品买卖合同(中国出口→美国进口)".to_string(), + description: "适用于中国出口商向美国进口商出售商品的跨境贸易合同".to_string(), + legal_system: "CISG(联合国国际货物销售合同公约)".to_string(), + required_fields: fields, + optional_fields: vec![ + ContractField { + name: "section_301_tariff".to_string(), + label: "301条款关税确认".to_string(), + field_type: FieldType::Text, + required: false, + description: "确认货物是否受美国301条款额外关税影响".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "原产地证明(Certificate of Origin / CO)".to_string(), + "检验证书(Inspection Certificate)".to_string(), + "保险单(Insurance Policy)".to_string(), + "出口报关单(中国海关)".to_string(), + "进口报关单(美国CBP)".to_string(), + ], + special_requirements: vec![ + "须遵守中国《出口管制法》,管制商品须申请出口许可证".to_string(), + "须遵守美国CBP进口要求,提前申报(ISF 10+2)".to_string(), + "须确认是否受美国301条款额外关税影响".to_string(), + "须确认是否受反倾销/反补贴税令约束".to_string(), + "须遵守美国FDA/FCC/CPSC等产品合规要求(视货物类型)".to_string(), + "须遵守OFAC制裁规定".to_string(), + ], + applicable_taxes: vec![ + "中国出口退税:视商品类型(0%-13%)".to_string(), + "美国进口关税:MFN税率+301条款附加税(7.5%-25%)".to_string(), + "美国进口增值税:无(美国无联邦VAT)".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交ICC仲裁(巴黎)或CIETAC仲裁(北京)".to_string(), + language_requirements: vec!["中文(正本)".to_string(), "英文(副本)".to_string()], + } +} + +fn cn_us_template_reversed() -> ContractTemplate { + let mut t = cn_us_template(); + t.template_id = "GT-US-CN-001".to_string(); + t.jurisdiction = "US".to_string(); + t.counterpart_jurisdiction = Some("CN".to_string()); + t.name = "美中跨境商品买卖合同(美国出口→中国进口)".to_string(); + t.description = "适用于美国出口商向中国进口商出售商品的跨境贸易合同".to_string(); + t +} + +fn cn_eu_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("EUR", "EU"); + fields.push(ContractField { + name: "ce_marking".to_string(), + label: "CE认证(CE Marking)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "进入欧盟市场的产品须符合CE认证要求".to_string(), + legal_basis: Some("欧盟产品安全指令".to_string()), + example: None, + }); + fields.push(ContractField { + name: "reach_compliance".to_string(), + label: "REACH合规".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "化学品须符合欧盟REACH法规要求".to_string(), + legal_basis: Some("EC 1907/2006".to_string()), + example: None, + }); + fields.push(ContractField { + name: "eu_customs_code".to_string(), + label: "欧盟海关编码(CN Code)".to_string(), + field_type: FieldType::Text, + required: true, + description: "欧盟组合命名法的商品编码".to_string(), + legal_basis: Some("欧盟关税法典(UCC)".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-CN-EU-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: Some("EU".to_string()), + name: "中欧跨境商品买卖合同(中国出口→欧盟进口)".to_string(), + description: "适用于中国出口商向欧盟进口商出售商品的跨境贸易合同".to_string(), + legal_system: "CISG(联合国国际货物销售合同公约)".to_string(), + required_fields: fields, + optional_fields: vec![ + ContractField { + name: "anti_dumping_eu".to_string(), + label: "欧盟反倾销税确认".to_string(), + field_type: FieldType::Text, + required: false, + description: "确认货物是否受欧盟反倾销税令约束".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "原产地证明(Certificate of Origin / Form A)".to_string(), + "检验证书(Inspection Certificate)".to_string(), + "保险单(Insurance Policy)".to_string(), + "出口报关单(中国海关)".to_string(), + "欧盟进口报关单(SAD)".to_string(), + "CE认证文件(如适用)".to_string(), + ], + special_requirements: vec![ + "须遵守中国《出口管制法》".to_string(), + "须符合欧盟产品安全要求(CE认证等)".to_string(), + "须符合欧盟REACH化学品法规(如适用)".to_string(), + "须遵守欧盟关税法典(UCC)进口要求".to_string(), + "须确认是否受欧盟反倾销税令约束".to_string(), + "须符合欧盟海关进口安全申报(ICS2)".to_string(), + ], + applicable_taxes: vec![ + "中国出口退税:视商品类型(0%-13%)".to_string(), + "欧盟进口关税:MFN税率(视商品)".to_string(), + "欧盟进口增值税:各成员国不同(约20%)".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交ICC仲裁(巴黎)或CIETAC仲裁(北京)".to_string(), + language_requirements: vec!["中文(正本)".to_string(), "英文(副本)".to_string()], + } +} + +fn eu_cn_template() -> ContractTemplate { + let mut t = cn_eu_template(); + t.template_id = "GT-EU-CN-001".to_string(); + t.jurisdiction = "EU".to_string(); + t.counterpart_jurisdiction = Some("CN".to_string()); + t.name = "欧中跨境商品买卖合同(欧盟出口→中国进口)".to_string(); + t.description = "适用于欧盟出口商向中国进口商出售商品的跨境贸易合同".to_string(); + t +} + +fn cn_jp_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("JPY", "JP"); + fields.push(ContractField { + name: "pse_compliance".to_string(), + label: "PSE认证(日本电气安全)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "电气产品进入日本市场须符合PSE认证".to_string(), + legal_basis: Some("《电气用品安全法》(DENAN)".to_string()), + example: None, + }); + fields.push(ContractField { + name: "food_sanitation".to_string(), + label: "食品卫生法合规(如适用)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "食品类商品须符合日本《食品卫生法》".to_string(), + legal_basis: Some("《食品卫生法》".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-CN-JP-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: Some("JP".to_string()), + name: "中日跨境商品买卖合同(中国出口→日本进口)".to_string(), + description: "适用于中国出口商向日本进口商出售商品的跨境贸易合同,适用RCEP优惠税率".to_string(), + legal_system: "CISG(联合国国际货物销售合同公约)".to_string(), + required_fields: fields, + optional_fields: vec![ + ContractField { + name: "rcep_origin_cert".to_string(), + label: "RCEP原产地证书".to_string(), + field_type: FieldType::Text, + required: false, + description: "申请RCEP优惠税率须提供RCEP原产地证书".to_string(), + legal_basis: Some("RCEP协议".to_string()), + example: None, + }, + ], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "原产地证明(Certificate of Origin)".to_string(), + "检验证书(Inspection Certificate)".to_string(), + "保险单(Insurance Policy)".to_string(), + "出口报关单(中国海关)".to_string(), + "日本进口申报书".to_string(), + ], + special_requirements: vec![ + "须遵守中国《出口管制法》".to_string(), + "须符合日本产品安全要求(PSE/PSC等)".to_string(), + "可申请RCEP优惠税率(须提供RCEP原产地证书)".to_string(), + "食品类须符合日本《食品卫生法》".to_string(), + "须遵守日本海关进口申报要求".to_string(), + ], + applicable_taxes: vec![ + "中国出口退税:视商品类型(0%-13%)".to_string(), + "日本进口关税:MFN税率或RCEP优惠税率".to_string(), + "日本消费税:10%".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交JCAA仲裁(东京)或CIETAC仲裁(北京)".to_string(), + language_requirements: vec!["中文(正本)".to_string(), "日文(副本)".to_string()], + } +} + +fn jp_cn_template() -> ContractTemplate { + let mut t = cn_jp_template(); + t.template_id = "GT-JP-CN-001".to_string(); + t.jurisdiction = "JP".to_string(); + t.counterpart_jurisdiction = Some("CN".to_string()); + t.name = "日中跨境商品买卖合同(日本出口→中国进口)".to_string(); + t +} + +fn cn_sg_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("SGD", "SG"); + fields.push(ContractField { + name: "rcep_cert".to_string(), + label: "RCEP原产地证书".to_string(), + field_type: FieldType::Text, + required: true, + description: "申请RCEP优惠税率须提供原产地证书".to_string(), + legal_basis: Some("RCEP协议".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-CN-SG-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: Some("SG".to_string()), + name: "中新跨境商品买卖合同(中国出口→新加坡进口)".to_string(), + description: "适用于中国出口商向新加坡进口商出售商品,适用RCEP/CSFTA优惠税率".to_string(), + legal_system: "CISG".to_string(), + required_fields: fields, + optional_fields: vec![], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "原产地证明(CO)".to_string(), + "检验证书".to_string(), + "保险单".to_string(), + "出口报关单(中国海关)".to_string(), + "新加坡进口许可证(如适用)".to_string(), + ], + special_requirements: vec![ + "可申请CSFTA(中新自贸协定)或RCEP优惠税率".to_string(), + "须遵守新加坡海关进口申报要求(TradeNet系统)".to_string(), + "须符合新加坡产品安全要求(SPRING Singapore)".to_string(), + ], + applicable_taxes: vec![ + "新加坡进口关税:大多数商品0%(自由港)".to_string(), + "新加坡GST:9%(2024年起)".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交SIAC仲裁(新加坡)或CIETAC仲裁(北京)".to_string(), + language_requirements: vec!["中文(正本)".to_string(), "英文(副本)".to_string()], + } +} + +fn sg_cn_template() -> ContractTemplate { + let mut t = cn_sg_template(); + t.template_id = "GT-SG-CN-001".to_string(); + t.jurisdiction = "SG".to_string(); + t.counterpart_jurisdiction = Some("CN".to_string()); + t.name = "新中跨境商品买卖合同(新加坡出口→中国进口)".to_string(); + t +} + +fn eu_us_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("USD", "US"); + fields.push(ContractField { + name: "us_fda_compliance".to_string(), + label: "美国FDA合规(如适用)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "食品、药品、医疗器械须符合FDA要求".to_string(), + legal_basis: Some("US FDA法规".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-EU-US-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "EU".to_string(), + counterpart_jurisdiction: Some("US".to_string()), + name: "欧美跨境商品买卖合同(欧盟出口→美国进口)".to_string(), + description: "适用于欧盟出口商向美国进口商出售商品".to_string(), + legal_system: "CISG".to_string(), + required_fields: fields, + optional_fields: vec![], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "EUR.1原产地证书(欧盟出口)".to_string(), + "检验证书".to_string(), + "保险单".to_string(), + "美国进口报关单(CBP Form 3461)".to_string(), + ], + special_requirements: vec![ + "须符合美国CBP进口要求(ISF 10+2)".to_string(), + "须符合美国产品安全要求(FDA/FCC/CPSC等)".to_string(), + "须遵守OFAC制裁规定".to_string(), + ], + applicable_taxes: vec![ + "美国进口关税:MFN税率(欧盟商品)".to_string(), + "美国无联邦VAT".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交ICC仲裁(巴黎)或AAA仲裁(纽约)".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn us_eu_template() -> ContractTemplate { + let mut t = eu_us_template(); + t.template_id = "GT-US-EU-001".to_string(); + t.jurisdiction = "US".to_string(); + t.counterpart_jurisdiction = Some("EU".to_string()); + t.name = "美欧跨境商品买卖合同(美国出口→欧盟进口)".to_string(); + t +} + +fn eu_jp_template() -> ContractTemplate { + let mut fields = common_cross_border_fields("EUR", "JP"); + fields.push(ContractField { + name: "epa_cert".to_string(), + label: "欧日EPA原产地证书".to_string(), + field_type: FieldType::Text, + required: true, + description: "申请欧日EPA优惠税率须提供原产地声明".to_string(), + legal_basis: Some("EU-Japan EPA(2019年生效)".to_string()), + example: None, + }); + + ContractTemplate { + template_id: "GT-EU-JP-001".to_string(), + template_type: ContractTemplateType::GoodsSaleCrossBorder, + jurisdiction: "EU".to_string(), + counterpart_jurisdiction: Some("JP".to_string()), + name: "欧日跨境商品买卖合同(欧盟出口→日本进口)".to_string(), + description: "适用于欧盟出口商向日本进口商出售商品,适用EU-Japan EPA优惠税率".to_string(), + legal_system: "CISG".to_string(), + required_fields: fields, + optional_fields: vec![], + required_attachments: vec![ + "商业发票(Commercial Invoice)".to_string(), + "装箱单(Packing List)".to_string(), + "提单(Bill of Lading / B/L)".to_string(), + "EPA原产地声明(EUR.1或发票声明)".to_string(), + "检验证书".to_string(), + "保险单".to_string(), + "日本进口申报书".to_string(), + ], + special_requirements: vec![ + "可申请EU-Japan EPA优惠税率(须提供原产地声明)".to_string(), + "须符合日本产品安全要求".to_string(), + "须遵守日本海关进口申报要求".to_string(), + ], + applicable_taxes: vec![ + "日本进口关税:EPA优惠税率(逐步降至0%)".to_string(), + "日本消费税:10%".to_string(), + ], + dispute_resolution_suggestion: "适用CISG;争议提交ICC仲裁(巴黎)或JCAA仲裁(东京)".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn jp_eu_template() -> ContractTemplate { + let mut t = eu_jp_template(); + t.template_id = "GT-JP-EU-001".to_string(); + t.jurisdiction = "JP".to_string(); + t.counterpart_jurisdiction = Some("EU".to_string()); + t.name = "日欧跨境商品买卖合同(日本出口→欧盟进口)".to_string(); + t +} diff --git a/nac-rwa-contract-templates/src/ip_license.rs b/nac-rwa-contract-templates/src/ip_license.rs new file mode 100644 index 0000000..4507f87 --- /dev/null +++ b/nac-rwa-contract-templates/src/ip_license.rs @@ -0,0 +1,452 @@ +// 知识产权许可合约模板 +// 覆盖:CN/US/EU/JP 作为许可方,各辖区作为被许可方 +// 涵盖:专利许可、商标许可、版权许可、技术秘密许可 + +use crate::{ContractField, ContractTemplate, ContractTemplateType, FieldType}; + +pub fn get_template(licensor: &str, licensee: &str) -> Option { + let pair = format!("{}-{}", licensor.to_uppercase(), licensee.to_uppercase()); + match pair.as_str() { + "CN-US" | "CN-EU" | "CN-JP" | "CN-SG" | "CN-HK" | "CN-AE" | "CN-AU" | "CN-GB" | "CN-KR" => { + Some(cn_licensor_template(licensee)) + } + "US-CN" | "US-EU" | "US-JP" | "US-SG" | "US-HK" | "US-AE" | "US-AU" | "US-GB" | "US-KR" => { + Some(us_licensor_template(licensee)) + } + "EU-CN" | "EU-US" | "EU-JP" | "EU-SG" | "EU-HK" | "EU-AE" | "EU-AU" | "EU-GB" | "EU-KR" => { + Some(eu_licensor_template(licensee)) + } + "JP-CN" | "JP-US" | "JP-EU" | "JP-SG" | "JP-HK" | "JP-AE" | "JP-AU" | "JP-GB" | "JP-KR" => { + Some(jp_licensor_template(licensee)) + } + _ => None, + } +} + +fn common_ip_fields(licensor_jurisdiction: &str, licensee_jurisdiction: &str) -> Vec { + vec![ + ContractField { + name: "licensor_name".to_string(), + label: "许可方名称(Licensor)".to_string(), + field_type: FieldType::Text, + required: true, + description: "知识产权所有人的完整法定名称".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "licensor_jurisdiction".to_string(), + label: "许可方注册地".to_string(), + field_type: FieldType::Text, + required: true, + description: "许可方的法律注册地".to_string(), + legal_basis: None, + example: Some(licensor_jurisdiction.to_string()), + }, + ContractField { + name: "licensee_name".to_string(), + label: "被许可方名称(Licensee)".to_string(), + field_type: FieldType::Text, + required: true, + description: "获得许可的一方的完整法定名称".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "licensee_jurisdiction".to_string(), + label: "被许可方注册地".to_string(), + field_type: FieldType::Text, + required: true, + description: "被许可方的法律注册地".to_string(), + legal_basis: None, + example: Some(licensee_jurisdiction.to_string()), + }, + ContractField { + name: "ip_type".to_string(), + label: "知识产权类型".to_string(), + field_type: FieldType::Enum(vec![ + "发明专利".to_string(), + "实用新型专利".to_string(), + "外观设计专利".to_string(), + "商标".to_string(), + "版权/著作权".to_string(), + "技术秘密/商业秘密".to_string(), + "软件著作权".to_string(), + "集成电路布图设计".to_string(), + ]), + required: true, + description: "被许可的知识产权类型".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "ip_registration_no".to_string(), + label: "知识产权登记号/申请号".to_string(), + field_type: FieldType::Text, + required: true, + description: "专利号、商标注册号或版权登记号".to_string(), + legal_basis: None, + example: Some("CN202310000001.X(中国专利)".to_string()), + }, + ContractField { + name: "ip_description".to_string(), + label: "知识产权描述".to_string(), + field_type: FieldType::Text, + required: true, + description: "被许可知识产权的详细描述".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "license_scope".to_string(), + label: "许可范围(License Scope)".to_string(), + field_type: FieldType::Text, + required: true, + description: "被许可的具体使用范围,包括产品类型、用途、地域等".to_string(), + legal_basis: None, + example: Some("仅限在中国大陆地区用于生产和销售XX产品".to_string()), + }, + ContractField { + name: "license_type".to_string(), + label: "许可类型".to_string(), + field_type: FieldType::Enum(vec![ + "独占许可(Exclusive License)".to_string(), + "排他许可(Sole License)".to_string(), + "普通许可(Non-exclusive License)".to_string(), + "分许可(Sub-license)".to_string(), + ]), + required: true, + description: "许可的排他性程度".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "license_territory".to_string(), + label: "许可地域(Territory)".to_string(), + field_type: FieldType::Text, + required: true, + description: "被许可方可使用该知识产权的地理范围".to_string(), + legal_basis: None, + example: Some("中华人民共和国大陆地区".to_string()), + }, + ContractField { + name: "license_term".to_string(), + label: "许可期限".to_string(), + field_type: FieldType::Text, + required: true, + description: "许可合同的有效期".to_string(), + legal_basis: None, + example: Some("自合同签署之日起5年".to_string()), + }, + ContractField { + name: "royalty_rate".to_string(), + label: "许可费/版税(Royalty)".to_string(), + field_type: FieldType::Percentage, + required: true, + description: "被许可方向许可方支付的许可费率(占净销售额的百分比)".to_string(), + legal_basis: None, + example: Some("净销售额的5%".to_string()), + }, + ContractField { + name: "minimum_royalty".to_string(), + label: "最低许可费(Minimum Royalty)".to_string(), + field_type: FieldType::Currency { currency_code: "USD".to_string() }, + required: true, + description: "每年须支付的最低许可费".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "royalty_payment_schedule".to_string(), + label: "许可费支付周期".to_string(), + field_type: FieldType::Enum(vec![ + "按季度支付".to_string(), + "按半年支付".to_string(), + "按年支付".to_string(), + "一次性支付".to_string(), + ]), + required: true, + description: "许可费的支付频率".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "sublicense_allowed".to_string(), + label: "是否允许分许可".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "被许可方是否有权向第三方再次许可".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "improvement_ownership".to_string(), + label: "改进成果归属".to_string(), + field_type: FieldType::Enum(vec![ + "归许可方所有".to_string(), + "归被许可方所有".to_string(), + "双方共同所有".to_string(), + "各自独立所有".to_string(), + ]), + required: true, + description: "被许可方对许可知识产权的改进成果归属".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "confidentiality".to_string(), + label: "保密条款".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "是否包含保密义务".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "governing_law".to_string(), + label: "适用法律(Governing Law)".to_string(), + field_type: FieldType::Text, + required: true, + description: "合同适用的法律".to_string(), + legal_basis: None, + example: Some("中华人民共和国法律".to_string()), + }, + ] +} + +fn cn_licensor_template(licensee: &str) -> ContractTemplate { + let mut fields = common_ip_fields("CN", licensee); + fields.push(ContractField { + name: "cnipa_registration".to_string(), + label: "国家知识产权局备案".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "中国专利/商标许可合同须在CNIPA备案".to_string(), + legal_basis: Some("《专利法》第12条、《商标法》第43条".to_string()), + example: None, + }); + fields.push(ContractField { + name: "technology_export_control".to_string(), + label: "技术出口管制确认".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "确认技术是否属于中国限制或禁止出口的技术目录".to_string(), + legal_basis: Some("《技术进出口管理条例》".to_string()), + example: None, + }); + fields.push(ContractField { + name: "withholding_tax_cn".to_string(), + label: "预提税(中国)".to_string(), + field_type: FieldType::Percentage, + required: true, + description: "向境外支付许可费须预扣中国预提税(通常10%,DTA可降低)".to_string(), + legal_basis: Some("《企业所得税法》第3条".to_string()), + example: Some("10%(无DTA)/ 5%-7%(有DTA)".to_string()), + }); + + ContractTemplate { + template_id: format!("IP-CN-{}-001", licensee), + template_type: ContractTemplateType::IpLicense, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: Some(licensee.to_string()), + name: format!("中国知识产权许可合同(中国→{})", licensee), + description: "适用于中国知识产权所有人向境外被许可方授权使用".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: fields, + optional_fields: vec![ + ContractField { + name: "quality_control".to_string(), + label: "质量控制条款(商标许可)".to_string(), + field_type: FieldType::Text, + required: false, + description: "商标许可须包含许可方对被许可方产品质量的控制条款".to_string(), + legal_basis: Some("《商标法》第43条".to_string()), + example: None, + }, + ], + required_attachments: vec![ + "知识产权权属证明(专利证书/商标注册证/版权登记证)".to_string(), + "技术出口许可证(受管制技术)".to_string(), + "CNIPA备案回执(专利/商标许可)".to_string(), + ], + special_requirements: vec![ + "专利/商标许可合同须在CNIPA备案".to_string(), + "受管制技术须申请技术出口许可证".to_string(), + "向境外支付许可费须预扣中国预提税(10%,DTA可降低)".to_string(), + "须遵守中国《反垄断法》关于许可条款的规定".to_string(), + ], + applicable_taxes: vec![ + "中国预提税:10%(无DTA)/ DTA国家可降低至5%-7%".to_string(), + "增值税:6%(技术服务)".to_string(), + ], + dispute_resolution_suggestion: "适用中华人民共和国法律;争议提交CIETAC仲裁(北京)".to_string(), + language_requirements: vec!["中文(正本)".to_string(), "英文(副本)".to_string()], + } +} + +fn us_licensor_template(licensee: &str) -> ContractTemplate { + let mut fields = common_ip_fields("US", licensee); + fields.push(ContractField { + name: "us_export_control".to_string(), + label: "美国出口管制确认(EAR/ITAR)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "确认技术是否受EAR(商务部)或ITAR(国务部)管制".to_string(), + legal_basis: Some("Export Administration Regulations (EAR) / ITAR".to_string()), + example: None, + }); + fields.push(ContractField { + name: "us_withholding_tax".to_string(), + label: "美国预提税".to_string(), + field_type: FieldType::Percentage, + required: true, + description: "向境外支付许可费须预扣美国预提税(通常30%,DTA可降低)".to_string(), + legal_basis: Some("IRC §1441".to_string()), + example: Some("30%(无DTA)/ DTA国家可降低至0%-15%".to_string()), + }); + fields.push(ContractField { + name: "ofac_compliance".to_string(), + label: "OFAC制裁合规".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "确认被许可方不在OFAC制裁名单上".to_string(), + legal_basis: Some("OFAC regulations".to_string()), + example: None, + }); + + ContractTemplate { + template_id: format!("IP-US-{}-001", licensee), + template_type: ContractTemplateType::IpLicense, + jurisdiction: "US".to_string(), + counterpart_jurisdiction: Some(licensee.to_string()), + name: format!("美国知识产权许可协议(美国→{})", licensee), + description: "适用于美国知识产权所有人向境外被许可方授权使用".to_string(), + legal_system: "普通法系".to_string(), + required_fields: fields, + optional_fields: vec![ + ContractField { + name: "most_favored_licensee".to_string(), + label: "最惠被许可方条款".to_string(), + field_type: FieldType::Boolean, + required: false, + description: "是否给予被许可方最惠被许可方待遇".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "美国专利证书/商标注册证/版权登记证".to_string(), + "出口许可证(EAR/ITAR管制技术)".to_string(), + "OFAC合规声明".to_string(), + ], + special_requirements: vec![ + "受EAR/ITAR管制的技术须申请出口许可证".to_string(), + "须确认被许可方不在OFAC制裁名单上".to_string(), + "向境外支付许可费须预扣美国预提税(30%,DTA可降低)".to_string(), + "须遵守美国反垄断法(Sherman Act)关于许可条款的规定".to_string(), + ], + applicable_taxes: vec![ + "美国预提税:30%(无DTA)/ DTA国家可降低至0%-15%".to_string(), + ], + dispute_resolution_suggestion: "适用美国法律(特拉华州);争议提交AAA仲裁(纽约)或WIPO仲裁".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn eu_licensor_template(licensee: &str) -> ContractTemplate { + let mut fields = common_ip_fields("EU", licensee); + fields.push(ContractField { + name: "eu_block_exemption".to_string(), + label: "欧盟技术转让块豁免(TTBER)合规".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "确认许可条款符合欧盟技术转让块豁免条例(TTBER)".to_string(), + legal_basis: Some("EU Regulation 316/2014 (TTBER)".to_string()), + example: None, + }); + fields.push(ContractField { + name: "eu_withholding_tax".to_string(), + label: "欧盟预提税".to_string(), + field_type: FieldType::Percentage, + required: true, + description: "欧盟成员国向境外支付许可费的预提税率(各国不同)".to_string(), + legal_basis: Some("EU Interest and Royalties Directive".to_string()), + example: Some("欧盟内部:0%(利息和版税指令)/ 对外:各国不同".to_string()), + }); + + ContractTemplate { + template_id: format!("IP-EU-{}-001", licensee), + template_type: ContractTemplateType::IpLicense, + jurisdiction: "EU".to_string(), + counterpart_jurisdiction: Some(licensee.to_string()), + name: format!("欧盟知识产权许可协议(欧盟→{})", licensee), + description: "适用于欧盟知识产权所有人向境外被许可方授权使用".to_string(), + legal_system: "大陆法系(欧盟法)".to_string(), + required_fields: fields, + optional_fields: vec![], + required_attachments: vec![ + "欧洲专利证书/欧盟商标注册证/版权证明".to_string(), + "TTBER合规分析报告".to_string(), + ], + special_requirements: vec![ + "须确认许可条款符合欧盟TTBER(技术转让块豁免条例)".to_string(), + "欧盟内部许可费支付适用利息和版税指令(零预提税)".to_string(), + "须遵守GDPR(如涉及个人数据)".to_string(), + ], + applicable_taxes: vec![ + "欧盟内部预提税:0%(利息和版税指令)".to_string(), + "对外预提税:各成员国不同(通常5%-15%)".to_string(), + ], + dispute_resolution_suggestion: "适用欧盟法律;争议提交ICC仲裁(巴黎)或WIPO仲裁(日内瓦)".to_string(), + language_requirements: vec!["英文".to_string(), "许可方所在国语言(副本)".to_string()], + } +} + +fn jp_licensor_template(licensee: &str) -> ContractTemplate { + let mut fields = common_ip_fields("JP", licensee); + fields.push(ContractField { + name: "jpo_registration".to_string(), + label: "日本特许厅登记".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "专利独占许可须在日本特许厅登记".to_string(), + legal_basis: Some("《特許法》第99条".to_string()), + example: None, + }); + fields.push(ContractField { + name: "jp_withholding_tax".to_string(), + label: "日本预提税".to_string(), + field_type: FieldType::Percentage, + required: true, + description: "向境外支付许可费须预扣日本预提税(通常20%,DTA可降低)".to_string(), + legal_basis: Some("《所得税法》第212条".to_string()), + example: Some("20%(无DTA)/ DTA国家可降低至0%-10%".to_string()), + }); + + ContractTemplate { + template_id: format!("IP-JP-{}-001", licensee), + template_type: ContractTemplateType::IpLicense, + jurisdiction: "JP".to_string(), + counterpart_jurisdiction: Some(licensee.to_string()), + name: format!("日本知識財産ライセンス契約(日本→{})", licensee), + description: "适用于日本知识产权所有人向境外被许可方授权使用".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: fields, + optional_fields: vec![], + required_attachments: vec![ + "特許証/商標登録証/著作権登録証".to_string(), + "JPO独占許諾登録証(独占许可)".to_string(), + ], + special_requirements: vec![ + "专利独占许可须在日本特许厅登记".to_string(), + "向境外支付许可费须预扣日本预提税(20%,DTA可降低)".to_string(), + "须遵守日本《独占禁止法》关于许可条款的规定".to_string(), + ], + applicable_taxes: vec![ + "日本预提税:20%(无DTA)/ DTA国家可降低至0%-10%".to_string(), + "消費税:10%(国内交易)".to_string(), + ], + dispute_resolution_suggestion: "适用日本法律;争议提交JCAA仲裁(东京)或WIPO仲裁".to_string(), + language_requirements: vec!["日文(正本)".to_string(), "英文(副本)".to_string()], + } +} diff --git a/nac-rwa-contract-templates/src/lib.rs b/nac-rwa-contract-templates/src/lib.rs new file mode 100644 index 0000000..0f35fdd --- /dev/null +++ b/nac-rwa-contract-templates/src/lib.rs @@ -0,0 +1,327 @@ +// NAC RWA 全球合约模板库 +// 版本:1.0.0 +// 覆盖:不动产买卖、商品跨境买卖、知识产权许可 +// +// 设计原则: +// 1. 模板 = 资产类型 × 辖区(不存在通用合约) +// 2. 必填字段是法律效力的最低要求 +// 3. 跨境合约需要双辖区验证 +// 4. 合约与税收联动 + +pub mod real_estate; +pub mod goods_trade; +pub mod ip_license; + +use serde::{Deserialize, Serialize}; + +/// 合约模板类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum ContractTemplateType { + /// 不动产买卖合约 + RealEstateSale, + /// 商品买卖合约(国内) + GoodsSaleDomestic, + /// 商品买卖合约(跨境) + GoodsSaleCrossBorder, + /// 知识产权许可合约 + IpLicense, + /// 知识产权转让合约 + IpAssignment, + /// 伊斯兰合规合约(Murabaha) + IslamicMurabaha, + /// 伊斯兰合规合约(Ijara) + IslamicIjara, +} + +/// 合约字段类型 +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub enum FieldType { + Text, + Number, + Date, + Currency { currency_code: String }, + Percentage, + Boolean, + Enum(Vec), + Address, + LegalEntityId, +} + +/// 合约字段定义 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractField { + /// 字段名称(英文,用于程序处理) + pub name: String, + /// 字段标签(本地化显示) + pub label: String, + /// 字段类型 + pub field_type: FieldType, + /// 是否必填(法律效力要求) + pub required: bool, + /// 字段说明 + pub description: String, + /// 法律依据(为什么此字段是必填的) + pub legal_basis: Option, + /// 示例值 + pub example: Option, +} + +/// 合约模板 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractTemplate { + /// 模板ID + pub template_id: String, + /// 模板类型 + pub template_type: ContractTemplateType, + /// 适用辖区(ISO 3166-1 alpha-2) + pub jurisdiction: String, + /// 对应辖区(跨境合约) + pub counterpart_jurisdiction: Option, + /// 模板名称 + pub name: String, + /// 模板描述 + pub description: String, + /// 法律体系 + pub legal_system: String, + /// 必填字段(法律效力最低要求) + pub required_fields: Vec, + /// 可选字段(商业条款) + pub optional_fields: Vec, + /// 附件要求 + pub required_attachments: Vec, + /// 特殊要求(如公证、备案等) + pub special_requirements: Vec, + /// 适用税收规则摘要 + pub applicable_taxes: Vec, + /// 争议解决条款建议 + pub dispute_resolution_suggestion: String, + /// 语言要求 + pub language_requirements: Vec, +} + +/// 合约验证错误 +#[derive(Debug, Clone, thiserror::Error)] +pub enum ContractValidationError { + #[error("必填字段缺失: {field_name}")] + RequiredFieldMissing { field_name: String }, + #[error("辖区不支持此合约类型: {jurisdiction}")] + UnsupportedJurisdiction { jurisdiction: String }, + #[error("跨境合约缺少对应辖区")] + MissingCounterpartJurisdiction, + #[error("合约字段值无效: {field_name} - {reason}")] + InvalidFieldValue { field_name: String, reason: String }, +} + +/// 获取不动产买卖合约模板 +pub fn get_real_estate_template(jurisdiction: &str) -> Option { + real_estate::get_template(jurisdiction) +} + +/// 获取商品跨境买卖合约模板 +pub fn get_goods_trade_template( + seller_jurisdiction: &str, + buyer_jurisdiction: &str, +) -> Option { + goods_trade::get_cross_border_template(seller_jurisdiction, buyer_jurisdiction) +} + +/// 获取知识产权许可合约模板 +pub fn get_ip_license_template( + licensor_jurisdiction: &str, + licensee_jurisdiction: &str, +) -> Option { + ip_license::get_template(licensor_jurisdiction, licensee_jurisdiction) +} + +/// 获取所有可用模板列表 +pub fn list_all_templates() -> Vec<(String, ContractTemplateType, String)> { + let mut templates = Vec::new(); + + // 不动产模板 + for jur in &["CN", "HK", "SG", "AE", "US", "DE", "FR", "JP", "KR", "AU", "GB"] { + templates.push(( + format!("real_estate_{}", jur.to_lowercase()), + ContractTemplateType::RealEstateSale, + jur.to_string(), + )); + } + + // 商品跨境模板(主要贸易对) + let trade_pairs = vec![ + ("CN", "US"), ("CN", "EU"), ("CN", "JP"), ("CN", "SG"), + ("EU", "US"), ("EU", "JP"), ("US", "JP"), + ]; + for (seller, buyer) in trade_pairs { + templates.push(( + format!("goods_{}_{}", seller.to_lowercase(), buyer.to_lowercase()), + ContractTemplateType::GoodsSaleCrossBorder, + format!("{}-{}", seller, buyer), + )); + } + + // IP 许可模板 + for jur in &["CN", "US", "EU", "JP"] { + templates.push(( + format!("ip_license_{}", jur.to_lowercase()), + ContractTemplateType::IpLicense, + jur.to_string(), + )); + } + + templates +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_list_all_templates_not_empty() { + let templates = list_all_templates(); + assert!(!templates.is_empty()); + assert!(templates.len() >= 20); + } + + #[test] + fn test_cn_real_estate_template_exists() { + let template = get_real_estate_template("CN"); + assert!(template.is_some()); + let t = template.unwrap(); + assert_eq!(t.jurisdiction, "CN"); + assert!(!t.required_fields.is_empty()); + } + + #[test] + fn test_de_real_estate_requires_notarization() { + let template = get_real_estate_template("DE"); + assert!(template.is_some()); + let t = template.unwrap(); + // 德国不动产合约必须有公证要求 + assert!(t.special_requirements.iter().any(|r| r.contains("公证") || r.contains("Notar"))); + } + + #[test] + fn test_ae_real_estate_requires_noc() { + let template = get_real_estate_template("AE"); + assert!(template.is_some()); + let t = template.unwrap(); + // 阿联酋不动产合约必须有 NOC + assert!( + t.required_attachments.iter().any(|a| a.contains("NOC")) + || t.special_requirements.iter().any(|r| r.contains("NOC")) + ); + } + + #[test] + fn test_cn_us_goods_trade_template() { + let template = get_goods_trade_template("CN", "US"); + assert!(template.is_some()); + let t = template.unwrap(); + // 跨境商品合约必须包含 Incoterms + assert!( + t.required_fields.iter().any(|f| f.name.contains("incoterms") || f.label.contains("Incoterms")) + || t.optional_fields.iter().any(|f| f.name.contains("incoterms")) + ); + } + + #[test] + fn test_cn_eu_goods_trade_has_customs() { + let template = get_goods_trade_template("CN", "EU"); + assert!(template.is_some()); + let t = template.unwrap(); + // 中欧贸易必须有海关/报关要求 + assert!( + t.required_attachments.iter().any(|a| a.contains("报关") || a.contains("Customs")) + || t.special_requirements.iter().any(|r| r.contains("报关") || r.contains("海关")) + ); + } + + #[test] + fn test_ip_license_cn_us_template() { + let template = get_ip_license_template("CN", "US"); + assert!(template.is_some()); + let t = template.unwrap(); + assert!(!t.required_fields.is_empty()); + // IP许可合约必须包含许可范围字段 + assert!( + t.required_fields.iter().any(|f| f.name.contains("scope") || f.label.contains("许可范围")) + ); + } + + #[test] + fn test_jp_real_estate_has_judicial_scrivener() { + let template = get_real_estate_template("JP"); + assert!(template.is_some()); + let t = template.unwrap(); + // 日本不动产合约建议司法书士 + assert!( + t.special_requirements.iter().any(|r| r.contains("司法书士") || r.contains("登记")) + ); + } + + #[test] + fn test_us_real_estate_has_title_insurance() { + let template = get_real_estate_template("US"); + assert!(template.is_some()); + let t = template.unwrap(); + // 美国不动产合约必须有产权保险 + assert!( + t.required_attachments.iter().any(|a| a.contains("Title Insurance") || a.contains("产权保险")) + || t.special_requirements.iter().any(|r| r.contains("Title Insurance")) + ); + } + + #[test] + fn test_all_real_estate_templates_have_required_fields() { + let jurisdictions = vec!["CN", "HK", "SG", "AE", "US", "DE", "FR", "JP", "KR", "AU", "GB"]; + for jur in jurisdictions { + let template = get_real_estate_template(jur); + assert!(template.is_some(), "辖区 {} 缺少不动产模板", jur); + let t = template.unwrap(); + assert!(!t.required_fields.is_empty(), "辖区 {} 不动产模板缺少必填字段", jur); + assert!(!t.applicable_taxes.is_empty(), "辖区 {} 不动产模板缺少税收信息", jur); + } + } + + #[test] + fn test_goods_trade_bill_of_lading_required() { + // 所有跨境商品合约都应要求提单 + let pairs = vec![("CN", "US"), ("CN", "EU"), ("EU", "JP")]; + for (seller, buyer) in pairs { + let template = get_goods_trade_template(seller, buyer); + assert!(template.is_some(), "{}-{} 跨境商品模板不存在", seller, buyer); + let t = template.unwrap(); + assert!( + t.required_attachments.iter().any(|a| a.contains("提单") || a.contains("Bill of Lading") || a.contains("B/L")), + "{}-{} 跨境商品模板缺少提单要求", + seller, + buyer + ); + } + } + + #[test] + fn test_ip_license_royalty_field_required() { + let template = get_ip_license_template("US", "CN"); + assert!(template.is_some()); + let t = template.unwrap(); + // IP许可合约必须包含许可费/版税字段 + assert!( + t.required_fields.iter().any(|f| f.name.contains("royalty") || f.label.contains("许可费") || f.label.contains("版税")) + ); + } + + #[test] + fn test_contract_template_type_variants() { + let types = vec![ + ContractTemplateType::RealEstateSale, + ContractTemplateType::GoodsSaleDomestic, + ContractTemplateType::GoodsSaleCrossBorder, + ContractTemplateType::IpLicense, + ContractTemplateType::IpAssignment, + ContractTemplateType::IslamicMurabaha, + ContractTemplateType::IslamicIjara, + ]; + assert_eq!(types.len(), 7); + } +} diff --git a/nac-rwa-contract-templates/src/real_estate.rs b/nac-rwa-contract-templates/src/real_estate.rs new file mode 100644 index 0000000..9f32fe3 --- /dev/null +++ b/nac-rwa-contract-templates/src/real_estate.rs @@ -0,0 +1,1172 @@ +// 不动产买卖合约模板 +// 覆盖:CN/HK/SG/AE/US/DE/FR/JP/KR/AU/GB +// 每个辖区的不动产合约都有其独特的法律要求 + +use crate::{ContractField, ContractTemplate, ContractTemplateType, FieldType}; + +pub fn get_template(jurisdiction: &str) -> Option { + match jurisdiction.to_uppercase().as_str() { + "CN" => Some(cn_real_estate_template()), + "HK" => Some(hk_real_estate_template()), + "SG" => Some(sg_real_estate_template()), + "AE" => Some(ae_real_estate_template()), + "US" => Some(us_real_estate_template()), + "DE" => Some(de_real_estate_template()), + "FR" => Some(fr_real_estate_template()), + "JP" => Some(jp_real_estate_template()), + "KR" => Some(kr_real_estate_template()), + "AU" => Some(au_real_estate_template()), + "GB" => Some(gb_real_estate_template()), + _ => None, + } +} + +fn cn_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-CN-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "CN".to_string(), + counterpart_jurisdiction: None, + name: "中国不动产买卖合同(网签版)".to_string(), + description: "适用于中国境内不动产(住宅/商业/工业)买卖,须在房管局网签备案".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "出卖人姓名/名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "出卖人的完整法定姓名或企业名称".to_string(), + legal_basis: Some("《合同法》第12条".to_string()), + example: Some("张三 / 北京某房地产有限公司".to_string()), + }, + ContractField { + name: "seller_id".to_string(), + label: "出卖人身份证/统一社会信用代码".to_string(), + field_type: FieldType::Text, + required: true, + description: "出卖人的有效身份证件号码".to_string(), + legal_basis: Some("《不动产登记暂行条例》第16条".to_string()), + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "买受人姓名/名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买受人的完整法定姓名或企业名称".to_string(), + legal_basis: Some("《合同法》第12条".to_string()), + example: None, + }, + ContractField { + name: "buyer_id".to_string(), + label: "买受人身份证/统一社会信用代码".to_string(), + field_type: FieldType::Text, + required: true, + description: "买受人的有效身份证件号码".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "房屋坐落地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "不动产的完整地址,与不动产权证一致".to_string(), + legal_basis: Some("《不动产登记暂行条例》".to_string()), + example: Some("北京市朝阳区某街道某号某楼某单元某室".to_string()), + }, + ContractField { + name: "property_certificate_no".to_string(), + label: "不动产权证书编号".to_string(), + field_type: FieldType::Text, + required: true, + description: "不动产权证书的唯一编号".to_string(), + legal_basis: Some("《不动产登记暂行条例》第22条".to_string()), + example: None, + }, + ContractField { + name: "land_use_right_type".to_string(), + label: "土地使用权性质".to_string(), + field_type: FieldType::Enum(vec!["出让".to_string(), "划拨".to_string(), "集体".to_string()]), + required: true, + description: "土地使用权的取得方式,影响交易合法性".to_string(), + legal_basis: Some("《城镇国有土地使用权出让和转让暂行条例》".to_string()), + example: None, + }, + ContractField { + name: "land_use_years_remaining".to_string(), + label: "土地使用权剩余年限".to_string(), + field_type: FieldType::Number, + required: true, + description: "土地使用权证上的剩余年限".to_string(), + legal_basis: None, + example: Some("70(住宅)/ 40(商业)/ 50(工业)".to_string()), + }, + ContractField { + name: "building_area".to_string(), + label: "建筑面积(平方米)".to_string(), + field_type: FieldType::Number, + required: true, + description: "不动产权证上的建筑面积".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "transaction_price".to_string(), + label: "成交价格(人民币元)".to_string(), + field_type: FieldType::Currency { currency_code: "CNY".to_string() }, + required: true, + description: "买卖双方协商确定的成交价格".to_string(), + legal_basis: Some("《合同法》第12条".to_string()), + example: None, + }, + ContractField { + name: "payment_method".to_string(), + label: "付款方式".to_string(), + field_type: FieldType::Enum(vec!["全款".to_string(), "按揭贷款".to_string(), "公积金贷款".to_string(), "组合贷款".to_string()]), + required: true, + description: "买受人的付款方式".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "delivery_date".to_string(), + label: "交房日期".to_string(), + field_type: FieldType::Date, + required: true, + description: "出卖人向买受人交付房屋的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "household_registration_commitment".to_string(), + label: "户口迁出承诺".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "出卖人承诺在交房前迁出户口".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![ + ContractField { + name: "mortgage_status".to_string(), + label: "抵押状态".to_string(), + field_type: FieldType::Enum(vec!["无抵押".to_string(), "有抵押(须还清)".to_string()]), + required: false, + description: "房屋是否存在抵押".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "decoration_status".to_string(), + label: "装修状况".to_string(), + field_type: FieldType::Enum(vec!["毛坯".to_string(), "简装".to_string(), "精装".to_string()]), + required: false, + description: "房屋的装修状况".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "不动产权证书(原件)".to_string(), + "出卖人身份证(复印件)".to_string(), + "买受人身份证(复印件)".to_string(), + "婚姻状况证明(已婚须配偶同意书)".to_string(), + "网签备案回执".to_string(), + ], + special_requirements: vec![ + "须在当地房管局进行网签备案(住宅必须)".to_string(), + "须缴纳契税(买方)、增值税(卖方)、个人所得税(卖方)".to_string(), + "须在不动产登记中心完成产权转移登记".to_string(), + "外资买家须提供在华工作/学习证明(住宅)".to_string(), + ], + applicable_taxes: vec![ + "契税:1%-3%(买方,首套1%,二套3%)".to_string(), + "增值税:5%(不满2年),满2年普通住宅免征".to_string(), + "个人所得税:差价×20%(满5年唯一住房免征)".to_string(), + "印花税:0.05%".to_string(), + ], + dispute_resolution_suggestion: "适用中华人民共和国法律;争议提交不动产所在地人民法院或CIETAC仲裁".to_string(), + language_requirements: vec!["中文(正本)".to_string()], + } +} + +fn hk_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-HK-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "HK".to_string(), + counterpart_jurisdiction: None, + name: "香港物业买卖合约(PASP + ASP)".to_string(), + description: "适用于香港不动产买卖,包含临时买卖合约和正式买卖合约".to_string(), + legal_system: "普通法系".to_string(), + required_fields: vec![ + ContractField { + name: "vendor_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方的完整法定姓名或公司名称".to_string(), + legal_basis: Some("《印花税条例》".to_string()), + example: None, + }, + ContractField { + name: "purchaser_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方的完整法定姓名或公司名称".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业的完整地址,与土地注册处记录一致".to_string(), + legal_basis: None, + example: Some("香港九龙某街道某号某楼某室".to_string()), + }, + ContractField { + name: "lot_number".to_string(), + label: "地段编号(Lot Number)".to_string(), + field_type: FieldType::Text, + required: true, + description: "土地注册处的地段编号".to_string(), + legal_basis: Some("《土地注册条例》".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(港元)".to_string(), + field_type: FieldType::Currency { currency_code: "HKD".to_string() }, + required: true, + description: "买卖双方协商的成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "initial_deposit".to_string(), + label: "临时订金(港元)".to_string(), + field_type: FieldType::Currency { currency_code: "HKD".to_string() }, + required: true, + description: "签署PASP时支付的临时订金,通常为成交价的3%-5%".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "completion_date".to_string(), + label: "成交日期".to_string(), + field_type: FieldType::Date, + required: true, + description: "完成交割的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_nationality".to_string(), + label: "买方国籍".to_string(), + field_type: FieldType::Text, + required: true, + description: "用于确定适用的印花税税率(外资买家须缴纳BSD)".to_string(), + legal_basis: Some("《印花税条例》BSD条款".to_string()), + example: None, + }, + ], + optional_fields: vec![ + ContractField { + name: "mortgage_redemption".to_string(), + label: "按揭赎回安排".to_string(), + field_type: FieldType::Text, + required: false, + description: "如物业有按揭,须说明赎回安排".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "临时买卖合约(PASP)".to_string(), + "正式买卖合约(ASP)".to_string(), + "土地查册文件(Land Search)".to_string(), + "印花税缴纳证明(IRAS)".to_string(), + "律师行转让契(Assignment)".to_string(), + ], + special_requirements: vec![ + "须在14天内缴纳从价印花税(AVD)".to_string(), + "外资买家须额外缴纳买家印花税(BSD)15%".to_string(), + "须通过持牌律师行完成转让".to_string(), + "须在土地注册处完成产权登记".to_string(), + ], + applicable_taxes: vec![ + "从价印花税(AVD):最高15%(住宅)".to_string(), + "买家印花税(BSD):15%(非香港永久居民)".to_string(), + ], + dispute_resolution_suggestion: "适用香港法律;争议提交香港高等法院或HKIAC仲裁".to_string(), + language_requirements: vec!["中文或英文(均具法律效力)".to_string()], + } +} + +fn sg_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-SG-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "SG".to_string(), + counterpart_jurisdiction: None, + name: "新加坡房产买卖协议(OTP + S&P)".to_string(), + description: "适用于新加坡私人住宅和商业不动产买卖".to_string(), + legal_system: "普通法系".to_string(), + required_fields: vec![ + ContractField { + name: "vendor_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "purchaser_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "title_number".to_string(), + label: "地契编号(Title Number)".to_string(), + field_type: FieldType::Text, + required: true, + description: "SLA土地注册处的地契编号".to_string(), + legal_basis: Some("《土地所有权法》".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(新加坡元)".to_string(), + field_type: FieldType::Currency { currency_code: "SGD".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_residency_status".to_string(), + label: "买方居民身份".to_string(), + field_type: FieldType::Enum(vec![ + "新加坡公民".to_string(), + "新加坡永久居民".to_string(), + "外国人".to_string(), + "公司实体".to_string(), + ]), + required: true, + description: "用于确定ABSD税率".to_string(), + legal_basis: Some("《印花税法》ABSD条款".to_string()), + example: None, + }, + ContractField { + name: "completion_date".to_string(), + label: "完成日期".to_string(), + field_type: FieldType::Date, + required: true, + description: "完成交割的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "购房意向书(OTP)".to_string(), + "买卖合约(S&P)".to_string(), + "IRAS印花税缴纳证明".to_string(), + "律师行转让文件".to_string(), + ], + special_requirements: vec![ + "须在14天内缴纳BSD印花税".to_string(), + "外资买家须缴纳ABSD 60%(2023年4月起)".to_string(), + "须在SLA完成产权转移登记".to_string(), + ], + applicable_taxes: vec![ + "买方印花税(BSD):最高4%".to_string(), + "额外买方印花税(ABSD):外国人60%,PR 5%-15%,公民0%-15%".to_string(), + ], + dispute_resolution_suggestion: "适用新加坡法律;争议提交新加坡高等法院或SIAC仲裁".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn ae_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-AE-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "AE".to_string(), + counterpart_jurisdiction: None, + name: "阿联酋(迪拜)不动产买卖合约(MOU + Form F)".to_string(), + description: "适用于迪拜Freehold区域不动产买卖,须通过DLD完成登记".to_string(), + legal_system: "混合法系(民法+伊斯兰法)".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址,须在DLD Freehold区域内".to_string(), + legal_basis: Some("迪拜土地局条例".to_string()), + example: None, + }, + ContractField { + name: "title_deed_no".to_string(), + label: "产权证编号(Title Deed No.)".to_string(), + field_type: FieldType::Text, + required: true, + description: "DLD颁发的产权证编号".to_string(), + legal_basis: Some("《不动产登记法》".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(阿联酋迪拉姆)".to_string(), + field_type: FieldType::Currency { currency_code: "AED".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "noc_required".to_string(), + label: "是否需要NOC(无异议证明)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "期房或有开发商管理的物业须获取NOC".to_string(), + legal_basis: Some("DLD要求".to_string()), + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "MOU(备忘录)".to_string(), + "NOC(无异议证明,开发商出具)".to_string(), + "Form A(卖方委托书)".to_string(), + "Form B(买方委托书)".to_string(), + "Form F(最终合约)".to_string(), + "护照复印件(买卖双方)".to_string(), + ], + special_requirements: vec![ + "须在DLD完成产权转移,缴纳4%转让费".to_string(), + "NOC须在交割前获取".to_string(), + "须通过DLD认证的房产中介或律师".to_string(), + ], + applicable_taxes: vec![ + "DLD转让费:4%(买方)".to_string(), + "VAT:5%(商业不动产)".to_string(), + "阿联酋无资本利得税、无遗产税".to_string(), + ], + dispute_resolution_suggestion: "适用阿联酋法律;争议提交RERA(迪拜房地产监管局)或DIAC仲裁".to_string(), + language_requirements: vec!["阿拉伯文(正本)".to_string(), "英文(副本)".to_string()], + } +} + +fn us_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-US-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "US".to_string(), + counterpart_jurisdiction: None, + name: "美国房地产买卖合同(Purchase Agreement)".to_string(), + description: "适用于美国不动产买卖,各州法律有差异,本模板基于通用原则".to_string(), + legal_system: "普通法系".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址,含州、县、邮编".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "legal_description".to_string(), + label: "法律描述(Legal Description)".to_string(), + field_type: FieldType::Text, + required: true, + description: "地契上的法律描述,用于精确识别不动产".to_string(), + legal_basis: Some("各州产权登记法".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(美元)".to_string(), + field_type: FieldType::Currency { currency_code: "USD".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "earnest_money".to_string(), + label: "诚意金(Earnest Money)".to_string(), + field_type: FieldType::Currency { currency_code: "USD".to_string() }, + required: true, + description: "买方支付的诚意金,通常为成交价的1%-3%".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "closing_date".to_string(), + label: "交割日期(Closing Date)".to_string(), + field_type: FieldType::Date, + required: true, + description: "完成交割的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "seller_is_foreign_person".to_string(), + label: "卖方是否为外国人(FIRPTA)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "用于确定是否适用FIRPTA预扣税要求".to_string(), + legal_basis: Some("《外国人房地产投资税法》(FIRPTA)".to_string()), + example: None, + }, + ], + optional_fields: vec![ + ContractField { + name: "inspection_contingency".to_string(), + label: "房屋检查条件(Inspection Contingency)".to_string(), + field_type: FieldType::Boolean, + required: false, + description: "买方是否保留房屋检查后退出的权利".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "financing_contingency".to_string(), + label: "融资条件(Financing Contingency)".to_string(), + field_type: FieldType::Boolean, + required: false, + description: "买方是否保留贷款未获批后退出的权利".to_string(), + legal_basis: None, + example: None, + }, + ], + required_attachments: vec![ + "产权保险(Title Insurance)".to_string(), + "地契(Deed:Warranty Deed/Quitclaim Deed)".to_string(), + "结算声明(Closing Disclosure)".to_string(), + "FIRPTA证明(外资卖方)".to_string(), + ], + special_requirements: vec![ + "须购买产权保险(Title Insurance)".to_string(), + "须通过托管(Escrow)完成资金交割".to_string(), + "须在县级登记处完成地契记录(Deed Recording)".to_string(), + "外资卖方须遵守FIRPTA预扣15%税款".to_string(), + "涉及军事基地附近须通过CFIUS审查".to_string(), + ], + applicable_taxes: vec![ + "转让税:各州不同,约0.1%-2%".to_string(), + "FIRPTA预扣税:外资卖方15%".to_string(), + "资本利得税:长期20%,短期按普通所得税率".to_string(), + ], + dispute_resolution_suggestion: "适用物业所在州法律;争议提交所在州法院或AAA仲裁".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn de_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-DE-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "DE".to_string(), + counterpart_jurisdiction: None, + name: "德国不动产买卖公证合同(Notarvertrag)".to_string(), + description: "适用于德国不动产买卖,须通过公证人签署,否则合同无效(BGB §311b)".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: vec![ + ContractField { + name: "verkaeufer_name".to_string(), + label: "出卖人姓名/公司名称(Verkäufer)".to_string(), + field_type: FieldType::Text, + required: true, + description: "出卖人完整法定姓名".to_string(), + legal_basis: Some("BGB §311b".to_string()), + example: None, + }, + ContractField { + name: "kaeufer_name".to_string(), + label: "买受人姓名/公司名称(Käufer)".to_string(), + field_type: FieldType::Text, + required: true, + description: "买受人完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "grundbuch_info".to_string(), + label: "土地登记册信息(Grundbuchinformation)".to_string(), + field_type: FieldType::Text, + required: true, + description: "土地登记册(Grundbuch)中的地块编号和登记信息".to_string(), + legal_basis: Some("《土地登记条例》(GBO)".to_string()), + example: Some("Amtsgericht XXX, Grundbuch von XXX, Blatt XXX".to_string()), + }, + ContractField { + name: "flurstueck_nr".to_string(), + label: "地块编号(Flurstücknummer)".to_string(), + field_type: FieldType::Text, + required: true, + description: "地籍图上的地块编号".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "kaufpreis".to_string(), + label: "成交价格(欧元)(Kaufpreis)".to_string(), + field_type: FieldType::Currency { currency_code: "EUR".to_string() }, + required: true, + description: "买卖双方协商的成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "uebergabedatum".to_string(), + label: "交付日期(Übergabedatum)".to_string(), + field_type: FieldType::Date, + required: true, + description: "不动产交付日期".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "notar_name".to_string(), + label: "公证人姓名(Notar)".to_string(), + field_type: FieldType::Text, + required: true, + description: "负责公证的公证人姓名和执照号".to_string(), + legal_basis: Some("《公证人法》(BNotO)".to_string()), + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "土地登记摘录(Grundbuchauszug)".to_string(), + "能源证书(Energieausweis)".to_string(), + "土地转让税完税证明(Unbedenklichkeitsbescheinigung)".to_string(), + "建筑许可证(如适用)".to_string(), + ], + special_requirements: vec![ + "必须通过公证人(Notar)签署公证合同,否则合同无效(BGB §311b)".to_string(), + "须申请预告登记(Auflassungsvormerkung)保护买方权益".to_string(), + "须缴纳土地转让税(GrESt)3.5%-6.5%(各州不同)".to_string(), + "须在土地登记处(Grundbuchamt)完成产权转移登记(Auflassung)".to_string(), + ], + applicable_taxes: vec![ + "土地转让税(GrESt):3.5%-6.5%(各州不同)".to_string(), + "公证费:约1%-1.5%".to_string(), + "土地登记费:约0.5%".to_string(), + "资本利得税:25%(持有10年以上免征)".to_string(), + ], + dispute_resolution_suggestion: "适用德国法律;争议提交不动产所在地法院或DIS仲裁".to_string(), + language_requirements: vec!["德文(正本)".to_string()], + } +} + +fn fr_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-FR-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "FR".to_string(), + counterpart_jurisdiction: None, + name: "法国不动产买卖公证合同(Acte authentique de vente)".to_string(), + description: "适用于法国不动产买卖,须通过公证人签署".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: vec![ + ContractField { + name: "vendeur_name".to_string(), + label: "出卖人姓名/公司名称(Vendeur)".to_string(), + field_type: FieldType::Text, + required: true, + description: "出卖人完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "acquereur_name".to_string(), + label: "买受人姓名/公司名称(Acquéreur)".to_string(), + field_type: FieldType::Text, + required: true, + description: "买受人完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "adresse_bien".to_string(), + label: "物业地址(Adresse du bien)".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "reference_cadastrale".to_string(), + label: "地籍参考编号(Référence cadastrale)".to_string(), + field_type: FieldType::Text, + required: true, + description: "法国地籍局的地块参考编号".to_string(), + legal_basis: Some("《土地公示法》".to_string()), + example: None, + }, + ContractField { + name: "prix_vente".to_string(), + label: "成交价格(欧元)(Prix de vente)".to_string(), + field_type: FieldType::Currency { currency_code: "EUR".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "date_signature".to_string(), + label: "签署日期".to_string(), + field_type: FieldType::Date, + required: true, + description: "公证合同签署日期".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "预售合同(Compromis de vente)".to_string(), + "诊断报告(DPE能源诊断、铅/石棉检测等)".to_string(), + "产权证明文件".to_string(), + "税务证明".to_string(), + ], + special_requirements: vec![ + "必须通过公证人(Notaire)签署公证合同".to_string(), + "买方享有10天冷静期(Délai de rétractation)".to_string(), + "须在土地公示局完成登记".to_string(), + "须缴纳注册税(Droits d'enregistrement)约5.8%(旧房)".to_string(), + ], + applicable_taxes: vec![ + "注册税(旧房):约5.8%".to_string(), + "增值税(新房):20%".to_string(), + "资本利得税:30%(含社会税17.2%)".to_string(), + ], + dispute_resolution_suggestion: "适用法国法律;争议提交法国法院或ICC仲裁".to_string(), + language_requirements: vec!["法文(正本)".to_string()], + } +} + +fn jp_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-JP-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "JP".to_string(), + counterpart_jurisdiction: None, + name: "日本不動産売買契約書".to_string(), + description: "适用于日本不动产买卖,须通过司法书士办理登记".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "売主(卖方)".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "買主(买方)".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_location".to_string(), + label: "物件の所在地(物业地址)".to_string(), + field_type: FieldType::Address, + required: true, + description: "不动产完整地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "chiban".to_string(), + label: "地番(地块编号)".to_string(), + field_type: FieldType::Text, + required: true, + description: "法务局登记的地块编号".to_string(), + legal_basis: Some("《不動産登記法》".to_string()), + example: None, + }, + ContractField { + name: "sale_price".to_string(), + label: "売買代金(成交价格,日元)".to_string(), + field_type: FieldType::Currency { currency_code: "JPY".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "handover_date".to_string(), + label: "引渡日(交付日期)".to_string(), + field_type: FieldType::Date, + required: true, + description: "不动产交付日期".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "登記識別情報(登记识别信息)".to_string(), + "印鑑証明書(印章证明)".to_string(), + "固定資産評価証明書(固定资产评价证明)".to_string(), + "住民票/护照".to_string(), + ], + special_requirements: vec![ + "须委托司法书士(Judicial Scrivener)办理所有权移转登记".to_string(), + "须缴纳不動産取得税(不动产取得税)4%".to_string(), + "须缴纳登記免許税(登记免许税)2%(所有权移转)".to_string(), + "外资须遵守外为法申报要求".to_string(), + ], + applicable_taxes: vec![ + "不動産取得税:4%(土地3%)".to_string(), + "登記免許税:2%(所有权移转)".to_string(), + "印紙税:按合同金额".to_string(), + "固定資産税:1.4%/年".to_string(), + ], + dispute_resolution_suggestion: "适用日本法律;争议提交日本法院或JCAA仲裁".to_string(), + language_requirements: vec!["日文(正本)".to_string()], + } +} + +fn kr_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-KR-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "KR".to_string(), + counterpart_jurisdiction: None, + name: "한국 부동산 매매계약서(韩国不动产买卖合同)".to_string(), + description: "适用于韩国不动产买卖".to_string(), + legal_system: "大陆法系".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "매도인(卖方)".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "매수인(买方)".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "부동산 소재지(物业地址)".to_string(), + field_type: FieldType::Address, + required: true, + description: "不动产完整地址".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "sale_price".to_string(), + label: "매매대금(成交价格,韩元)".to_string(), + field_type: FieldType::Currency { currency_code: "KRW".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_is_foreigner".to_string(), + label: "외국인 여부(买方是否为外国人)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "用于确定外国人土地取得申报要求".to_string(), + legal_basis: Some("《외국인토지법》(外国人土地法)".to_string()), + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "등기권리증(登记权利证)".to_string(), + "인감증명서(印章证明)".to_string(), + "외국인토지취득신고서(外国人土地取得申报书,外资)".to_string(), + ], + special_requirements: vec![ + "外资须向土地管理事务所提交外国人土地取得申报".to_string(), + "须缴纳취득세(取得税)1%-4%".to_string(), + "须在登记所完成所有权移转登记".to_string(), + ], + applicable_taxes: vec![ + "취득세(取得税):1%-4%".to_string(), + "양도소득세(转让所得税):最高45%(短期持有)".to_string(), + "부가가치세(增值税):10%(商业不动产)".to_string(), + ], + dispute_resolution_suggestion: "适用韩国法律;争议提交韩国法院或KCAB仲裁".to_string(), + language_requirements: vec!["韩文(正本)".to_string()], + } +} + +fn au_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-AU-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "AU".to_string(), + counterpart_jurisdiction: None, + name: "澳大利亚房产买卖合同(Contract of Sale)".to_string(), + description: "适用于澳大利亚不动产买卖,各州合同格式略有不同".to_string(), + legal_system: "普通法系".to_string(), + required_fields: vec![ + ContractField { + name: "vendor_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "purchaser_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址,含州、邮编".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "title_reference".to_string(), + label: "地契参考号(Title Reference)".to_string(), + field_type: FieldType::Text, + required: true, + description: "州土地产权局的地契参考号".to_string(), + legal_basis: Some("《托伦斯土地所有权法》".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(澳元)".to_string(), + field_type: FieldType::Currency { currency_code: "AUD".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_is_foreign_person".to_string(), + label: "买方是否为外国人(FIRB)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "用于确定是否需要FIRB批准".to_string(), + legal_basis: Some("《外国收购和接管法》(FATA)".to_string()), + example: None, + }, + ContractField { + name: "settlement_date".to_string(), + label: "交割日期(Settlement Date)".to_string(), + field_type: FieldType::Date, + required: true, + description: "完成交割的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "FIRB批准函(外资买家)".to_string(), + "印花税缴纳证明".to_string(), + "产权转移文件(Transfer of Land)".to_string(), + ], + special_requirements: vec![ + "外资须事先获得FIRB批准".to_string(), + "须缴纳印花税(各州不同)".to_string(), + "外资须缴纳外资附加印花税(各州7%-8%)".to_string(), + "须在州土地产权局完成产权转移登记".to_string(), + ], + applicable_taxes: vec![ + "印花税:各州3%-5.5%".to_string(), + "外资附加印花税:各州7%-8%".to_string(), + "资本利得税:最高45%(持有1年以上享50%折扣)".to_string(), + "GST:10%(新建住宅)".to_string(), + ], + dispute_resolution_suggestion: "适用物业所在州法律;争议提交州法院或ACICA仲裁".to_string(), + language_requirements: vec!["英文".to_string()], + } +} + +fn gb_real_estate_template() -> ContractTemplate { + ContractTemplate { + template_id: "RE-GB-001".to_string(), + template_type: ContractTemplateType::RealEstateSale, + jurisdiction: "GB".to_string(), + counterpart_jurisdiction: None, + name: "英国房产买卖合同(Contract for Sale)".to_string(), + description: "适用于英格兰和威尔士不动产买卖".to_string(), + legal_system: "普通法系".to_string(), + required_fields: vec![ + ContractField { + name: "seller_name".to_string(), + label: "卖方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "卖方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_name".to_string(), + label: "买方姓名/公司名称".to_string(), + field_type: FieldType::Text, + required: true, + description: "买方完整法定姓名".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "property_address".to_string(), + label: "物业地址".to_string(), + field_type: FieldType::Address, + required: true, + description: "物业完整地址,含邮编".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "title_number".to_string(), + label: "产权编号(Title Number)".to_string(), + field_type: FieldType::Text, + required: true, + description: "HM Land Registry的产权编号".to_string(), + legal_basis: Some("《土地登记法》2002".to_string()), + example: None, + }, + ContractField { + name: "purchase_price".to_string(), + label: "成交价格(英镑)".to_string(), + field_type: FieldType::Currency { currency_code: "GBP".to_string() }, + required: true, + description: "成交价格".to_string(), + legal_basis: None, + example: None, + }, + ContractField { + name: "buyer_is_overseas_entity".to_string(), + label: "买方是否为海外实体(ROE)".to_string(), + field_type: FieldType::Boolean, + required: true, + description: "用于确定是否需要在海外实体登记册(ROE)登记".to_string(), + legal_basis: Some("《经济犯罪(透明度和执法)法》2022".to_string()), + example: None, + }, + ContractField { + name: "completion_date".to_string(), + label: "完成日期(Completion Date)".to_string(), + field_type: FieldType::Date, + required: true, + description: "完成交割的约定日期".to_string(), + legal_basis: None, + example: None, + }, + ], + optional_fields: vec![], + required_attachments: vec![ + "产权文件(Official Copies from HMLR)".to_string(), + "SDLT申报表(SDLT1)".to_string(), + "转让契约(TR1 Transfer Deed)".to_string(), + "海外实体登记证明(海外实体买家)".to_string(), + ], + special_requirements: vec![ + "须在30天内缴纳印花税土地税(SDLT)".to_string(), + "海外实体须在ROE登记并披露最终受益所有人(UBO)".to_string(), + "须在HM Land Registry完成产权登记".to_string(), + "须通过持牌律师完成交割".to_string(), + ], + applicable_taxes: vec![ + "印花税土地税(SDLT):住宅最高12%".to_string(), + "海外买家附加税:2%".to_string(), + "资本利得税(CGT):不动产24%(2024年起)".to_string(), + "增值税(VAT):20%(商业不动产)".to_string(), + ], + dispute_resolution_suggestion: "适用英格兰和威尔士法律;争议提交高等法院或LCIA仲裁".to_string(), + language_requirements: vec!["英文".to_string()], + } +} diff --git a/nac-rwa-jurisdiction-adapters/Cargo.lock b/nac-rwa-jurisdiction-adapters/Cargo.lock new file mode 100644 index 0000000..fb35fc4 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "nac-rwa-jurisdiction-adapters" +version = "1.0.0" +dependencies = [ + "nac-rwa-legal-model", + "serde", + "thiserror", +] + +[[package]] +name = "nac-rwa-legal-model" +version = "1.0.0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/nac-rwa-jurisdiction-adapters/Cargo.toml b/nac-rwa-jurisdiction-adapters/Cargo.toml new file mode 100644 index 0000000..0f6756a --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "nac-rwa-jurisdiction-adapters" +version = "1.0.0" +edition = "2021" +description = "NAC RWA 全球核心辖区适配器 — CN/HK/SG/AE/US/EU-DE/EU-FR/JP/KR/AU/GB" +authors = ["NAC Development Team"] + +[lib] +name = "nac_rwa_jurisdiction_adapters" +path = "src/lib.rs" + +[lints.rust] +warnings = "deny" + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" +nac-rwa-legal-model = { path = "../nac-rwa-legal-model" } diff --git a/nac-rwa-jurisdiction-adapters/src/ae.rs b/nac-rwa-jurisdiction-adapters/src/ae.rs new file mode 100644 index 0000000..a5e7378 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/ae.rs @@ -0,0 +1,182 @@ +// 阿联酋(AE)辖区适配器 +// 法律体系:混合法系(民法+伊斯兰法) +// 主要法律:《联邦民法典》《公司法》《不动产登记法》《迪拜土地局条例》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, FinancialAssetSubtype, LegalSystem}; + +pub struct AeAdapter; + +impl JurisdictionAdapter for AeAdapter { + fn jurisdiction_code(&self) -> &'static str { "AE" } + fn jurisdiction_name(&self) -> &'static str { "阿拉伯联合酋长国" } + fn legal_system(&self) -> LegalSystem { + LegalSystem::Mixed( + Box::new(LegalSystem::CivilLaw), + Box::new(LegalSystem::ShariaLaw), + ) + } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产(指定外资区域)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资只能在指定的Freehold区域购买不动产(迪拜约60个区域)".to_string()), + required_approvals: vec!["迪拜土地局(DLD)".to_string()], + }, + AssetCategorySupport { + category: "伊斯兰金融产品(Sukuk)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合伊斯兰金融标准委员会(AAOIFI)标准".to_string()), + required_approvals: vec!["阿联酋证券商品监管局(SCA)".to_string()], + }, + AssetCategorySupport { + category: "虚拟资产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须持有VARA(迪拜虚拟资产监管局)或ADGM/DIFC牌照".to_string()), + required_approvals: vec!["VARA/ADGM/DIFC".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "迪拜土地局(Dubai Land Department, DLD)/ 阿布扎比市政局".to_string(), + notarization_required: true, + notary_authority: Some("迪拜土地局公证处".to_string()), + registration_process: "签订MOU(备忘录)→ 卖方获取NOC(无异议证明)→ 买卖双方到DLD办理 → 缴纳转让费 → 完成产权登记(Title Deed)".to_string(), + foreign_buyer_restrictions: Some("外资只能在Freehold指定区域购买;非居民可购买,无国籍限制".to_string()), + required_documents: vec![ + "护照(买卖双方)".to_string(), + "MOU(备忘录)".to_string(), + "NOC(无异议证明,开发商出具)".to_string(), + "Form A(卖方委托书)".to_string(), + "Form B(买方委托书)".to_string(), + "Form F(最终合约)".to_string(), + "转让费缴纳证明(4%)".to_string(), + ], + typical_completion_days: 30, + registration_fee_pct: 0.04, // DLD 转让费 4% + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: false, + review_authority: None, + prohibited_sectors: vec![ + "石油天然气(国家垄断)".to_string(), + ], + restricted_sectors: vec![ + "银行(外资持股≤49%,部分豁免)".to_string(), + "保险(外资持股≤49%,部分豁免)".to_string(), + ], + real_estate_restrictions: Some("外资只能在Freehold指定区域购买不动产".to_string()), + legal_basis: "《外商投资法》(2020年)允许外资100%持股(除负面清单外)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "阿联酋证券商品监管局".to_string(), + abbreviation: "SCA".to_string(), + jurisdiction_area: "证券、商品、基金监管".to_string(), + website: Some("https://www.sca.gov.ae".to_string()), + }, + RegulatoryBody { + name: "迪拜虚拟资产监管局".to_string(), + abbreviation: "VARA".to_string(), + jurisdiction_area: "虚拟资产监管".to_string(), + website: Some("https://www.vara.ae".to_string()), + }, + RegulatoryBody { + name: "迪拜土地局".to_string(), + abbreviation: "DLD".to_string(), + jurisdiction_area: "不动产登记、产权管理".to_string(), + website: Some("https://www.dubailand.gov.ae".to_string()), + }, + RegulatoryBody { + name: "阿联酋中央银行".to_string(), + abbreviation: "CBUAE".to_string(), + jurisdiction_area: "银行、支付、反洗钱".to_string(), + website: Some("https://www.centralbank.ae".to_string()), + }, + RegulatoryBody { + name: "迪拜国际金融中心".to_string(), + abbreviation: "DIFC".to_string(), + jurisdiction_area: "金融服务(独立法律体系)".to_string(), + website: Some("https://www.difc.ae".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.04), // DLD 转让费 4% + real_estate_transfer_tax_seller: None, + stamp_duty: None, // 阿联酋无印花税 + capital_gains_tax_resident: None, // 阿联酋无资本利得税 + capital_gains_tax_nonresident: None, + vat_or_gst: Some(0.05), // VAT 5%(商业交易) + withholding_tax_dividend: None, // 无预提税 + withholding_tax_interest: None, + withholding_tax_royalty: None, + notes: Some("阿联酋无个人所得税、无资本利得税、无遗产税;不动产转让费4%(DLD);VAT 5%适用于商业交易".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "迪拜土地局争议解决中心(RERA)/迪拜法院".to_string(), + goods_trade: "迪拜国际仲裁中心(DIAC)/ICC".to_string(), + intellectual_property: "DIFC法院/DIAC".to_string(), + financial: "DIFC法院(英语普通法体系)/DIAC".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须在DLD指定的Freehold区域内购买".to_string(), + "须缴纳4%转让费".to_string(), + "须完成NOC和Form F手续".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳4%转让费".to_string(), + "须在DLD完成产权登记".to_string(), + ]) + } + } + AssetCategory::FinancialAsset(subtype) => { + match subtype { + FinancialAssetSubtype::Sukuk => ValidationResult::Approved, + FinancialAssetSubtype::Bond => { + ValidationResult::ApprovedWithConditions(vec![ + "普通债券在阿联酋需注意Sharia合规要求".to_string(), + "建议使用Sukuk结构替代".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/au.rs b/nac-rwa-jurisdiction-adapters/src/au.rs new file mode 100644 index 0000000..eb2cd78 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/au.rs @@ -0,0 +1,151 @@ +// 澳大利亚(AU)辖区适配器 +// 法律体系:普通法系(英国法影响) +// 主要法律:《托伦斯土地所有权法》《外国收购和接管法》《公司法》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct AuAdapter; + +impl JurisdictionAdapter for AuAdapter { + fn jurisdiction_code(&self) -> &'static str { "AU" } + fn jurisdiction_name(&self) -> &'static str { "澳大利亚联邦" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CommonLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产(新建住宅)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资通常只能购买新建住宅,不能购买二手住宅(需FIRB批准)".to_string()), + required_approvals: vec!["外国投资审查委员会(FIRB)".to_string()], + }, + AssetCategorySupport { + category: "不动产(商业)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("超过门槛金额须FIRB审批(敏感土地更低门槛)".to_string()), + required_approvals: vec!["外国投资审查委员会(FIRB)".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合澳大利亚证券投资委员会(ASIC)要求".to_string()), + required_approvals: vec!["澳大利亚证券投资委员会(ASIC)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "各州土地产权局(Titles Office/Land Registry Services)".to_string(), + notarization_required: false, + notary_authority: None, + registration_process: "签订买卖合同(Contract of Sale)→ 冷静期(各州不同)→ 外资须申请FIRB批准 → 交割(Settlement)→ 在州土地产权局完成产权转移登记".to_string(), + foreign_buyer_restrictions: Some("外资通常只能购买新建住宅;购买二手住宅须FIRB特别批准;须缴纳外资附加印花税(各州不同,约7%-8%)".to_string()), + required_documents: vec![ + "买卖合同(Contract of Sale)".to_string(), + "FIRB批准函(外资)".to_string(), + "护照/身份证".to_string(), + "印花税缴纳证明".to_string(), + "转让文件(Transfer of Land)".to_string(), + ], + typical_completion_days: 60, + registration_fee_pct: 0.001, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("外国投资审查委员会(FIRB)".to_string()), + prohibited_sectors: vec![ + "媒体(部分)".to_string(), + "国防(部分)".to_string(), + ], + restricted_sectors: vec![ + "农业土地(门槛15百万澳元)".to_string(), + "关键基础设施".to_string(), + "住宅不动产(外资限购新建)".to_string(), + ], + real_estate_restrictions: Some("外资通常只能购买新建住宅;须FIRB批准;须缴纳外资附加印花税".to_string()), + legal_basis: "《外国收购和接管法》(FATA 1975)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "澳大利亚证券投资委员会".to_string(), + abbreviation: "ASIC".to_string(), + jurisdiction_area: "证券、公司、金融服务".to_string(), + website: Some("https://www.asic.gov.au".to_string()), + }, + RegulatoryBody { + name: "外国投资审查委员会".to_string(), + abbreviation: "FIRB".to_string(), + jurisdiction_area: "外资审查".to_string(), + website: Some("https://firb.gov.au".to_string()), + }, + RegulatoryBody { + name: "澳大利亚审慎监管局".to_string(), + abbreviation: "APRA".to_string(), + jurisdiction_area: "银行、保险、养老金".to_string(), + website: Some("https://www.apra.gov.au".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.055), // 印花税约3%-5.5%(各州不同) + real_estate_transfer_tax_seller: None, + stamp_duty: Some(0.08), // 外资附加印花税约7%-8% + capital_gains_tax_resident: Some(0.45), // 最高边际税率45%(持有1年以上50%折扣) + capital_gains_tax_nonresident: Some(0.30), + vat_or_gst: Some(0.10), // GST 10%(新建住宅) + withholding_tax_dividend: Some(0.30), // 股息预提税30%(非居民,DTA可降低) + withholding_tax_interest: Some(0.10), + withholding_tax_royalty: Some(0.30), + notes: Some("外资附加印花税各州7%-8%;持有不动产超1年资本利得税享50%折扣;新建住宅适用GST 10%".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "各州法院(Supreme Court)".to_string(), + goods_trade: "澳大利亚国际商事仲裁中心(ACICA)/ICC".to_string(), + intellectual_property: "联邦法院/ACICA".to_string(), + financial: "澳大利亚金融投诉局(AFCA)/ACICA".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::RequiresGovernmentApproval( + "外资购买澳大利亚不动产须事先获得FIRB批准;通常只能购买新建住宅".to_string(), + ) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳印花税".to_string(), + "须在州土地产权局完成产权转移登记".to_string(), + ]) + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/cn.rs b/nac-rwa-jurisdiction-adapters/src/cn.rs new file mode 100644 index 0000000..eb0e43f --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/cn.rs @@ -0,0 +1,257 @@ +// 中国(CN)辖区适配器 +// 法律体系:大陆法系(社会主义法律体系) +// 主要法律:《民法典》《不动产登记暂行条例》《外商投资法》《个人信息保护法》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, IPSubtype, LegalSystem, RealEstateSubtype}; + +pub struct CnAdapter; + +impl JurisdictionAdapter for CnAdapter { + fn jurisdiction_code(&self) -> &'static str { + "CN" + } + + fn jurisdiction_name(&self) -> &'static str { + "中华人民共和国" + } + + fn legal_system(&self) -> LegalSystem { + LegalSystem::CivilLaw + } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产(住宅)".to_string(), + supported: true, + foreign_entity_allowed: false, // 外资购买住宅受限 + restrictions: Some("外资个人须在中国境内工作或学习满1年;外资机构不得购买非自用住宅".to_string()), + required_approvals: vec!["不动产登记中心".to_string()], + }, + AssetCategorySupport { + category: "不动产(商业)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资商业地产须符合外商投资准入负面清单".to_string()), + required_approvals: vec!["商务部/地方政府审批".to_string(), "不动产登记中心".to_string()], + }, + AssetCategorySupport { + category: "不动产(工业)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须通过外商投资企业形式持有".to_string()), + required_approvals: vec!["商务部".to_string(), "自然资源部".to_string()], + }, + AssetCategorySupport { + category: "知识产权(专利)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: None, + required_approvals: vec!["国家知识产权局(CNIPA)".to_string()], + }, + AssetCategorySupport { + category: "知识产权(商标)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: None, + required_approvals: vec!["国家知识产权局商标局".to_string()], + }, + AssetCategorySupport { + category: "大宗商品".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("部分战略物资受出口管制".to_string()), + required_approvals: vec!["商务部".to_string()], + }, + AssetCategorySupport { + category: "金融资产(股权)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("A股外资持股比例限制;部分行业外资股比上限".to_string()), + required_approvals: vec!["中国证监会(CSRC)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "自然资源部不动产登记中心(各地不动产登记局)".to_string(), + notarization_required: false, // 中国不强制公证,但实践中常用 + notary_authority: None, + registration_process: "签订买卖合同 → 网签备案(住宅必须)→ 缴纳税费 → 申请不动产登记 → 领取不动产权证".to_string(), + foreign_buyer_restrictions: Some("外资个人须提供在华工作/学习证明;外资机构须通过外商投资企业持有".to_string()), + required_documents: vec![ + "买卖合同(网签版)".to_string(), + "身份证/护照(买卖双方)".to_string(), + "不动产权证(卖方)".to_string(), + "契税完税证明".to_string(), + "增值税完税证明(满2年豁免)".to_string(), + "个人所得税完税证明(卖方)".to_string(), + "婚姻状况证明(已婚须配偶同意书)".to_string(), + ], + typical_completion_days: 30, + registration_fee_pct: 0.003, // 0.3% + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("商务部/国家发展改革委(外商投资安全审查机制)".to_string()), + prohibited_sectors: vec![ + "新闻媒体".to_string(), + "互联网新闻信息服务".to_string(), + "网络出版服务".to_string(), + "网络视听节目服务".to_string(), + "互联网文化经营".to_string(), + "网络游戏运营(部分)".to_string(), + "学前教育、普通高中和高等教育机构".to_string(), + "中国法律服务机构".to_string(), + "社会调查".to_string(), + "放射性矿产勘查开采".to_string(), + ], + restricted_sectors: vec![ + "电信(增值电信服务外资股比≤50%)".to_string(), + "金融(银行/保险/证券外资股比限制)".to_string(), + "汽车制造(部分合资要求)".to_string(), + "文化(出版/影视合拍)".to_string(), + ], + real_estate_restrictions: Some("外资购买住宅须满足自用条件;商业地产须符合准入负面清单".to_string()), + legal_basis: "《外商投资法》《外商投资准入特别管理措施(负面清单)》".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "中国证券监督管理委员会".to_string(), + abbreviation: "CSRC".to_string(), + jurisdiction_area: "证券、期货、基金监管".to_string(), + website: Some("http://www.csrc.gov.cn".to_string()), + }, + RegulatoryBody { + name: "中国人民银行".to_string(), + abbreviation: "PBOC".to_string(), + jurisdiction_area: "货币政策、支付清算、反洗钱".to_string(), + website: Some("http://www.pbc.gov.cn".to_string()), + }, + RegulatoryBody { + name: "国家金融监督管理总局".to_string(), + abbreviation: "NFRA".to_string(), + jurisdiction_area: "银行、保险监管".to_string(), + website: Some("http://www.nfra.gov.cn".to_string()), + }, + RegulatoryBody { + name: "自然资源部".to_string(), + abbreviation: "MNR".to_string(), + jurisdiction_area: "不动产登记、土地管理".to_string(), + website: Some("http://www.mnr.gov.cn".to_string()), + }, + RegulatoryBody { + name: "国家知识产权局".to_string(), + abbreviation: "CNIPA".to_string(), + jurisdiction_area: "专利、商标、版权".to_string(), + website: Some("http://www.cnipa.gov.cn".to_string()), + }, + RegulatoryBody { + name: "商务部".to_string(), + abbreviation: "MOFCOM".to_string(), + jurisdiction_area: "外商投资审批、对外贸易".to_string(), + website: Some("http://www.mofcom.gov.cn".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.03), // 契税 1%-3%(首套1%,二套3%) + real_estate_transfer_tax_seller: Some(0.01), // 增值税(满2年豁免) + stamp_duty: Some(0.0005), // 印花税 0.05% + capital_gains_tax_resident: Some(0.20), // 个人所得税 20%(差价) + capital_gains_tax_nonresident: Some(0.20), + vat_or_gst: Some(0.05), // 增值税 5%(不满2年) + withholding_tax_dividend: Some(0.10), // 股息预提税 10%(非居民) + withholding_tax_interest: Some(0.10), + withholding_tax_royalty: Some(0.10), + notes: Some("契税:首套房1%,二套房3%;增值税:不满2年5%,满2年普通住宅免征;个税:满5年唯一住房免征".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "人民法院(物权纠纷适用不动产所在地法院)".to_string(), + goods_trade: "中国国际经济贸易仲裁委员会(CIETAC)/人民法院".to_string(), + intellectual_property: "知识产权法院/CIETAC".to_string(), + financial: "中国证券期货市场纠纷调解中心/仲裁".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(subtype) => { + if is_foreign_entity { + match subtype { + RealEstateSubtype::Residential => { + ValidationResult::RequiresGovernmentApproval( + "外资购买住宅须满足在华工作/学习满1年条件,并向不动产登记中心申请".to_string(), + ) + } + RealEstateSubtype::Commercial | RealEstateSubtype::Industrial => { + ValidationResult::ApprovedWithConditions(vec![ + "须通过外商投资企业形式持有".to_string(), + "须符合外商投资准入负面清单".to_string(), + "须向商务部备案或审批".to_string(), + ]) + } + _ => ValidationResult::RequiresGovernmentApproval( + "外资购买特殊类型不动产须专项审批".to_string(), + ), + } + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须完成网签备案".to_string(), + "须缴纳契税、增值税、个税".to_string(), + "须在不动产登记中心完成产权转移登记".to_string(), + ]) + } + } + AssetCategory::IntellectualProperty(subtype) => { + match subtype { + IPSubtype::InventionPatent | IPSubtype::UtilityModel | IPSubtype::DesignPatent => { + ValidationResult::ApprovedWithConditions(vec![ + "须在国家知识产权局完成专利权转让登记".to_string(), + "转让合同须经CNIPA备案".to_string(), + ]) + } + IPSubtype::Trademark => { + ValidationResult::ApprovedWithConditions(vec![ + "须在国家知识产权局商标局完成商标权转让登记".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } + AssetCategory::FinancialAsset(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须符合外资持股比例限制".to_string(), + "须通过QFII/RQFII/沪深港通等合规渠道".to_string(), + ]) + } else { + ValidationResult::Approved + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/eu_de.rs b/nac-rwa-jurisdiction-adapters/src/eu_de.rs new file mode 100644 index 0000000..2272f44 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/eu_de.rs @@ -0,0 +1,139 @@ +// 德国(EU-DE)辖区适配器 +// 法律体系:大陆法系(德国法) +// 主要法律:《民法典》(BGB)《土地登记条例》(GBO)《公证人法》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct EuDeAdapter; + +impl JurisdictionAdapter for EuDeAdapter { + fn jurisdiction_code(&self) -> &'static str { "DE" } + fn jurisdiction_name(&self) -> &'static str { "德意志联邦共和国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CivilLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须通过公证人(Notar)签署合同,否则合同无效".to_string()), + required_approvals: vec!["公证人(Notar)".to_string(), "土地登记处(Grundbuchamt)".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合欧盟MiFID II和德国证券法".to_string()), + required_approvals: vec!["联邦金融监管局(BaFin)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "土地登记处(Grundbuchamt,隶属地方法院)".to_string(), + notarization_required: true, // 德国法律强制要求公证 + notary_authority: Some("公证人(Notar)——德国公证人是独立的法律职业,非律师".to_string()), + registration_process: "买卖双方在公证人面前签署公证合同(Notarvertrag)→ 公证人申请预告登记(Auflassungsvormerkung)→ 缴纳土地转让税(GrESt)→ 公证人申请正式产权转移登记(Auflassung)→ 土地登记处完成登记".to_string(), + foreign_buyer_restrictions: Some("欧盟内无限制;非欧盟买家通常无限制,但部分战略资产可能受审查".to_string()), + required_documents: vec![ + "公证合同(Notarvertrag)".to_string(), + "护照/身份证".to_string(), + "土地转让税完税证明(Unbedenklichkeitsbescheinigung)".to_string(), + "土地登记摘录(Grundbuchauszug)".to_string(), + "能源证书(Energieausweis)".to_string(), + "建筑许可证(如适用)".to_string(), + ], + typical_completion_days: 90, + registration_fee_pct: 0.015, // 公证费+登记费约1.5%-2% + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("联邦经济和气候保护部(BMWK)".to_string()), + prohibited_sectors: vec![], + restricted_sectors: vec![ + "关键基础设施(能源/水/电信)".to_string(), + "国防技术".to_string(), + "人工智能/量子计算(敏感技术)".to_string(), + "媒体(部分)".to_string(), + ], + real_estate_restrictions: Some("无特殊限制,但涉及关键基础设施附近的不动产可能受审查".to_string()), + legal_basis: "《对外经济法》(AWG)§55及《对外经济条例》(AWV)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "联邦金融监管局".to_string(), + abbreviation: "BaFin".to_string(), + jurisdiction_area: "银行、保险、证券、加密资产监管".to_string(), + website: Some("https://www.bafin.de".to_string()), + }, + RegulatoryBody { + name: "联邦经济和气候保护部".to_string(), + abbreviation: "BMWK".to_string(), + jurisdiction_area: "外资审查".to_string(), + website: Some("https://www.bmwk.de".to_string()), + }, + RegulatoryBody { + name: "德国专利商标局".to_string(), + abbreviation: "DPMA".to_string(), + jurisdiction_area: "专利、商标、版权".to_string(), + website: Some("https://www.dpma.de".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.065), // GrESt 3.5%-6.5%(各州不同) + real_estate_transfer_tax_seller: None, + stamp_duty: None, + capital_gains_tax_resident: Some(0.25), // 资本利得税 25%(Abgeltungsteuer) + capital_gains_tax_nonresident: Some(0.25), + vat_or_gst: Some(0.19), // 增值税 19%(商业交易) + withholding_tax_dividend: Some(0.25), // 股息预提税 25% + withholding_tax_interest: Some(0.25), + withholding_tax_royalty: Some(0.15), + notes: Some("土地转让税(GrESt)各州3.5%-6.5%;公证费约1%-1.5%;中介费约3%-7%".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "地方法院/州法院(Amtsgericht/Landgericht)".to_string(), + goods_trade: "德国仲裁协会(DIS)/ICC".to_string(), + intellectual_property: "德国联邦专利法院/DIS".to_string(), + financial: "BaFin调解/DIS/法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + _is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + ValidationResult::ApprovedWithConditions(vec![ + "必须通过公证人(Notar)签署公证合同,否则合同无效(BGB §311b)".to_string(), + "须在土地登记处(Grundbuchamt)完成产权转移登记".to_string(), + "须缴纳土地转让税(GrESt)3.5%-6.5%".to_string(), + "须申请预告登记(Auflassungsvormerkung)保护买方权益".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/eu_fr.rs b/nac-rwa-jurisdiction-adapters/src/eu_fr.rs new file mode 100644 index 0000000..3648020 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/eu_fr.rs @@ -0,0 +1,132 @@ +// 法国(EU-FR)辖区适配器 +// 法律体系:大陆法系(拿破仑法典体系) +// 主要法律:《民法典》(Code Civil)《土地公示法》《商法典》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct EuFrAdapter; + +impl JurisdictionAdapter for EuFrAdapter { + fn jurisdiction_code(&self) -> &'static str { "FR" } + fn jurisdiction_name(&self) -> &'static str { "法兰西共和国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CivilLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须通过公证人(Notaire)签署,否则合同无效".to_string()), + required_approvals: vec!["公证人(Notaire)".to_string(), "土地公示局(Service de la publicité foncière)".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合欧盟MiFID II和法国金融法".to_string()), + required_approvals: vec!["法国金融市场管理局(AMF)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "土地公示局(Service de la publicité foncière)".to_string(), + notarization_required: true, + notary_authority: Some("公证人(Notaire)——法国公证人是国家官员".to_string()), + registration_process: "签订预售合同(Compromis de vente)→ 冷静期(10天)→ 公证人准备正式合同 → 签署公证合同(Acte authentique)→ 缴纳税费 → 土地公示登记".to_string(), + foreign_buyer_restrictions: Some("欧盟内无限制;非欧盟买家通常无限制".to_string()), + required_documents: vec![ + "预售合同(Compromis de vente)".to_string(), + "公证合同(Acte authentique)".to_string(), + "护照/身份证".to_string(), + "诊断报告(DPE能源诊断等)".to_string(), + "产权证明文件".to_string(), + ], + typical_completion_days: 90, + registration_fee_pct: 0.08, // 公证费+税约7%-8% + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("法国经济部(DGT)".to_string()), + prohibited_sectors: vec![], + restricted_sectors: vec![ + "国防".to_string(), + "关键基础设施(能源/水/电信)".to_string(), + "人工智能/量子计算".to_string(), + "媒体".to_string(), + ], + real_estate_restrictions: None, + legal_basis: "《货币和金融法典》L151-3条".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "法国金融市场管理局".to_string(), + abbreviation: "AMF".to_string(), + jurisdiction_area: "证券、基金、数字资产(PSAN)".to_string(), + website: Some("https://www.amf-france.org".to_string()), + }, + RegulatoryBody { + name: "法国审慎监管和处置局".to_string(), + abbreviation: "ACPR".to_string(), + jurisdiction_area: "银行、保险监管".to_string(), + website: Some("https://acpr.banque-france.fr".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.058), // 注册税约5.8% + real_estate_transfer_tax_seller: None, + stamp_duty: None, + capital_gains_tax_resident: Some(0.30), // 资本利得税30%(含社会税) + capital_gains_tax_nonresident: Some(0.36), + vat_or_gst: Some(0.20), // 增值税 20% + withholding_tax_dividend: Some(0.128), // 股息预提税12.8%(居民),30%(非居民) + withholding_tax_interest: Some(0.128), + withholding_tax_royalty: Some(0.33), + notes: Some("不动产注册税约5.8%(旧房);新房适用增值税20%;资本利得税30%(含17.2%社会税)".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "法国法院(物权适用不动产所在地法)".to_string(), + goods_trade: "国际商会仲裁院(ICC,总部巴黎)".to_string(), + intellectual_property: "法国知识产权法院/ICC".to_string(), + financial: "AMF调解/ICC/法国商事法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + _is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + ValidationResult::ApprovedWithConditions(vec![ + "必须通过公证人(Notaire)签署公证合同,否则合同无效".to_string(), + "须完成10天冷静期(买方保护)".to_string(), + "须在土地公示局完成登记".to_string(), + "须缴纳注册税约5.8%(旧房)或增值税20%(新房)".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/gb.rs b/nac-rwa-jurisdiction-adapters/src/gb.rs new file mode 100644 index 0000000..50d0baf --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/gb.rs @@ -0,0 +1,160 @@ +// 英国(GB)辖区适配器 +// 法律体系:普通法系 +// 主要法律:《土地登记法》(2002)《印花税土地税法》《金融服务和市场法》(FSMA 2000) + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct GbAdapter; + +impl JurisdictionAdapter for GbAdapter { + fn jurisdiction_code(&self) -> &'static str { "GB" } + fn jurisdiction_name(&self) -> &'static str { "大不列颠及北爱尔兰联合王国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CommonLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资可自由购买;须披露最终受益所有人(UBO)".to_string()), + required_approvals: vec!["英国土地注册局(HM Land Registry)".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合FCA监管要求".to_string()), + required_approvals: vec!["金融行为监管局(FCA)".to_string()], + }, + AssetCategorySupport { + category: "加密资产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须在FCA完成加密资产业务注册".to_string()), + required_approvals: vec!["金融行为监管局(FCA)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "英国土地注册局(HM Land Registry)".to_string(), + notarization_required: false, + notary_authority: None, + registration_process: "签订交换合同(Exchange of Contracts)→ 缴纳印花税土地税(SDLT,30天内)→ 完成交割(Completion)→ 向HM Land Registry申请产权登记(AP1表格)".to_string(), + foreign_buyer_restrictions: Some("外资可自由购买;海外实体须在英国海外实体登记册(ROE)登记并披露UBO".to_string()), + required_documents: vec![ + "买卖合同(Contract for Sale)".to_string(), + "产权文件(Title Deeds/Official Copies)".to_string(), + "护照/身份证".to_string(), + "SDLT申报表(SDLT1)".to_string(), + "转让契约(TR1 Transfer Deed)".to_string(), + "海外实体登记证明(海外实体)".to_string(), + ], + typical_completion_days: 90, + registration_fee_pct: 0.001, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("商务、能源和工业战略部(BEIS)/国家安全和投资局(NSI)".to_string()), + prohibited_sectors: vec![], + restricted_sectors: vec![ + "国防".to_string(), + "关键基础设施(能源/水/电信)".to_string(), + "人工智能".to_string(), + "量子技术".to_string(), + "半导体".to_string(), + "军民两用技术".to_string(), + ], + real_estate_restrictions: Some("海外实体须在ROE登记并披露UBO".to_string()), + legal_basis: "《国家安全和投资法》(NSI Act 2021)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "金融行为监管局".to_string(), + abbreviation: "FCA".to_string(), + jurisdiction_area: "银行、证券、保险、加密资产".to_string(), + website: Some("https://www.fca.org.uk".to_string()), + }, + RegulatoryBody { + name: "审慎监管局".to_string(), + abbreviation: "PRA".to_string(), + jurisdiction_area: "系统重要性金融机构审慎监管".to_string(), + website: Some("https://www.bankofengland.co.uk/prudential-regulation".to_string()), + }, + RegulatoryBody { + name: "英国土地注册局".to_string(), + abbreviation: "HMLR".to_string(), + jurisdiction_area: "不动产登记".to_string(), + website: Some("https://www.gov.uk/government/organisations/land-registry".to_string()), + }, + RegulatoryBody { + name: "英国知识产权局".to_string(), + abbreviation: "IPO".to_string(), + jurisdiction_area: "专利、商标、版权".to_string(), + website: Some("https://www.gov.uk/government/organisations/intellectual-property-office".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.12), // SDLT 最高12%(住宅) + real_estate_transfer_tax_seller: None, + stamp_duty: Some(0.02), // 海外买家附加2% + capital_gains_tax_resident: Some(0.24), // 不动产资本利得税24%(2024年起) + capital_gains_tax_nonresident: Some(0.24), + vat_or_gst: Some(0.20), // VAT 20%(商业不动产) + withholding_tax_dividend: Some(0.00), // 英国无股息预提税(居民) + withholding_tax_interest: Some(0.20), + withholding_tax_royalty: Some(0.20), + notes: Some("SDLT:住宅最高12%,海外买家额外+2%;不动产CGT 24%(2024年预算案);商业不动产VAT 20%".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "英格兰和威尔士高等法院(Chancery Division)".to_string(), + goods_trade: "伦敦国际仲裁院(LCIA)/ICC".to_string(), + intellectual_property: "英国知识产权企业法院/LCIA".to_string(), + financial: "金融监察专员服务(FOS)/LCIA".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "海外实体须在英国海外实体登记册(ROE)登记并披露UBO".to_string(), + "须缴纳SDLT(含海外买家附加2%)".to_string(), + "须在HM Land Registry完成产权登记".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳SDLT(30天内申报)".to_string(), + "须在HM Land Registry完成产权登记".to_string(), + ]) + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/hk.rs b/nac-rwa-jurisdiction-adapters/src/hk.rs new file mode 100644 index 0000000..bcc5830 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/hk.rs @@ -0,0 +1,162 @@ +// 香港(HK)辖区适配器 +// 法律体系:普通法系(英美法系) +// 主要法律:《土地注册条例》《印花税条例》《公司条例》《证券及期货条例》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct HkAdapter; + +impl JurisdictionAdapter for HkAdapter { + fn jurisdiction_code(&self) -> &'static str { "HK" } + fn jurisdiction_name(&self) -> &'static str { "中国香港特别行政区" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CommonLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产(住宅/商业/工业)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资可自由购买,但需缴纳额外印花税(BSD 15%)".to_string()), + required_approvals: vec!["土地注册处".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: None, + required_approvals: vec!["香港证监会(SFC)".to_string()], + }, + AssetCategorySupport { + category: "虚拟资产(合规)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须持有SFC颁发的虚拟资产服务提供商(VASP)牌照".to_string()), + required_approvals: vec!["香港证监会(SFC)VASP牌照".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "土地注册处(Land Registry)".to_string(), + notarization_required: false, + notary_authority: None, + registration_process: "签订临时买卖合约(PASP)→ 签订正式买卖合约(ASP)→ 缴纳印花税 → 完成交割 → 在土地注册处登记".to_string(), + foreign_buyer_restrictions: Some("外资买家须缴纳买家印花税(BSD)15%,加上从价印花税(AVD)最高15%".to_string()), + required_documents: vec![ + "临时买卖合约(PASP)".to_string(), + "正式买卖合约(ASP)".to_string(), + "身份证/护照".to_string(), + "印花税缴纳证明".to_string(), + "按揭文件(如适用)".to_string(), + "律师行转让契(Assignment)".to_string(), + ], + typical_completion_days: 60, + registration_fee_pct: 0.001, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: false, + review_authority: None, + prohibited_sectors: vec![], + restricted_sectors: vec![ + "广播(须持牌)".to_string(), + "电讯(须持牌)".to_string(), + ], + real_estate_restrictions: Some("外资可自由购买,但须缴纳买家印花税(BSD)15%".to_string()), + legal_basis: "香港基本法保障自由贸易和资本自由流动".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "香港证券及期货事务监察委员会".to_string(), + abbreviation: "SFC".to_string(), + jurisdiction_area: "证券、期货、虚拟资产监管".to_string(), + website: Some("https://www.sfc.hk".to_string()), + }, + RegulatoryBody { + name: "香港金融管理局".to_string(), + abbreviation: "HKMA".to_string(), + jurisdiction_area: "银行监管、货币政策".to_string(), + website: Some("https://www.hkma.gov.hk".to_string()), + }, + RegulatoryBody { + name: "土地注册处".to_string(), + abbreviation: "LR".to_string(), + jurisdiction_area: "不动产登记".to_string(), + website: Some("https://www.landreg.gov.hk".to_string()), + }, + RegulatoryBody { + name: "税务局".to_string(), + abbreviation: "IRD".to_string(), + jurisdiction_area: "税收征管".to_string(), + website: Some("https://www.ird.gov.hk".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.15), // AVD 最高 15% + real_estate_transfer_tax_seller: None, // 无卖方印花税(SSD 已于2023年取消) + stamp_duty: Some(0.15), // BSD(外资买家)15% + capital_gains_tax_resident: None, // 香港无资本利得税 + capital_gains_tax_nonresident: None, + vat_or_gst: None, // 香港无增值税/消费税 + withholding_tax_dividend: None, // 香港无股息预提税 + withholding_tax_interest: None, + withholding_tax_royalty: Some(0.045), // 特许权使用费预提税 4.5%(非居民) + notes: Some("外资买家须缴纳BSD 15%+AVD最高15%=合计最高30%;香港无资本利得税和增值税".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "香港高等法院原讼法庭".to_string(), + goods_trade: "香港国际仲裁中心(HKIAC)".to_string(), + intellectual_property: "香港知识产权法院/HKIAC".to_string(), + financial: "HKIAC/香港高等法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳买家印花税(BSD)15%".to_string(), + "须缴纳从价印花税(AVD)最高15%".to_string(), + "须通过持牌律师行完成转让".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳从价印花税(AVD)".to_string(), + "须在土地注册处完成登记".to_string(), + ]) + } + } + AssetCategory::DigitalAsset(_) => { + ValidationResult::ApprovedWithConditions(vec![ + "须持有SFC颁发的VASP牌照".to_string(), + "须符合SFC虚拟资产监管框架".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/jp.rs b/nac-rwa-jurisdiction-adapters/src/jp.rs new file mode 100644 index 0000000..8d68b18 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/jp.rs @@ -0,0 +1,156 @@ +// 日本(JP)辖区适配器 +// 法律体系:大陆法系(德国法影响) +// 主要法律:《民法》《不动产登记法》《外汇及外国贸易法》(外为法) + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct JpAdapter; + +impl JurisdictionAdapter for JpAdapter { + fn jurisdiction_code(&self) -> &'static str { "JP" } + fn jurisdiction_name(&self) -> &'static str { "日本国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CivilLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资可自由购买,但须向法务局登记;农地购买受限".to_string()), + required_approvals: vec!["法务局(登记所)".to_string()], + }, + AssetCategorySupport { + category: "证券/股权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("部分行业外资持股须事前申报(外为法)".to_string()), + required_approvals: vec!["金融厅(FSA)".to_string()], + }, + AssetCategorySupport { + category: "加密资产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须持有金融厅颁发的加密资产交换业者登录".to_string()), + required_approvals: vec!["金融厅(FSA)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "法务局(登记所)".to_string(), + notarization_required: false, // 日本不强制公证,但实践中常用司法书士 + notary_authority: Some("司法书士(Judicial Scrivener)——协助办理登记手续".to_string()), + registration_process: "签订买卖合同 → 支付手付金(定金)→ 缴纳不动产取得税 → 司法书士办理所有权移转登记 → 法务局完成登记".to_string(), + foreign_buyer_restrictions: Some("外资可自由购买不动产;农地购买须农业委员会许可;外为法要求事前申报(部分情况)".to_string()), + required_documents: vec![ + "买卖合同(売買契約書)".to_string(), + "登记原因证明信息(登記原因証明情報)".to_string(), + "印鉴证明(印鑑証明書)".to_string(), + "住民票/护照".to_string(), + "固定资产评价证明(固定資産評価証明書)".to_string(), + "登记识别信息(登記識別情報)".to_string(), + ], + typical_completion_days: 30, + registration_fee_pct: 0.002, // 登记免许税约0.2%-2% + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("财务省/经济产业省(外为法事前申报)".to_string()), + prohibited_sectors: vec![], + restricted_sectors: vec![ + "武器制造".to_string(), + "核能".to_string(), + "航空".to_string(), + "电信".to_string(), + "广播".to_string(), + "半导体(先进技术)".to_string(), + "农地".to_string(), + ], + real_estate_restrictions: Some("农地购买须农业委员会许可;森林购买须向都道府县知事申报".to_string()), + legal_basis: "《外国為替及び外国貿易法》(外为法)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "金融厅".to_string(), + abbreviation: "FSA".to_string(), + jurisdiction_area: "银行、证券、保险、加密资产".to_string(), + website: Some("https://www.fsa.go.jp".to_string()), + }, + RegulatoryBody { + name: "法务局".to_string(), + abbreviation: "MOJ".to_string(), + jurisdiction_area: "不动产登记".to_string(), + website: Some("https://www.moj.go.jp".to_string()), + }, + RegulatoryBody { + name: "特许厅".to_string(), + abbreviation: "JPO".to_string(), + jurisdiction_area: "专利、商标、外观设计".to_string(), + website: Some("https://www.jpo.go.jp".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.04), // 不动产取得税 4%(土地3%) + real_estate_transfer_tax_seller: None, + stamp_duty: Some(0.0002), // 印纸税(按合同金额) + capital_gains_tax_resident: Some(0.20), // 资本利得税20.315%(含住民税) + capital_gains_tax_nonresident: Some(0.20), + vat_or_gst: Some(0.10), // 消费税 10% + withholding_tax_dividend: Some(0.15), // 股息预提税15.315%(非居民) + withholding_tax_interest: Some(0.15), + withholding_tax_royalty: Some(0.20), + notes: Some("不动产取得税4%;登记免许税2%(所有权移转);固定资产税1.4%/年;消费税10%适用于商业不动产".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "日本法院(地方裁判所)".to_string(), + goods_trade: "日本商事仲裁机构(JCAA)/ICC".to_string(), + intellectual_property: "日本知识产权高等法院/JCAA".to_string(), + financial: "JCAA/日本证券业协会调解".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须在法务局完成所有权移转登记".to_string(), + "须缴纳不动产取得税4%和登记免许税2%".to_string(), + "外为法要求:部分情况须事前申报".to_string(), + "建议委托司法书士办理登记手续".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须在法务局完成所有权移转登记".to_string(), + "须缴纳不动产取得税和登记免许税".to_string(), + ]) + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/kr.rs b/nac-rwa-jurisdiction-adapters/src/kr.rs new file mode 100644 index 0000000..c25f2a0 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/kr.rs @@ -0,0 +1,145 @@ +// 韩国(KR)辖区适配器 +// 法律体系:大陆法系(德国法影响) +// 主要法律:《民法》《不动产登记法》《外国人土地法》《外国汇兑法》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct KrAdapter; + +impl JurisdictionAdapter for KrAdapter { + fn jurisdiction_code(&self) -> &'static str { "KR" } + fn jurisdiction_name(&self) -> &'static str { "大韩民国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CivilLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资购买须向土地管理事务所申报;军事保护区等特定区域受限".to_string()), + required_approvals: vec!["登记所(登記所)".to_string(), "土地管理事务所".to_string()], + }, + AssetCategorySupport { + category: "虚拟资产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须持有金融情报分析院(FIU)颁发的虚拟资产事业者(VASP)申报".to_string()), + required_approvals: vec!["金融情报分析院(FIU)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "登记所(法院登记所)".to_string(), + notarization_required: false, + notary_authority: None, + registration_process: "签订买卖合同 → 外资申报(外国人土地取得申报)→ 缴纳取得税 → 向登记所申请所有权移转登记".to_string(), + foreign_buyer_restrictions: Some("外资须向土地管理事务所申报;军事保护区、文化财保护区等特定区域须获许可".to_string()), + required_documents: vec![ + "买卖合同".to_string(), + "护照/外国人登录证".to_string(), + "外国人土地取得申报书(外资)".to_string(), + "取得税完税证明".to_string(), + "登记委任状".to_string(), + ], + typical_completion_days: 30, + registration_fee_pct: 0.002, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("产业通商资源部(外资申报)".to_string()), + prohibited_sectors: vec![ + "国家安全相关产业".to_string(), + ], + restricted_sectors: vec![ + "广播(外资股比≤49%)".to_string(), + "电信(外资股比≤49%)".to_string(), + "航空(外资股比≤50%)".to_string(), + ], + real_estate_restrictions: Some("军事保护区、文化财保护区等特定区域须获许可".to_string()), + legal_basis: "《外国人投资促进法》《外国人土地法》".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "金融委员会".to_string(), + abbreviation: "FSC".to_string(), + jurisdiction_area: "金融监管政策".to_string(), + website: Some("https://www.fsc.go.kr".to_string()), + }, + RegulatoryBody { + name: "金融监督院".to_string(), + abbreviation: "FSS".to_string(), + jurisdiction_area: "金融机构监督".to_string(), + website: Some("https://www.fss.or.kr".to_string()), + }, + RegulatoryBody { + name: "特许厅".to_string(), + abbreviation: "KIPO".to_string(), + jurisdiction_area: "专利、商标、版权".to_string(), + website: Some("https://www.kipo.go.kr".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.04), // 取得税 1%-4% + real_estate_transfer_tax_seller: None, + stamp_duty: Some(0.0003), + capital_gains_tax_resident: Some(0.45), // 转让所得税最高45%(短期持有) + capital_gains_tax_nonresident: Some(0.20), + vat_or_gst: Some(0.10), // 增值税 10% + withholding_tax_dividend: Some(0.22), // 股息预提税22%(非居民) + withholding_tax_interest: Some(0.22), + withholding_tax_royalty: Some(0.22), + notes: Some("不动产取得税1%-4%;短期持有(2年内)转让所得税最高45%;多套房持有者税率更高".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "韩国法院(地方法院)".to_string(), + goods_trade: "大韩商事仲裁院(KCAB)/ICC".to_string(), + intellectual_property: "韩国知识产权法院/KCAB".to_string(), + financial: "KCAB/韩国法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须向土地管理事务所提交外国人土地取得申报".to_string(), + "军事保护区等特定区域须获许可".to_string(), + "须缴纳取得税并完成登记所登记".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳取得税".to_string(), + "须在登记所完成所有权移转登记".to_string(), + ]) + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/lib.rs b/nac-rwa-jurisdiction-adapters/src/lib.rs new file mode 100644 index 0000000..8e48092 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/lib.rs @@ -0,0 +1,362 @@ +// NAC RWA 全球核心辖区适配器 +// 版本:1.0.0 +// 覆盖:CN / HK / SG / AE / US / EU-DE / EU-FR / JP / KR / AU / GB +// +// 每个辖区适配器提供: +// 1. 资产类型支持清单(哪些资产可在该辖区上链) +// 2. 产权登记要求(不动产/动产/IP 各自的登记机构和流程) +// 3. 合约要件(该辖区法律对合约形式的强制要求) +// 4. 税收规则(资产转让税、印花税、增值税、资本利得税等) +// 5. 监管机构清单 +// 6. 外资限制 +// 7. 争议解决首选机制 + +pub mod cn; +pub mod hk; +pub mod sg; +pub mod ae; +pub mod us; +pub mod eu_de; +pub mod eu_fr; +pub mod jp; +pub mod kr; +pub mod au; +pub mod gb; + +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; +use serde::{Deserialize, Serialize}; + +/// 辖区适配器特征 +pub trait JurisdictionAdapter { + /// 辖区代码(ISO 3166-1 alpha-2) + fn jurisdiction_code(&self) -> &'static str; + + /// 辖区全称 + fn jurisdiction_name(&self) -> &'static str; + + /// 法律体系 + fn legal_system(&self) -> LegalSystem; + + /// 支持的资产类别 + fn supported_asset_categories(&self) -> Vec; + + /// 不动产登记要求 + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq; + + /// 外资限制 + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions; + + /// 主要监管机构 + fn regulatory_bodies(&self) -> Vec; + + /// 资产转让税收摘要 + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary; + + /// 首选争议解决 + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference; + + /// 验证资产是否可在该辖区上链 + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult; +} + +/// 资产类别支持情况 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AssetCategorySupport { + pub category: String, + pub supported: bool, + pub foreign_entity_allowed: bool, + pub restrictions: Option, + pub required_approvals: Vec, +} + +/// 不动产登记要求 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RealEstateRegistrationReq { + /// 登记机构 + pub registry_authority: String, + /// 是否强制公证 + pub notarization_required: bool, + /// 公证机构 + pub notary_authority: Option, + /// 登记流程描述 + pub registration_process: String, + /// 外资购买限制 + pub foreign_buyer_restrictions: Option, + /// 所需文件清单 + pub required_documents: Vec, + /// 典型完成时间(工作日) + pub typical_completion_days: u32, + /// 登记费用(占交易价格百分比) + pub registration_fee_pct: f64, +} + +/// 外资限制 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ForeignInvestmentRestrictions { + /// 是否有外资审查机制 + pub has_fdi_review: bool, + /// 审查机构 + pub review_authority: Option, + /// 禁止外资进入的行业 + pub prohibited_sectors: Vec, + /// 需要审批的行业 + pub restricted_sectors: Vec, + /// 不动产外资限制 + pub real_estate_restrictions: Option, + /// 法律依据 + pub legal_basis: String, +} + +/// 监管机构 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RegulatoryBody { + pub name: String, + pub abbreviation: String, + pub jurisdiction_area: String, + pub website: Option, +} + +/// 资产转让税收摘要 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AssetTransferTaxSummary { + /// 不动产转让税(买方) + pub real_estate_transfer_tax_buyer: Option, + /// 不动产转让税(卖方) + pub real_estate_transfer_tax_seller: Option, + /// 印花税 + pub stamp_duty: Option, + /// 资本利得税(居民) + pub capital_gains_tax_resident: Option, + /// 资本利得税(非居民) + pub capital_gains_tax_nonresident: Option, + /// 增值税/消费税 + pub vat_or_gst: Option, + /// 预提税(股息) + pub withholding_tax_dividend: Option, + /// 预提税(利息) + pub withholding_tax_interest: Option, + /// 预提税(特许权使用费) + pub withholding_tax_royalty: Option, + /// 特别说明 + pub notes: Option, +} + +/// 争议解决偏好 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DisputeResolutionPreference { + /// 不动产争议 + pub real_estate: String, + /// 商品贸易争议 + pub goods_trade: String, + /// 知识产权争议 + pub intellectual_property: String, + /// 金融争议 + pub financial: String, + /// 是否支持外国仲裁裁决执行(《纽约公约》成员) + pub new_york_convention_member: bool, +} + +/// 验证结果 +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub enum ValidationResult { + Approved, + ApprovedWithConditions(Vec), + Rejected(String), + RequiresGovernmentApproval(String), +} + +/// 获取所有辖区适配器 +pub fn get_all_adapters() -> Vec> { + vec![ + Box::new(cn::CnAdapter), + Box::new(hk::HkAdapter), + Box::new(sg::SgAdapter), + Box::new(ae::AeAdapter), + Box::new(us::UsAdapter), + Box::new(eu_de::EuDeAdapter), + Box::new(eu_fr::EuFrAdapter), + Box::new(jp::JpAdapter), + Box::new(kr::KrAdapter), + Box::new(au::AuAdapter), + Box::new(gb::GbAdapter), + ] +} + +/// 按辖区代码查找适配器 +pub fn find_adapter(code: &str) -> Option> { + match code.to_uppercase().as_str() { + "CN" => Some(Box::new(cn::CnAdapter)), + "HK" => Some(Box::new(hk::HkAdapter)), + "SG" => Some(Box::new(sg::SgAdapter)), + "AE" => Some(Box::new(ae::AeAdapter)), + "US" => Some(Box::new(us::UsAdapter)), + "DE" | "EU-DE" => Some(Box::new(eu_de::EuDeAdapter)), + "FR" | "EU-FR" => Some(Box::new(eu_fr::EuFrAdapter)), + "JP" => Some(Box::new(jp::JpAdapter)), + "KR" => Some(Box::new(kr::KrAdapter)), + "AU" => Some(Box::new(au::AuAdapter)), + "GB" => Some(Box::new(gb::GbAdapter)), + _ => None, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_all_adapters_loadable() { + let adapters = get_all_adapters(); + assert_eq!(adapters.len(), 11); + let codes: Vec<&str> = adapters.iter().map(|a| a.jurisdiction_code()).collect(); + assert!(codes.contains(&"CN")); + assert!(codes.contains(&"HK")); + assert!(codes.contains(&"SG")); + assert!(codes.contains(&"AE")); + assert!(codes.contains(&"US")); + assert!(codes.contains(&"DE")); + assert!(codes.contains(&"FR")); + assert!(codes.contains(&"JP")); + assert!(codes.contains(&"KR")); + assert!(codes.contains(&"AU")); + assert!(codes.contains(&"GB")); + } + + #[test] + fn test_find_adapter_by_code() { + assert!(find_adapter("CN").is_some()); + assert!(find_adapter("cn").is_some()); + assert!(find_adapter("EU-DE").is_some()); + assert!(find_adapter("XX").is_none()); + } + + #[test] + fn test_all_adapters_have_regulatory_bodies() { + let adapters = get_all_adapters(); + for adapter in &adapters { + let bodies = adapter.regulatory_bodies(); + assert!( + !bodies.is_empty(), + "辖区 {} 没有监管机构", + adapter.jurisdiction_code() + ); + } + } + + #[test] + fn test_all_adapters_legal_systems() { + let adapters = get_all_adapters(); + for adapter in &adapters { + let _system = adapter.legal_system(); + // 只要能返回法律体系即可 + } + } + + #[test] + fn test_cn_real_estate_registration() { + let adapter = cn::CnAdapter; + let req = adapter.real_estate_registration_requirements(); + assert!(!req.registry_authority.is_empty()); + assert!(!req.required_documents.is_empty()); + assert!(req.typical_completion_days > 0); + } + + #[test] + fn test_de_notarization_required() { + let adapter = eu_de::EuDeAdapter; + let req = adapter.real_estate_registration_requirements(); + // 德国不动产交易必须公证 + assert!(req.notarization_required); + assert!(req.notary_authority.is_some()); + } + + #[test] + fn test_ae_no_capital_gains_tax() { + let adapter = ae::AeAdapter; + let tax = adapter.asset_transfer_tax_summary(); + // 阿联酋无资本利得税 + assert_eq!(tax.capital_gains_tax_resident, None); + assert_eq!(tax.capital_gains_tax_nonresident, None); + } + + #[test] + fn test_sg_absd_foreign_buyer() { + let adapter = sg::SgAdapter; + let tax = adapter.asset_transfer_tax_summary(); + // 新加坡外国买家额外印花税 60% + assert!(tax.notes.is_some()); + let notes = tax.notes.unwrap(); + assert!(notes.contains("ABSD") || notes.contains("60%")); + } + + #[test] + fn test_us_foreign_investment_review() { + let adapter = us::UsAdapter; + let fdi = adapter.foreign_investment_restrictions(); + // 美国有 CFIUS 审查 + assert!(fdi.has_fdi_review); + assert!(fdi.review_authority.is_some()); + } + + #[test] + fn test_cn_foreign_investment_restrictions() { + let adapter = cn::CnAdapter; + let fdi = adapter.foreign_investment_restrictions(); + assert!(fdi.has_fdi_review); + assert!(!fdi.prohibited_sectors.is_empty()); + } + + #[test] + fn test_new_york_convention_membership() { + // 主要辖区都应是《纽约公约》成员 + let members = vec!["CN", "HK", "SG", "AE", "US", "DE", "FR", "JP", "KR", "AU", "GB"]; + for code in members { + let adapter = find_adapter(code).unwrap(); + let dr = adapter.preferred_dispute_resolution(); + assert!( + dr.new_york_convention_member, + "辖区 {} 应为《纽约公约》成员", + code + ); + } + } + + #[test] + fn test_validate_real_estate_cn_foreign() { + let adapter = cn::CnAdapter; + let result = adapter.validate_asset_for_tokenization( + &AssetCategory::RealEstate(nac_rwa_legal_model::RealEstateSubtype::Residential), + true, // 外资 + ); + // 中国住宅外资有限制,应返回需要政府审批或有条件批准 + assert!( + matches!( + result, + ValidationResult::RequiresGovernmentApproval(_) + | ValidationResult::ApprovedWithConditions(_) + ), + "中国住宅外资应有限制" + ); + } + + #[test] + fn test_validate_ip_sg_foreign() { + let adapter = sg::SgAdapter; + let result = adapter.validate_asset_for_tokenization( + &AssetCategory::IntellectualProperty(nac_rwa_legal_model::IPSubtype::InventionPatent), + true, + ); + // 新加坡对 IP 外资友好 + assert!( + matches!( + result, + ValidationResult::Approved | ValidationResult::ApprovedWithConditions(_) + ), + "新加坡 IP 外资应可批准" + ); + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/sg.rs b/nac-rwa-jurisdiction-adapters/src/sg.rs new file mode 100644 index 0000000..c545028 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/sg.rs @@ -0,0 +1,156 @@ +// 新加坡(SG)辖区适配器 +// 法律体系:普通法系 +// 主要法律:《土地所有权法》《印花税法》《公司法》《证券期货法》《支付服务法》 + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem, RealEstateSubtype}; + +pub struct SgAdapter; + +impl JurisdictionAdapter for SgAdapter { + fn jurisdiction_code(&self) -> &'static str { "SG" } + fn jurisdiction_name(&self) -> &'static str { "新加坡共和国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CommonLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产(商业/工业)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资可购买商业/工业不动产,住宅受限".to_string()), + required_approvals: vec!["新加坡土地管理局(SLA)".to_string()], + }, + AssetCategorySupport { + category: "不动产(住宅公寓)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("外资可购买私人公寓,但须缴纳ABSD 60%(2023年起)".to_string()), + required_approvals: vec!["新加坡土地管理局(SLA)".to_string()], + }, + AssetCategorySupport { + category: "数字代币(证券型)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须持有MAS颁发的资本市场服务(CMS)牌照".to_string()), + required_approvals: vec!["新加坡金融管理局(MAS)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "新加坡土地管理局(Singapore Land Authority, SLA)".to_string(), + notarization_required: false, + notary_authority: None, + registration_process: "签订买卖协议(OTP/S&P)→ 缴纳印花税(14天内)→ 完成交割 → 在SLA完成产权转移登记(Caveat/Transfer)".to_string(), + foreign_buyer_restrictions: Some("外资购买住宅须缴纳ABSD 60%(2023年4月起);购买有地住宅须获得土地管理局批准".to_string()), + required_documents: vec![ + "购房意向书(OTP)或买卖合约(S&P)".to_string(), + "护照/身份证".to_string(), + "印花税缴纳证明(IRAS)".to_string(), + "按揭批准函(如适用)".to_string(), + "律师行转让文件".to_string(), + ], + typical_completion_days: 90, + registration_fee_pct: 0.001, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: false, + review_authority: None, + prohibited_sectors: vec![], + restricted_sectors: vec![ + "有地住宅(须土地管理局批准)".to_string(), + "媒体(须持牌)".to_string(), + ], + real_estate_restrictions: Some("外资购买住宅须缴纳ABSD 60%;有地住宅须获专项批准".to_string()), + legal_basis: "《住宅物业法》(Residential Property Act)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "新加坡金融管理局".to_string(), + abbreviation: "MAS".to_string(), + jurisdiction_area: "金融监管、数字资产、支付服务".to_string(), + website: Some("https://www.mas.gov.sg".to_string()), + }, + RegulatoryBody { + name: "新加坡土地管理局".to_string(), + abbreviation: "SLA".to_string(), + jurisdiction_area: "不动产登记、土地管理".to_string(), + website: Some("https://www.sla.gov.sg".to_string()), + }, + RegulatoryBody { + name: "新加坡税务局".to_string(), + abbreviation: "IRAS".to_string(), + jurisdiction_area: "税收征管".to_string(), + website: Some("https://www.iras.gov.sg".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: Some(0.04), // BSD 最高 4% + real_estate_transfer_tax_seller: None, + stamp_duty: Some(0.60), // ABSD 外资 60% + capital_gains_tax_resident: None, // 新加坡无资本利得税 + capital_gains_tax_nonresident: None, + vat_or_gst: Some(0.09), // GST 9%(2024年起) + withholding_tax_dividend: None, // 无股息预提税 + withholding_tax_interest: Some(0.15), + withholding_tax_royalty: Some(0.10), + notes: Some("外资买家ABSD 60%(2023年4月起);新加坡无资本利得税;GST 9%适用于商业交易".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "新加坡高等法院".to_string(), + goods_trade: "新加坡国际仲裁中心(SIAC)".to_string(), + intellectual_property: "新加坡知识产权法院/SIAC".to_string(), + financial: "SIAC/新加坡高等法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(subtype) => { + if is_foreign_entity { + match subtype { + RealEstateSubtype::Residential => { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳ABSD 60%(外资买家)".to_string(), + "有地住宅须获土地管理局专项批准".to_string(), + ]) + } + _ => ValidationResult::ApprovedWithConditions(vec![ + "商业/工业不动产外资可自由购买".to_string(), + "须在SLA完成产权登记".to_string(), + ]), + } + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须缴纳BSD印花税".to_string(), + "须在SLA完成产权登记".to_string(), + ]) + } + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-jurisdiction-adapters/src/us.rs b/nac-rwa-jurisdiction-adapters/src/us.rs new file mode 100644 index 0000000..80568e7 --- /dev/null +++ b/nac-rwa-jurisdiction-adapters/src/us.rs @@ -0,0 +1,176 @@ +// 美国(US)辖区适配器 +// 法律体系:普通法系(联邦+各州法律并行) +// 主要法律:《统一商法典》(UCC)《证券法》《外国投资国家安全审查法》(FIRRMA) + +use crate::{ + AssetCategorySupport, AssetTransferTaxSummary, DisputeResolutionPreference, + ForeignInvestmentRestrictions, JurisdictionAdapter, RealEstateRegistrationReq, + RegulatoryBody, ValidationResult, +}; +use nac_rwa_legal_model::{AssetCategory, LegalSystem}; + +pub struct UsAdapter; + +impl JurisdictionAdapter for UsAdapter { + fn jurisdiction_code(&self) -> &'static str { "US" } + fn jurisdiction_name(&self) -> &'static str { "美利坚合众国" } + fn legal_system(&self) -> LegalSystem { LegalSystem::CommonLaw } + + fn supported_asset_categories(&self) -> Vec { + vec![ + AssetCategorySupport { + category: "不动产".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("FIRPTA要求外资出售不动产时预扣15%税款;CFIUS可审查涉及敏感地点的不动产".to_string()), + required_approvals: vec!["县级产权登记处(County Recorder)".to_string()], + }, + AssetCategorySupport { + category: "证券(股权/债券)".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: Some("须符合SEC注册要求或豁免条款(Reg S/Reg D)".to_string()), + required_approvals: vec!["美国证券交易委员会(SEC)".to_string()], + }, + AssetCategorySupport { + category: "知识产权".to_string(), + supported: true, + foreign_entity_allowed: true, + restrictions: None, + required_approvals: vec!["美国专利商标局(USPTO)".to_string()], + }, + ] + } + + fn real_estate_registration_requirements(&self) -> RealEstateRegistrationReq { + RealEstateRegistrationReq { + registry_authority: "县级产权登记处(County Recorder/Register of Deeds)".to_string(), + notarization_required: true, + notary_authority: Some("公证人(Notary Public)".to_string()), + registration_process: "签订购房合同(Purchase Agreement)→ 产权调查(Title Search)→ 购买产权保险(Title Insurance)→ 托管(Escrow)→ 交割(Closing)→ 在县级登记处记录地契(Deed Recording)".to_string(), + foreign_buyer_restrictions: Some("FIRPTA:外资出售美国不动产须预扣15%税款;CFIUS可审查涉及军事基地附近的不动产收购".to_string()), + required_documents: vec![ + "购房合同(Purchase Agreement)".to_string(), + "地契(Deed:Warranty Deed/Quitclaim Deed)".to_string(), + "产权保险(Title Insurance)".to_string(), + "结算声明(Closing Disclosure/HUD-1)".to_string(), + "按揭文件(如适用)".to_string(), + "FIRPTA证明(外资卖方)".to_string(), + ], + typical_completion_days: 45, + registration_fee_pct: 0.001, + } + } + + fn foreign_investment_restrictions(&self) -> ForeignInvestmentRestrictions { + ForeignInvestmentRestrictions { + has_fdi_review: true, + review_authority: Some("美国外国投资委员会(CFIUS)".to_string()), + prohibited_sectors: vec![ + "国防(部分)".to_string(), + "核能(部分)".to_string(), + ], + restricted_sectors: vec![ + "电信(FCC审查)".to_string(), + "航空(外资股比≤25%)".to_string(), + "广播(外资股比≤25%)".to_string(), + "银行(OCC/Fed审查)".to_string(), + "关键基础设施(CFIUS审查)".to_string(), + "敏感个人数据(CFIUS审查)".to_string(), + "军事基地附近不动产(CFIUS审查)".to_string(), + ], + real_estate_restrictions: Some("CFIUS可审查军事基地附近不动产;FIRPTA要求外资出售时预扣税".to_string()), + legal_basis: "《外国投资风险审查现代化法》(FIRRMA 2018)".to_string(), + } + } + + fn regulatory_bodies(&self) -> Vec { + vec![ + RegulatoryBody { + name: "美国证券交易委员会".to_string(), + abbreviation: "SEC".to_string(), + jurisdiction_area: "证券、交易所、投资顾问".to_string(), + website: Some("https://www.sec.gov".to_string()), + }, + RegulatoryBody { + name: "美国商品期货交易委员会".to_string(), + abbreviation: "CFTC".to_string(), + jurisdiction_area: "期货、衍生品、数字资产(部分)".to_string(), + website: Some("https://www.cftc.gov".to_string()), + }, + RegulatoryBody { + name: "美国专利商标局".to_string(), + abbreviation: "USPTO".to_string(), + jurisdiction_area: "专利、商标".to_string(), + website: Some("https://www.uspto.gov".to_string()), + }, + RegulatoryBody { + name: "美国财政部海外资产控制办公室".to_string(), + abbreviation: "OFAC".to_string(), + jurisdiction_area: "制裁、反洗钱".to_string(), + website: Some("https://ofac.treasury.gov".to_string()), + }, + RegulatoryBody { + name: "美国外国投资委员会".to_string(), + abbreviation: "CFIUS".to_string(), + jurisdiction_area: "外资安全审查".to_string(), + website: Some("https://home.treasury.gov/policy-issues/international/the-committee-on-foreign-investment-in-the-united-states-cfius".to_string()), + }, + ] + } + + fn asset_transfer_tax_summary(&self) -> AssetTransferTaxSummary { + AssetTransferTaxSummary { + real_estate_transfer_tax_buyer: None, + real_estate_transfer_tax_seller: Some(0.01), // 各州不同,约0.1%-2% + stamp_duty: Some(0.005), // 各州转让税约0.1%-2% + capital_gains_tax_resident: Some(0.20), // 长期资本利得税最高20% + capital_gains_tax_nonresident: Some(0.30), // FIRPTA 预扣15%,最终税率更高 + vat_or_gst: None, // 美国无联邦增值税(各州有销售税) + withholding_tax_dividend: Some(0.30), // 非居民股息预提税30%(DTA可降低) + withholding_tax_interest: Some(0.30), + withholding_tax_royalty: Some(0.30), + notes: Some("各州税率差异大;FIRPTA预扣15%(外资出售不动产);非居民预提税30%(DTA可降低)".to_string()), + } + } + + fn preferred_dispute_resolution(&self) -> DisputeResolutionPreference { + DisputeResolutionPreference { + real_estate: "各州法院(不动产所在地)".to_string(), + goods_trade: "美国仲裁协会(AAA)/ICC".to_string(), + intellectual_property: "美国联邦地区法院/AAA".to_string(), + financial: "FINRA(证券)/AAA/联邦法院".to_string(), + new_york_convention_member: true, + } + } + + fn validate_asset_for_tokenization( + &self, + asset: &AssetCategory, + is_foreign_entity: bool, + ) -> ValidationResult { + match asset { + AssetCategory::RealEstate(_) => { + if is_foreign_entity { + ValidationResult::ApprovedWithConditions(vec![ + "须遵守FIRPTA(出售时预扣15%税款)".to_string(), + "涉及军事基地附近须通过CFIUS审查".to_string(), + "须购买产权保险(Title Insurance)".to_string(), + ]) + } else { + ValidationResult::ApprovedWithConditions(vec![ + "须在县级登记处完成地契记录".to_string(), + "建议购买产权保险".to_string(), + ]) + } + } + AssetCategory::FinancialAsset(_) => { + ValidationResult::ApprovedWithConditions(vec![ + "须符合SEC注册要求或豁免条款(Reg S/Reg D/Reg A+)".to_string(), + "向非美国投资者发行须符合Reg S".to_string(), + ]) + } + _ => ValidationResult::Approved, + } + } +} diff --git a/nac-rwa-legal-model/Cargo.lock b/nac-rwa-legal-model/Cargo.lock new file mode 100644 index 0000000..5d7153d --- /dev/null +++ b/nac-rwa-legal-model/Cargo.lock @@ -0,0 +1,96 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "nac-rwa-legal-model" +version = "1.0.0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/nac-rwa-legal-model/Cargo.toml b/nac-rwa-legal-model/Cargo.toml new file mode 100644 index 0000000..124f129 --- /dev/null +++ b/nac-rwa-legal-model/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "nac-rwa-legal-model" +version = "1.0.0" +edition = "2021" +description = "NAC RWA 全球资产上链法律要素抽象数据模型 — 覆盖资产类型、产权结构、合约要件、税收要素、跨境规则" +authors = ["NAC Development Team"] + +[lib] +name = "nac_rwa_legal_model" +path = "src/lib.rs" + +[lints.rust] +warnings = "deny" + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" + +[dev-dependencies] diff --git a/nac-rwa-legal-model/src/asset_types.rs b/nac-rwa-legal-model/src/asset_types.rs new file mode 100644 index 0000000..e4204fd --- /dev/null +++ b/nac-rwa-legal-model/src/asset_types.rs @@ -0,0 +1,240 @@ +// NAC RWA 资产类型枚举 — 全球资产分类标准 +// 基于 ACC-20 协议,覆盖全球主要资产类别 + +use serde::{Deserialize, Serialize}; + +/// 顶级资产类别 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum AssetCategory { + /// 不动产(Real Estate) + RealEstate(RealEstateSubtype), + /// 动产/商品(Movable Property / Goods) + MovableProperty(MovablePropertySubtype), + /// 知识产权(Intellectual Property) + IntellectualProperty(IPSubtype), + /// 金融资产(Financial Assets) + FinancialAsset(FinancialAssetSubtype), + /// 大宗商品(Commodities) + Commodity(CommoditySubtype), + /// 数字资产(Digital Assets) + DigitalAsset(DigitalAssetSubtype), + /// 自然资源(Natural Resources) + NaturalResource(NaturalResourceSubtype), +} + +/// 不动产子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum RealEstateSubtype { + /// 住宅(Residential) + Residential, + /// 商业地产(Commercial) + Commercial, + /// 工业地产(Industrial) + Industrial, + /// 农业用地(Agricultural) + Agricultural, + /// 土地(Land / Plot) + Land, + /// 酒店/度假村(Hospitality) + Hospitality, + /// 混合用途(Mixed Use) + MixedUse, + /// 基础设施(Infrastructure) + Infrastructure, +} + +/// 动产子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum MovablePropertySubtype { + /// 消费品(Consumer Goods) + ConsumerGoods, + /// 工业设备(Industrial Equipment) + IndustrialEquipment, + /// 交通工具(Vehicles) + Vehicles, + /// 艺术品/收藏品(Art & Collectibles) + ArtAndCollectibles, + /// 奢侈品(Luxury Goods) + LuxuryGoods, + /// 电子产品(Electronics) + Electronics, + /// 医疗设备(Medical Equipment) + MedicalEquipment, +} + +/// 知识产权子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum IPSubtype { + /// 发明专利(Invention Patent) + InventionPatent, + /// 实用新型专利(Utility Model) + UtilityModel, + /// 外观设计专利(Design Patent) + DesignPatent, + /// 商标(Trademark) + Trademark, + /// 版权/著作权(Copyright) + Copyright, + /// 商业秘密/技术秘密(Trade Secret) + TradeSecret, + /// 软件著作权(Software Copyright) + SoftwareCopyright, + /// 地理标志(Geographical Indication) + GeographicalIndication, + /// 植物新品种权(Plant Variety Right) + PlantVarietyRight, +} + +/// 金融资产子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum FinancialAssetSubtype { + /// 股权(Equity / Shares) + Equity, + /// 债券(Bond / Debt) + Bond, + /// 基金份额(Fund Share) + FundShare, + /// 信托受益权(Trust Beneficiary Right) + TrustBeneficiaryRight, + /// 应收账款(Accounts Receivable) + AccountsReceivable, + /// 保险权益(Insurance Interest) + InsuranceInterest, + /// 伊斯兰债券(Sukuk) + Sukuk, + /// 资产支持证券(ABS) + AssetBackedSecurity, +} + +/// 大宗商品子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum CommoditySubtype { + /// 贵金属(Precious Metals) + PreciousMetals, + /// 工业金属(Industrial Metals) + IndustrialMetals, + /// 能源(Energy) + Energy, + /// 农产品(Agricultural Products) + AgriculturalProducts, + /// 软商品(Soft Commodities) + SoftCommodities, + /// 矿产资源(Minerals) + Minerals, +} + +/// 数字资产子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum DigitalAssetSubtype { + /// 数据资产(Data Assets) + DataAssets, + /// 域名(Domain Names) + DomainNames, + /// 数字内容(Digital Content) + DigitalContent, + /// 碳信用(Carbon Credits) + CarbonCredits, + /// 排放权(Emission Rights) + EmissionRights, +} + +/// 自然资源子类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum NaturalResourceSubtype { + /// 水权(Water Rights) + WaterRights, + /// 采矿权(Mining Rights) + MiningRights, + /// 林权(Forest Rights) + ForestRights, + /// 渔业权(Fishing Rights) + FishingRights, + /// 油气权益(Oil & Gas Rights) + OilGasRights, +} + +impl AssetCategory { + /// 返回资产类别的标准名称(英文) + pub fn category_name(&self) -> &'static str { + match self { + AssetCategory::RealEstate(_) => "Real Estate", + AssetCategory::MovableProperty(_) => "Movable Property", + AssetCategory::IntellectualProperty(_) => "Intellectual Property", + AssetCategory::FinancialAsset(_) => "Financial Asset", + AssetCategory::Commodity(_) => "Commodity", + AssetCategory::DigitalAsset(_) => "Digital Asset", + AssetCategory::NaturalResource(_) => "Natural Resource", + } + } + + /// 判断是否需要实物交割 + pub fn requires_physical_delivery(&self) -> bool { + matches!( + self, + AssetCategory::MovableProperty(_) | AssetCategory::Commodity(_) + ) + } + + /// 判断是否需要政府登记 + pub fn requires_government_registration(&self) -> bool { + matches!( + self, + AssetCategory::RealEstate(_) + | AssetCategory::IntellectualProperty(_) + | AssetCategory::NaturalResource(_) + ) + } + + /// 判断是否适用伊斯兰金融规则 + pub fn may_require_sharia_compliance(&self) -> bool { + matches!( + self, + AssetCategory::FinancialAsset(_) | AssetCategory::RealEstate(_) + ) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_real_estate_requires_registration() { + let asset = AssetCategory::RealEstate(RealEstateSubtype::Residential); + assert!(asset.requires_government_registration()); + assert!(!asset.requires_physical_delivery()); + } + + #[test] + fn test_commodity_requires_delivery() { + let asset = AssetCategory::Commodity(CommoditySubtype::PreciousMetals); + assert!(asset.requires_physical_delivery()); + assert!(!asset.requires_government_registration()); + } + + #[test] + fn test_ip_requires_registration() { + let asset = AssetCategory::IntellectualProperty(IPSubtype::InventionPatent); + assert!(asset.requires_government_registration()); + } + + #[test] + fn test_financial_may_require_sharia() { + let asset = AssetCategory::FinancialAsset(FinancialAssetSubtype::Bond); + assert!(asset.may_require_sharia_compliance()); + } + + #[test] + fn test_sukuk_is_financial_asset() { + let asset = AssetCategory::FinancialAsset(FinancialAssetSubtype::Sukuk); + assert!(asset.may_require_sharia_compliance()); + assert_eq!(asset.category_name(), "Financial Asset"); + } + + #[test] + fn test_digital_asset_no_physical_delivery() { + let asset = AssetCategory::DigitalAsset(DigitalAssetSubtype::CarbonCredits); + assert!(!asset.requires_physical_delivery()); + assert!(!asset.requires_government_registration()); + } +} diff --git a/nac-rwa-legal-model/src/contract_elements.rs b/nac-rwa-legal-model/src/contract_elements.rs new file mode 100644 index 0000000..3a33afd --- /dev/null +++ b/nac-rwa-legal-model/src/contract_elements.rs @@ -0,0 +1,571 @@ +// NAC RWA 合约要件模型 +// 基于全球主要法律体系的合约法理论,定义资产交易合约的通用要件 + +use serde::{Deserialize, Serialize}; +use crate::asset_types::AssetCategory; +use crate::ownership::LegalEntityType; + +/// 合约类型枚举 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum ContractType { + // ===== 不动产合约 ===== + /// 不动产买卖合同 + RealEstateSaleContract, + /// 不动产租赁合同 + RealEstateLeaseContract, + /// 不动产抵押合同 + RealEstateMortgageContract, + /// 不动产产权转移文书 + RealEstateTitleTransfer, + /// 不动产开发合同 + RealEstateDevelopmentContract, + /// 不动产委托管理合同 + RealEstateManagementContract, + + // ===== 动产/商品合约 ===== + /// 国内商品买卖合同 + GoodsSaleContractDomestic, + /// 跨境商品买卖合同(适用 CISG) + GoodsSaleContractCrossBorder, + /// 分销协议 + DistributionAgreement, + /// 仓储合同 + WarehouseContract, + /// 运输合同 + TransportContract, + /// 保险合同 + InsuranceContract, + /// 信用证 + LetterOfCredit, + + // ===== 知识产权合约 ===== + /// 专利转让合同 + PatentAssignment, + /// 专利许可合同(独占) + PatentLicenseExclusive, + /// 专利许可合同(非独占) + PatentLicenseNonExclusive, + /// 商标转让合同 + TrademarkAssignment, + /// 商标许可合同 + TrademarkLicense, + /// 版权转让合同 + CopyrightAssignment, + /// 版权授权合同 + CopyrightLicense, + /// 技术秘密保密协议(NDA) + TradeSecretNDA, + /// 技术许可合同 + TechnologyLicense, + /// 软件许可协议 + SoftwareLicenseAgreement, + + // ===== 金融资产合约 ===== + /// 股权转让协议 + EquityTransferAgreement, + /// 股权认购协议 + EquitySubscriptionAgreement, + /// 债券认购协议 + BondSubscriptionAgreement, + /// 基金份额转让合同 + FundShareTransfer, + /// 信托文件 + TrustDeed, + /// 资产支持证券合同 + ABSContract, + + // ===== 伊斯兰合规合约 ===== + /// 穆拉巴哈(成本加利润融资) + MurabahaContract, + /// 伊贾拉(伊斯兰租赁) + IjaraContract, + /// 苏库克(伊斯兰债券) + SukukContract, + /// 穆沙拉卡(合伙融资) + MusharakaContract, + /// 穆达拉巴(利润分享) + MudarabaContract, + + // ===== 通用合约 ===== + /// 意向书(LOI) + LetterOfIntent, + /// 备忘录(MOU) + MemorandumOfUnderstanding, + /// 托管协议 + EscrowAgreement, + /// 担保合同 + GuaranteeContract, +} + +/// 合约形式要求(各法律体系差异) +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum ContractFormRequirement { + /// 无特殊形式要求(口头/书面均可) + NoFormRequirement, + /// 必须书面形式 + WrittenRequired, + /// 必须公证(大陆法系不动产) + NotarizationRequired, + /// 必须登记备案 + RegistrationRequired, + /// 必须公证+登记 + NotarizationAndRegistration, + /// 必须经政府审批 + GovernmentApprovalRequired, + /// 必须经监管机构批准 + RegulatoryApprovalRequired, + /// 必须由特定专业人士出具(如日本宅建士) + ProfessionalCertificationRequired(String), + /// 伊斯兰合规认证 + ShariaComplianceCertification, +} + +/// 合约当事人 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractParty { + /// 当事人角色 + pub role: PartyRole, + /// 法律主体类型 + pub entity_type: LegalEntityType, + /// 所在辖区 + pub jurisdiction: String, + /// 是否为外国人/外资 + pub is_foreign: bool, + /// 身份验证状态 + pub identity_verified: bool, + /// KYC 等级 + pub kyc_level: KycLevel, +} + +/// 当事人角色 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum PartyRole { + Seller, + Buyer, + Lessor, + Lessee, + Licensor, + Licensee, + Mortgagor, + Mortgagee, + Trustor, + Trustee, + Beneficiary, + Guarantor, + Agent, + Escrow, +} + +/// KYC 等级 +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] +pub enum KycLevel { + None = 0, + Basic = 1, + Enhanced = 2, + Institutional = 3, +} + +/// 合约标的物描述 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractSubjectMatter { + /// 资产类别 + pub asset_category: AssetCategory, + /// 资产描述 + pub description: String, + /// 资产所在辖区 + pub asset_jurisdiction: String, + /// 数量/面积/规模 + pub quantity: Option, + /// 计量单位 + pub unit: Option, + /// 资产唯一标识(链上 TOKEN ID) + pub token_id: Option, + /// 资产估值(USD) + pub valuation_usd: Option, +} + +/// 价格与对价 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractConsideration { + /// 合同价格 + pub price: f64, + /// 货币 + pub currency: String, + /// 是否为公允市场价值 + pub is_fair_market_value: bool, + /// 支付方式 + pub payment_method: PaymentMethod, + /// 分期付款安排 + pub installment_schedule: Option>, + /// 定金/保证金 + pub deposit: Option, + /// 定金比例 + pub deposit_ratio: Option, +} + +/// 支付方式 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum PaymentMethod { + /// 一次性付清 + LumpSum, + /// 分期付款 + Installment, + /// 信用证 + LetterOfCredit, + /// 托管支付 + Escrow, + /// 链上支付(XTZH) + OnChainXTZH, + /// 伊斯兰融资(Murabaha) + IslamicFinancing, + /// 以物易物 + Barter, +} + +/// 分期付款计划 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InstallmentPayment { + /// 期次 + pub sequence: u32, + /// 金额 + pub amount: f64, + /// 到期日(Unix 时间戳) + pub due_date: u64, + /// 是否已支付 + pub paid: bool, +} + +/// 交付条件(主要用于动产/商品) +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum DeliveryTerms { + /// EXW — 工厂交货 + ExWorks, + /// FOB — 装运港船上交货 + FOB, + /// CIF — 成本+保险+运费 + CIF, + /// DDP — 完税后交货 + DDP, + /// DAP — 目的地交货 + DAP, + /// CFR — 成本加运费 + CFR, + /// FCA — 货交承运人 + FCA, + /// 数字交付(用于知识产权、数字资产) + DigitalDelivery, + /// 链上交付(产权直接在链上转移) + OnChainTransfer, +} + +/// 风险转移节点 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum RiskTransferPoint { + /// 合同签署时 + AtContractSigning, + /// 定金支付时 + AtDepositPayment, + /// 全款支付时 + AtFullPayment, + /// 实物交付时 + AtPhysicalDelivery, + /// 产权登记完成时 + AtRegistration, + /// 链上确认时 + AtOnChainConfirmation, + /// 装运时(FOB) + AtShipment, + /// 到港时 + AtArrival, +} + +/// 争议解决机制 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DisputeResolution { + /// 适用法律 + pub governing_law: String, + /// 争议解决方式 + pub mechanism: DisputeMechanism, + /// 仲裁机构(如适用) + pub arbitration_body: Option, + /// 仲裁地点 + pub arbitration_seat: Option, + /// 仲裁语言 + pub arbitration_language: Option, +} + +/// 争议解决方式 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum DisputeMechanism { + /// 诉讼(法院) + Litigation, + /// 仲裁 + Arbitration, + /// 调解 + Mediation, + /// 调解+仲裁 + MediationThenArbitration, + /// 智能合约自动执行 + SmartContractAutoExecution, +} + +/// 主要仲裁机构 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum ArbitrationBody { + /// 国际商会仲裁院(ICC) + ICC, + /// 中国国际经济贸易仲裁委员会(CIETAC) + CIETAC, + /// 新加坡国际仲裁中心(SIAC) + SIAC, + /// 香港国际仲裁中心(HKIAC) + HKIAC, + /// 伦敦国际仲裁院(LCIA) + LCIA, + /// 美国仲裁协会(AAA) + AAA, + /// 日本商事仲裁协会(JCAA) + JCAA, + /// 迪拜国际仲裁中心(DIAC) + DIAC, + /// 吉隆坡区域仲裁中心(KLRCA) + KLRCA, + /// 联合国国际贸易法委员会(UNCITRAL) + UNCITRAL, +} + +/// 合约核心要件(通用抽象层) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ContractCoreElements { + /// 合约类型 + pub contract_type: ContractType, + /// 合约形式要求 + pub form_requirement: ContractFormRequirement, + /// 当事人列表 + pub parties: Vec, + /// 标的物 + pub subject_matter: ContractSubjectMatter, + /// 对价 + pub consideration: ContractConsideration, + /// 交付条件 + pub delivery_terms: DeliveryTerms, + /// 风险转移节点 + pub risk_transfer: RiskTransferPoint, + /// 争议解决 + pub dispute_resolution: DisputeResolution, + /// 合同有效期(Unix 时间戳) + pub effective_date: u64, + /// 合同终止日(None 表示永久) + pub expiry_date: Option, + /// 必须附带的文件清单 + pub required_documents: Vec, + /// 特殊条款(辖区特定) + pub special_clauses: Vec, +} + +/// 必要附件文件 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RequiredDocument { + /// 文件名称 + pub name: String, + /// 文件类型 + pub doc_type: DocumentType, + /// 是否强制(false 表示可选) + pub mandatory: bool, + /// 签发机构 + pub issuing_authority: Option, + /// 有效期(天,None 表示永久有效) + pub validity_days: Option, +} + +/// 文件类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum DocumentType { + /// 产权证书 + TitleCertificate, + /// 公证书 + NotarialDeed, + /// 政府批准文件 + GovernmentApproval, + /// 税务完税证明 + TaxClearanceCertificate, + /// 无抵押证明 + EncumbranceClearance, + /// 身份证明 + IdentityDocument, + /// 营业执照 + BusinessLicense, + /// 估值报告 + ValuationReport, + /// 环境评估报告 + EnvironmentalAssessment, + /// 检验证书 + InspectionCertificate, + /// 原产地证明 + CertificateOfOrigin, + /// 伊斯兰合规证书 + ShariaComplianceCertificate, + /// 知识产权登记证 + IPRegistrationCertificate, + /// 无异议证明(NOC) + NoObjectionCertificate, + /// 链上权证(NAC 特有) + OnChainTitleCertificate, +} + +impl ContractCoreElements { + /// 验证合约要件完整性 + pub fn validate(&self) -> Result<(), Vec> { + let mut errors = Vec::new(); + + // 检查当事人 + if self.parties.len() < 2 { + errors.push("合约至少需要两个当事人".to_string()); + } + + // 检查价格合理性 + if self.consideration.price <= 0.0 { + errors.push("合约价格必须大于零".to_string()); + } + + // 检查 KYC 要求 + for party in &self.parties { + if !party.identity_verified { + errors.push(format!("{:?} 的身份未经验证", party.role)); + } + } + + // 检查必要文件 + let missing_docs: Vec = self + .required_documents + .iter() + .filter(|d| d.mandatory) + .filter(|_| false) // 实际检查由辖区适配器完成 + .map(|d| d.name.clone()) + .collect(); + + if !missing_docs.is_empty() { + errors.push(format!("缺少必要文件: {}", missing_docs.join(", "))); + } + + if errors.is_empty() { + Ok(()) + } else { + Err(errors) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::asset_types::{AssetCategory, RealEstateSubtype}; + + fn make_party(role: PartyRole, jurisdiction: &str) -> ContractParty { + ContractParty { + role, + entity_type: LegalEntityType::NaturalPerson, + jurisdiction: jurisdiction.to_string(), + is_foreign: false, + identity_verified: true, + kyc_level: KycLevel::Enhanced, + } + } + + #[test] + fn test_contract_type_variants() { + // 确保所有合约类型都可以创建 + let types = vec![ + ContractType::RealEstateSaleContract, + ContractType::GoodsSaleContractCrossBorder, + ContractType::PatentLicenseExclusive, + ContractType::MurabahaContract, + ContractType::SukukContract, + ]; + assert_eq!(types.len(), 5); + } + + #[test] + fn test_contract_validation_requires_two_parties() { + let elements = ContractCoreElements { + contract_type: ContractType::RealEstateSaleContract, + form_requirement: ContractFormRequirement::NotarizationAndRegistration, + parties: vec![make_party(PartyRole::Seller, "CN")], // 只有一个当事人 + subject_matter: ContractSubjectMatter { + asset_category: AssetCategory::RealEstate(RealEstateSubtype::Residential), + description: "上海市浦东新区某住宅".to_string(), + asset_jurisdiction: "CN".to_string(), + quantity: Some(120.0), + unit: Some("平方米".to_string()), + token_id: None, + valuation_usd: Some(500_000.0), + }, + consideration: ContractConsideration { + price: 3_500_000.0, + currency: "CNY".to_string(), + is_fair_market_value: true, + payment_method: PaymentMethod::LumpSum, + installment_schedule: None, + deposit: Some(350_000.0), + deposit_ratio: Some(0.1), + }, + delivery_terms: DeliveryTerms::OnChainTransfer, + risk_transfer: RiskTransferPoint::AtRegistration, + dispute_resolution: DisputeResolution { + governing_law: "中华人民共和国法律".to_string(), + mechanism: DisputeMechanism::Arbitration, + arbitration_body: Some(ArbitrationBody::CIETAC), + arbitration_seat: Some("上海".to_string()), + arbitration_language: Some("中文".to_string()), + }, + effective_date: 1741305600, + expiry_date: None, + required_documents: vec![], + special_clauses: vec![], + }; + + let result = elements.validate(); + assert!(result.is_err()); + let errors = result.unwrap_err(); + assert!(errors.iter().any(|e| e.contains("两个当事人"))); + } + + #[test] + fn test_delivery_terms_for_ip() { + // 知识产权应使用数字交付 + let terms = DeliveryTerms::DigitalDelivery; + assert_eq!(terms, DeliveryTerms::DigitalDelivery); + } + + #[test] + fn test_arbitration_bodies() { + // 验证主要仲裁机构枚举 + let bodies = vec![ + ArbitrationBody::ICC, + ArbitrationBody::CIETAC, + ArbitrationBody::SIAC, + ArbitrationBody::HKIAC, + ArbitrationBody::DIAC, + ]; + assert_eq!(bodies.len(), 5); + } + + #[test] + fn test_islamic_contract_types() { + let islamic_types = vec![ + ContractType::MurabahaContract, + ContractType::IjaraContract, + ContractType::SukukContract, + ContractType::MusharakaContract, + ContractType::MudarabaContract, + ]; + assert_eq!(islamic_types.len(), 5); + } + + #[test] + fn test_kyc_level_ordering() { + assert!(KycLevel::Institutional > KycLevel::Enhanced); + assert!(KycLevel::Enhanced > KycLevel::Basic); + assert!(KycLevel::Basic > KycLevel::None); + } +} diff --git a/nac-rwa-legal-model/src/cross_border.rs b/nac-rwa-legal-model/src/cross_border.rs new file mode 100644 index 0000000..7cfd5d5 --- /dev/null +++ b/nac-rwa-legal-model/src/cross_border.rs @@ -0,0 +1,685 @@ +// NAC RWA 跨境要素模型 +// 覆盖全球主要双边贸易规则、关税体系、技术标准互认、争议解决机制 + +use serde::{Deserialize, Serialize}; + +/// 贸易协定类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TradeAgreementType { + /// WTO 多边贸易体系(最惠国待遇) + WtoMfn, + /// 自由贸易协定(FTA) + Fta, + /// 区域全面经济伙伴关系(RCEP) + Rcep, + /// 全面经济伙伴协定(CEPA) + Cepa, + /// 经济伙伴协定(EPA) + Epa, + /// 关税同盟(如欧盟内部) + CustomsUnion, + /// 共同市场(如欧盟单一市场) + CommonMarket, + /// 优惠贸易安排(PTA) + Pta, + /// 无协定(适用 WTO MFN 或更高关税) + NoAgreement, + /// 特别关税措施(如 301 条款) + SpecialTariffMeasure(String), +} + +/// 技术标准体系 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum TechnicalStandardSystem { + /// 欧盟 CE 认证 + Ce, + /// 中国强制认证(CCC) + Ccc, + /// 美国 UL 认证 + Ul, + /// 美国 FCC 认证(电子) + Fcc, + /// 日本 JIS 标准 + Jis, + /// 日本 PSE 认证(电气) + Pse, + /// 韩国 KC 认证 + Kc, + /// 澳大利亚 SAA/RCM 认证 + Rcm, + /// 英国 UKCA 认证(脱欧后) + Ukca, + /// 国际标准化组织(ISO) + Iso, + /// 食品法典委员会(Codex Alimentarius) + CodexAlimentarius, + /// 无特殊要求 + None, +} + +/// 关税规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TariffRule { + /// 源辖区 + pub source_jurisdiction: String, + /// 目标辖区 + pub target_jurisdiction: String, + /// 适用贸易协定 + pub applicable_agreement: TradeAgreementType, + /// 基础关税率(MFN) + pub base_tariff_rate: f64, + /// 优惠关税率(如适用协定) + pub preferential_rate: Option, + /// 特别关税(反倾销/反补贴/301等) + pub special_tariff: Option, + /// 实际适用税率 + pub effective_rate: f64, + /// HS 编码范围(适用商品) + pub hs_code_scope: Option, + /// 原产地规则要求 + pub rules_of_origin: Option, + /// 备注 + pub notes: Option, +} + +impl TariffRule { + /// 计算实际适用关税率 + pub fn calculate_effective_rate(&self) -> f64 { + let base = self.preferential_rate.unwrap_or(self.base_tariff_rate); + base + self.special_tariff.unwrap_or(0.0) + } +} + +/// 技术标准互认规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TechnicalStandardRule { + /// 源辖区标准 + pub source_standard: TechnicalStandardSystem, + /// 目标辖区要求 + pub target_standard: TechnicalStandardSystem, + /// 是否互认 + pub mutually_recognized: bool, + /// 需要额外认证 + pub additional_certification_required: bool, + /// 额外认证描述 + pub additional_certification_desc: Option, + /// 适用产品类别 + pub applicable_product_categories: Vec, +} + +/// 进出口管制规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TradeControlRule { + /// 管制类型 + pub control_type: TradeControlType, + /// 受管制商品/技术描述 + pub controlled_items: String, + /// 是否需要许可证 + pub license_required: bool, + /// 许可证签发机构 + pub licensing_authority: Option, + /// 是否存在禁令(全面禁止) + pub embargo: bool, + /// 法律依据 + pub legal_basis: String, +} + +/// 贸易管制类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TradeControlType { + /// 美国出口管制(EAR) + UsEar, + /// 美国国际武器交通条例(ITAR) + UsItar, + /// 美国 OFAC 制裁 + UsOfac, + /// 日本外为法 + JpFefta, + /// 欧盟双用途出口管制 + EuDualUse, + /// 中国出口管制法 + CnExportControl, + /// 中国数据安全法(数据跨境) + CnDataSecurity, + /// 瓦森纳协定(多边) + WassenaarArrangement, + /// 核供应国集团(NSG) + NuclearSuppliersGroup, + /// 检疫管制(农产品/食品) + PhytosanitaryControl, +} + +/// 双边跨境规则(完整规则集) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BilateralCrossBorderRules { + /// 源辖区 + pub jurisdiction_a: String, + /// 目标辖区 + pub jurisdiction_b: String, + /// 适用贸易协定 + pub trade_agreement: TradeAgreementType, + /// 关税规则(按资产/商品类型) + pub tariff_rules: Vec, + /// 技术标准规则 + pub technical_standards: Vec, + /// 贸易管制规则 + pub trade_controls: Vec, + /// 货币结算规则 + pub currency_settlement: CurrencySettlementRule, + /// 首选争议解决机制 + pub preferred_dispute_resolution: PreferredDisputeResolution, + /// 数据跨境规则 + pub data_transfer_rules: DataTransferRule, + /// 知识产权互认 + pub ip_mutual_recognition: IpMutualRecognition, +} + +/// 货币结算规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CurrencySettlementRule { + pub primary_currencies: Vec, + pub local_currency_settlement: bool, + pub foreign_exchange_control: bool, + pub capital_outflow_restriction: bool, + pub notes: Option, +} + +/// 首选争议解决机制 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PreferredDisputeResolution { + pub real_estate: String, + pub goods_trade: String, + pub intellectual_property: String, + pub financial: String, +} + +/// 数据跨境传输规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DataTransferRule { + pub cross_border_allowed: bool, + pub data_localization_required: bool, + pub applicable_frameworks: Vec, + pub special_restrictions: Option, +} + +/// 知识产权互认 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IpMutualRecognition { + pub patent_recognition: bool, + pub trademark_recognition: bool, + pub copyright_recognition: bool, + pub applicable_treaties: Vec, +} + +/// 全球主要双边跨境规则数据库 +pub fn get_bilateral_rules_database() -> Vec { + vec![ + // CN-HK(CEPA 框架) + BilateralCrossBorderRules { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "HK".to_string(), + trade_agreement: TradeAgreementType::Cepa, + tariff_rules: vec![TariffRule { + source_jurisdiction: "CN".to_string(), + target_jurisdiction: "HK".to_string(), + applicable_agreement: TradeAgreementType::Cepa, + base_tariff_rate: 0.0, + preferential_rate: Some(0.0), + special_tariff: None, + effective_rate: 0.0, + hs_code_scope: Some("全品类".to_string()), + rules_of_origin: Some("CEPA 原产地规则".to_string()), + notes: Some("CEPA 框架下内地商品进入香港零关税".to_string()), + }], + technical_standards: vec![TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::None, + mutually_recognized: true, + additional_certification_required: false, + additional_certification_desc: None, + applicable_product_categories: vec!["大多数商品".to_string()], + }], + trade_controls: vec![], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["CNY".to_string(), "HKD".to_string()], + local_currency_settlement: true, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: Some("人民币离岸中心,跨境结算便利".to_string()), + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "香港法院/HKIAC".to_string(), + goods_trade: "HKIAC/CIETAC香港仲裁中心".to_string(), + intellectual_property: "香港知识产权法院".to_string(), + financial: "HKIAC".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: true, + data_localization_required: false, + applicable_frameworks: vec!["PDPO(香港)".to_string(), "中国数据安全法(内地)".to_string()], + special_restrictions: Some("个人信息跨境需满足中国PIPL要求".to_string()), + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string()], + }, + }, + // CN-SG(RCEP) + BilateralCrossBorderRules { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "SG".to_string(), + trade_agreement: TradeAgreementType::Rcep, + tariff_rules: vec![TariffRule { + source_jurisdiction: "CN".to_string(), + target_jurisdiction: "SG".to_string(), + applicable_agreement: TradeAgreementType::Rcep, + base_tariff_rate: 0.0, + preferential_rate: Some(0.0), + special_tariff: None, + effective_rate: 0.0, + hs_code_scope: Some("RCEP 覆盖商品".to_string()), + rules_of_origin: Some("RCEP 原产地规则(区域价值含量≥40%)".to_string()), + notes: Some("新加坡对大多数商品零关税".to_string()), + }], + technical_standards: vec![TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::None, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("需符合新加坡 SPRING 标准".to_string()), + applicable_product_categories: vec!["电气产品".to_string(), "消费品".to_string()], + }], + trade_controls: vec![TradeControlRule { + control_type: TradeControlType::CnDataSecurity, + controlled_items: "个人信息、重要数据".to_string(), + license_required: true, + licensing_authority: Some("中国国家互联网信息办公室".to_string()), + embargo: false, + legal_basis: "中国个人信息保护法(PIPL)、数据安全法".to_string(), + }], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["USD".to_string(), "SGD".to_string(), "CNY".to_string()], + local_currency_settlement: true, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: Some("新加坡是全球重要离岸人民币中心".to_string()), + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "新加坡高等法院/SIAC".to_string(), + goods_trade: "SIAC/CIETAC".to_string(), + intellectual_property: "SIAC/WIPO仲裁".to_string(), + financial: "SIAC".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: true, + data_localization_required: false, + applicable_frameworks: vec!["PDPA(新加坡)".to_string(), "PIPL(中国)".to_string()], + special_restrictions: Some("中国数据出境需通过安全评估或标准合同".to_string()), + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string(), "PCT".to_string()], + }, + }, + // CN-JP(RCEP) + BilateralCrossBorderRules { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "JP".to_string(), + trade_agreement: TradeAgreementType::Rcep, + tariff_rules: vec![TariffRule { + source_jurisdiction: "CN".to_string(), + target_jurisdiction: "JP".to_string(), + applicable_agreement: TradeAgreementType::Rcep, + base_tariff_rate: 0.025, + preferential_rate: Some(0.0), + special_tariff: None, + effective_rate: 0.0, + hs_code_scope: Some("RCEP 覆盖商品(分阶段降税)".to_string()), + rules_of_origin: Some("RCEP 原产地规则".to_string()), + notes: Some("RCEP 框架下中日关税逐步降低,2022年起生效".to_string()), + }], + technical_standards: vec![ + TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::Pse, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("电气产品需获得日本PSE认证".to_string()), + applicable_product_categories: vec!["电气产品".to_string()], + }, + TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::Jis, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("工业品需符合JIS标准".to_string()), + applicable_product_categories: vec!["工业品".to_string(), "建材".to_string()], + }, + ], + trade_controls: vec![TradeControlRule { + control_type: TradeControlType::JpFefta, + controlled_items: "半导体、军民两用技术、先进制造设备".to_string(), + license_required: true, + licensing_authority: Some("日本经济产业省(METI)".to_string()), + embargo: false, + legal_basis: "外国為替及び外国貿易法(外为法)".to_string(), + }], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["USD".to_string(), "JPY".to_string(), "CNY".to_string()], + local_currency_settlement: true, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: Some("中日贸易以美元结算为主,人民币结算占比增加".to_string()), + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "日本法院(物权适用所在地法)".to_string(), + goods_trade: "JCAA/CIETAC/ICC".to_string(), + intellectual_property: "JCAA/WIPO仲裁".to_string(), + financial: "JCAA/ICC".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: true, + data_localization_required: false, + applicable_frameworks: vec!["APPI(日本)".to_string(), "PIPL(中国)".to_string()], + special_restrictions: Some("中国个人信息出境需满足PIPL要求;日本对政府相关数据有限制".to_string()), + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string(), "PCT".to_string(), "马德里协定".to_string()], + }, + }, + // CN-US(WTO + 301 条款) + BilateralCrossBorderRules { + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "US".to_string(), + trade_agreement: TradeAgreementType::WtoMfn, + tariff_rules: vec![TariffRule { + source_jurisdiction: "CN".to_string(), + target_jurisdiction: "US".to_string(), + applicable_agreement: TradeAgreementType::SpecialTariffMeasure("301条款".to_string()), + base_tariff_rate: 0.025, + preferential_rate: None, + special_tariff: Some(0.25), + effective_rate: 0.275, + hs_code_scope: Some("约3000亿美元中国商品(分批次)".to_string()), + rules_of_origin: None, + notes: Some("美国依据贸易法301条款对中国商品加征7.5%-25%关税".to_string()), + }], + technical_standards: vec![ + TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::Ul, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("需获得UL认证或等效美国标准认证".to_string()), + applicable_product_categories: vec!["电气产品".to_string(), "消费品".to_string()], + }, + TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ccc, + target_standard: TechnicalStandardSystem::Fcc, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("电子通信设备需获FCC认证".to_string()), + applicable_product_categories: vec!["电子产品".to_string(), "通信设备".to_string()], + }, + ], + trade_controls: vec![ + TradeControlRule { + control_type: TradeControlType::UsEar, + controlled_items: "半导体、先进计算、人工智能、量子计算相关技术和设备".to_string(), + license_required: true, + licensing_authority: Some("美国商务部工业和安全局(BIS)".to_string()), + embargo: false, + legal_basis: "出口管制条例(EAR),实体清单(Entity List)".to_string(), + }, + TradeControlRule { + control_type: TradeControlType::UsOfac, + controlled_items: "制裁名单实体的所有交易".to_string(), + license_required: true, + licensing_authority: Some("美国财政部海外资产控制办公室(OFAC)".to_string()), + embargo: true, + legal_basis: "OFAC 制裁条例".to_string(), + }, + ], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["USD".to_string()], + local_currency_settlement: false, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: Some("中美贸易以美元结算为主;SWIFT 系统可能受制裁影响".to_string()), + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "美国法院(各州)".to_string(), + goods_trade: "AAA/ICC/WTO争端解决".to_string(), + intellectual_property: "AAA/WIPO仲裁/美国法院".to_string(), + financial: "AAA/FINRA(证券)".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: false, + data_localization_required: true, + applicable_frameworks: vec!["CCPA(加州)".to_string(), "PIPL(中国)".to_string(), "CFIUS审查".to_string()], + special_restrictions: Some("TikTok/字节跳动案例显示:中国实体持有美国用户数据面临强制剥离风险".to_string()), + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string(), "PCT".to_string()], + }, + }, + // EU-US(WTO) + BilateralCrossBorderRules { + jurisdiction_a: "EU".to_string(), + jurisdiction_b: "US".to_string(), + trade_agreement: TradeAgreementType::WtoMfn, + tariff_rules: vec![TariffRule { + source_jurisdiction: "EU".to_string(), + target_jurisdiction: "US".to_string(), + applicable_agreement: TradeAgreementType::WtoMfn, + base_tariff_rate: 0.035, + preferential_rate: None, + special_tariff: None, + effective_rate: 0.035, + hs_code_scope: Some("全品类(WTO MFN)".to_string()), + rules_of_origin: None, + notes: Some("TTIP 谈判搁置,目前适用 WTO MFN 税率".to_string()), + }], + technical_standards: vec![TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ce, + target_standard: TechnicalStandardSystem::Ul, + mutually_recognized: false, + additional_certification_required: true, + additional_certification_desc: Some("CE认证不被美国自动接受,需额外认证".to_string()), + applicable_product_categories: vec!["电气产品".to_string(), "医疗设备".to_string()], + }], + trade_controls: vec![TradeControlRule { + control_type: TradeControlType::EuDualUse, + controlled_items: "双用途商品和技术".to_string(), + license_required: true, + licensing_authority: Some("各成员国主管机构".to_string()), + embargo: false, + legal_basis: "EU Dual-Use Regulation (2021/821)".to_string(), + }], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["USD".to_string(), "EUR".to_string()], + local_currency_settlement: true, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: None, + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "所在国法院".to_string(), + goods_trade: "ICC/AAA".to_string(), + intellectual_property: "ICC/WIPO仲裁".to_string(), + financial: "ICC/LCIA".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: true, + data_localization_required: false, + applicable_frameworks: vec!["GDPR(欧盟)".to_string(), "EU-US 数据隐私框架(2023)".to_string()], + special_restrictions: Some("需符合 EU-US 数据隐私框架(DPF),Schrems II 判决后重建".to_string()), + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string()], + }, + }, + // EU-JP(EPA 已生效) + BilateralCrossBorderRules { + jurisdiction_a: "EU".to_string(), + jurisdiction_b: "JP".to_string(), + trade_agreement: TradeAgreementType::Epa, + tariff_rules: vec![TariffRule { + source_jurisdiction: "EU".to_string(), + target_jurisdiction: "JP".to_string(), + applicable_agreement: TradeAgreementType::Epa, + base_tariff_rate: 0.025, + preferential_rate: Some(0.0), + special_tariff: None, + effective_rate: 0.0, + hs_code_scope: Some("EPA 覆盖约99%的欧盟出口商品".to_string()), + rules_of_origin: Some("EPA 原产地规则".to_string()), + notes: Some("EU-JP EPA 2019年2月生效,全球最大FTA之一".to_string()), + }], + technical_standards: vec![TechnicalStandardRule { + source_standard: TechnicalStandardSystem::Ce, + target_standard: TechnicalStandardSystem::Jis, + mutually_recognized: true, + additional_certification_required: false, + additional_certification_desc: Some("EPA 包含监管合作条款,部分领域互认".to_string()), + applicable_product_categories: vec!["汽车".to_string(), "电子产品".to_string()], + }], + trade_controls: vec![], + currency_settlement: CurrencySettlementRule { + primary_currencies: vec!["EUR".to_string(), "JPY".to_string(), "USD".to_string()], + local_currency_settlement: true, + foreign_exchange_control: false, + capital_outflow_restriction: false, + notes: None, + }, + preferred_dispute_resolution: PreferredDisputeResolution { + real_estate: "所在国法院".to_string(), + goods_trade: "ICC/JCAA".to_string(), + intellectual_property: "ICC/WIPO仲裁".to_string(), + financial: "ICC/LCIA".to_string(), + }, + data_transfer_rules: DataTransferRule { + cross_border_allowed: true, + data_localization_required: false, + applicable_frameworks: vec!["GDPR(欧盟)".to_string(), "APPI(日本)".to_string(), "欧日数据充分性决定(2019)".to_string()], + special_restrictions: None, + }, + ip_mutual_recognition: IpMutualRecognition { + patent_recognition: false, + trademark_recognition: false, + copyright_recognition: true, + applicable_treaties: vec!["伯尔尼公约".to_string(), "TRIPS".to_string(), "PCT".to_string()], + }, + }, + ] +} + +/// 查找双边跨境规则 +pub fn find_bilateral_rules( + jurisdiction_a: &str, + jurisdiction_b: &str, +) -> Option { + let db = get_bilateral_rules_database(); + db.into_iter().find(|rules| { + (rules.jurisdiction_a == jurisdiction_a && rules.jurisdiction_b == jurisdiction_b) + || (rules.jurisdiction_a == jurisdiction_b && rules.jurisdiction_b == jurisdiction_a) + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_find_cn_hk_rules() { + let rules = find_bilateral_rules("CN", "HK"); + assert!(rules.is_some()); + let rules = rules.unwrap(); + assert_eq!(rules.trade_agreement, TradeAgreementType::Cepa); + assert_eq!(rules.tariff_rules[0].effective_rate, 0.0); + } + + #[test] + fn test_find_cn_us_rules() { + let rules = find_bilateral_rules("US", "CN"); + assert!(rules.is_some()); + let rules = rules.unwrap(); + assert!(rules.tariff_rules[0].special_tariff.is_some()); + assert!(rules.tariff_rules[0].effective_rate > 0.1); + } + + #[test] + fn test_cn_us_data_restriction() { + let rules = find_bilateral_rules("CN", "US").unwrap(); + assert!(!rules.data_transfer_rules.cross_border_allowed); + assert!(rules.data_transfer_rules.data_localization_required); + } + + #[test] + fn test_eu_jp_epa_zero_tariff() { + let rules = find_bilateral_rules("EU", "JP").unwrap(); + assert_eq!(rules.trade_agreement, TradeAgreementType::Epa); + assert_eq!(rules.tariff_rules[0].preferential_rate, Some(0.0)); + } + + #[test] + fn test_cn_jp_rcep() { + let rules = find_bilateral_rules("CN", "JP").unwrap(); + assert_eq!(rules.trade_agreement, TradeAgreementType::Rcep); + assert!(!rules.trade_controls.is_empty()); + assert!(rules.trade_controls.iter().any(|c| c.control_type == TradeControlType::JpFefta)); + } + + #[test] + fn test_bilateral_rules_database_coverage() { + let db = get_bilateral_rules_database(); + assert!(db.len() >= 6); + let pairs = vec![ + ("CN", "HK"), + ("CN", "SG"), + ("CN", "JP"), + ("CN", "US"), + ("EU", "US"), + ("EU", "JP"), + ]; + for (a, b) in pairs { + assert!( + find_bilateral_rules(a, b).is_some(), + "缺少 {}-{} 双边规则", + a, + b + ); + } + } + + #[test] + fn test_tariff_effective_rate_calculation() { + let rule = TariffRule { + source_jurisdiction: "CN".to_string(), + target_jurisdiction: "US".to_string(), + applicable_agreement: TradeAgreementType::SpecialTariffMeasure("301".to_string()), + base_tariff_rate: 0.025, + preferential_rate: None, + special_tariff: Some(0.25), + effective_rate: 0.275, + hs_code_scope: None, + rules_of_origin: None, + notes: None, + }; + let calculated = rule.calculate_effective_rate(); + assert!((calculated - 0.275).abs() < 0.001); + } +} diff --git a/nac-rwa-legal-model/src/lib.rs b/nac-rwa-legal-model/src/lib.rs new file mode 100644 index 0000000..90dbcd9 --- /dev/null +++ b/nac-rwa-legal-model/src/lib.rs @@ -0,0 +1,285 @@ +// NAC RWA 全球资产上链法律要素抽象数据模型 +// 版本:1.0.0 +// 覆盖:资产类型、产权结构、合约要件、税收要素、跨境规则 +// +// 架构层次: +// Layer 0: 金融合规层(AML/KYC)— nac-jurisdiction-rules 已实现 +// Layer 1: 资产身份层(asset_types + ownership)— 本模块 +// Layer 2: 产权登记层(ownership)— 本模块 +// Layer 3: 合约模板层(contract_elements)— 本模块(抽象层),辖区适配器见各辖区模块 +// Layer 4: 税收计算层(tax_elements)— 本模块 +// Layer 5: 跨境规则层(cross_border)— 本模块 + +pub mod asset_types; +pub mod ownership; +pub mod contract_elements; +pub mod tax_elements; +pub mod cross_border; + +// 重新导出核心类型,方便使用 +pub use asset_types::{AssetCategory, RealEstateSubtype, MovablePropertySubtype, IPSubtype, + FinancialAssetSubtype, CommoditySubtype, DigitalAssetSubtype, + NaturalResourceSubtype}; +pub use ownership::{LegalSystem, LegalEntityType, PropertyRightsBundle, OwnershipForm, + EncumbranceStatus}; +pub use contract_elements::{ContractType, ContractCoreElements, ContractParty, PartyRole, + KycLevel, ContractFormRequirement, DisputeResolution, + ArbitrationBody, DisputeMechanism, DeliveryTerms, + RiskTransferPoint, RequiredDocument, DocumentType}; +pub use tax_elements::{TaxType, TaxRateStructure, JurisdictionTaxRule, DoubleTaxationAgreement, + TaxpayerType, find_dta, get_major_dta_database}; +pub use cross_border::{TradeAgreementType, TechnicalStandardSystem, BilateralCrossBorderRules, + TariffRule, find_bilateral_rules, get_bilateral_rules_database, + TradeControlType}; + +/// RWA 资产上链完整法律要素包 +/// 这是一笔 RWA 资产上链所需的全部法律信息的聚合 +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +pub struct RWALegalPackage { + /// 资产类别 + pub asset_category: AssetCategory, + /// 产权束 + pub property_rights: PropertyRightsBundle, + /// 资产所在辖区 + pub asset_jurisdiction: String, + /// 资产持有人所在辖区 + pub holder_jurisdiction: String, + /// 法律体系 + pub legal_system: LegalSystem, + /// 适用合约类型列表 + pub applicable_contracts: Vec, + /// 必要文件清单 + pub required_documents: Vec, + /// 适用税收规则 + pub applicable_taxes: Vec, + /// 适用双边税收协定 + pub applicable_dta: Option, + /// 跨境规则(如涉及跨境交易) + pub cross_border_rules: Option, + /// 是否需要伊斯兰合规 + pub sharia_compliance_required: bool, + /// 验证状态 + pub validation_status: ValidationStatus, +} + +/// 验证状态 +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub enum ValidationStatus { + /// 未验证 + Pending, + /// 验证通过 + Approved, + /// 验证失败 + Rejected(String), + /// 需要人工审核 + ManualReviewRequired(String), +} + +impl RWALegalPackage { + /// 执行基础验证 + pub fn validate(&self) -> ValidationStatus { + // 检查产权是否可以上链 + if let Err(reason) = self.property_rights.can_be_tokenized() { + return ValidationStatus::Rejected(reason); + } + + // 检查是否有适用合约 + if self.applicable_contracts.is_empty() { + return ValidationStatus::Rejected("未指定适用合约类型".to_string()); + } + + // 检查伊斯兰合规 + if self.sharia_compliance_required { + let has_sharia_contract = self.applicable_contracts.iter().any(|c| { + matches!( + c, + ContractType::MurabahaContract + | ContractType::IjaraContract + | ContractType::SukukContract + | ContractType::MusharakaContract + | ContractType::MudarabaContract + ) + }); + if !has_sharia_contract { + return ValidationStatus::ManualReviewRequired( + "需要伊斯兰合规合约,但未指定".to_string(), + ); + } + } + + ValidationStatus::Approved + } + + /// 获取适用的 DTA(如涉及跨境) + pub fn lookup_dta(&self) -> Option { + if self.asset_jurisdiction != self.holder_jurisdiction { + find_dta(&self.asset_jurisdiction, &self.holder_jurisdiction) + } else { + None + } + } + + /// 获取跨境规则 + pub fn lookup_cross_border_rules(&self) -> Option { + if self.asset_jurisdiction != self.holder_jurisdiction { + find_bilateral_rules(&self.asset_jurisdiction, &self.holder_jurisdiction) + } else { + None + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + #[allow(unused_imports)] + use crate::ownership::{OwnershipRight, UsageRight, IncomeRight, DisposalRight}; + + fn make_clean_rights() -> PropertyRightsBundle { + PropertyRightsBundle::clean_freehold(LegalEntityType::NaturalPerson) + } + + #[test] + fn test_rwa_package_cn_real_estate() { + let package = RWALegalPackage { + asset_category: AssetCategory::RealEstate(RealEstateSubtype::Residential), + property_rights: make_clean_rights(), + asset_jurisdiction: "CN".to_string(), + holder_jurisdiction: "CN".to_string(), + legal_system: LegalSystem::CivilLaw, + applicable_contracts: vec![ContractType::RealEstateSaleContract], + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: false, + validation_status: ValidationStatus::Pending, + }; + + let status = package.validate(); + assert_eq!(status, ValidationStatus::Approved); + } + + #[test] + fn test_rwa_package_ae_sharia_required() { + let package = RWALegalPackage { + asset_category: AssetCategory::FinancialAsset(FinancialAssetSubtype::Bond), + property_rights: make_clean_rights(), + asset_jurisdiction: "AE".to_string(), + holder_jurisdiction: "AE".to_string(), + legal_system: LegalSystem::ShariaLaw, + applicable_contracts: vec![ContractType::BondSubscriptionAgreement], // 普通债券,非 Sukuk + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: true, // 需要伊斯兰合规 + validation_status: ValidationStatus::Pending, + }; + + let status = package.validate(); + // 应该要求人工审核,因为没有伊斯兰合规合约 + assert!(matches!(status, ValidationStatus::ManualReviewRequired(_))); + } + + #[test] + fn test_rwa_package_ae_sukuk() { + let package = RWALegalPackage { + asset_category: AssetCategory::FinancialAsset(FinancialAssetSubtype::Sukuk), + property_rights: make_clean_rights(), + asset_jurisdiction: "AE".to_string(), + holder_jurisdiction: "AE".to_string(), + legal_system: LegalSystem::ShariaLaw, + applicable_contracts: vec![ContractType::SukukContract], // 正确的伊斯兰合约 + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: true, + validation_status: ValidationStatus::Pending, + }; + + let status = package.validate(); + assert_eq!(status, ValidationStatus::Approved); + } + + #[test] + fn test_rwa_package_cross_border_lookup() { + let package = RWALegalPackage { + asset_category: AssetCategory::RealEstate(RealEstateSubtype::Commercial), + property_rights: make_clean_rights(), + asset_jurisdiction: "JP".to_string(), + holder_jurisdiction: "CN".to_string(), // 中国人买日本不动产 + legal_system: LegalSystem::CivilLaw, + applicable_contracts: vec![ContractType::RealEstateSaleContract], + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: false, + validation_status: ValidationStatus::Pending, + }; + + // 查找 DTA + let dta = package.lookup_dta(); + assert!(dta.is_some()); + assert_eq!(dta.unwrap().dividend_withholding_rate, 10.0); + + // 查找跨境规则 + let rules = package.lookup_cross_border_rules(); + assert!(rules.is_some()); + assert_eq!(rules.unwrap().trade_agreement, TradeAgreementType::Rcep); + } + + #[test] + fn test_seized_asset_rejected() { + let mut rights = make_clean_rights(); + rights.encumbrance.has_seizure = true; + + let package = RWALegalPackage { + asset_category: AssetCategory::RealEstate(RealEstateSubtype::Residential), + property_rights: rights, + asset_jurisdiction: "CN".to_string(), + holder_jurisdiction: "CN".to_string(), + legal_system: LegalSystem::CivilLaw, + applicable_contracts: vec![ContractType::RealEstateSaleContract], + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: false, + validation_status: ValidationStatus::Pending, + }; + + let status = package.validate(); + assert!(matches!(status, ValidationStatus::Rejected(_))); + } + + #[test] + fn test_ip_cross_border_cn_us() { + let package = RWALegalPackage { + asset_category: AssetCategory::IntellectualProperty(IPSubtype::InventionPatent), + property_rights: make_clean_rights(), + asset_jurisdiction: "CN".to_string(), + holder_jurisdiction: "US".to_string(), + legal_system: LegalSystem::CommonLaw, + applicable_contracts: vec![ContractType::PatentLicenseNonExclusive], + required_documents: vec![], + applicable_taxes: vec![], + applicable_dta: None, + cross_border_rules: None, + sharia_compliance_required: false, + validation_status: ValidationStatus::Pending, + }; + + // 验证通过 + assert_eq!(package.validate(), ValidationStatus::Approved); + + // 查找跨境规则(中美) + let rules = package.lookup_cross_border_rules(); + assert!(rules.is_some()); + // 中美之间有出口管制 + let rules = rules.unwrap(); + assert!(!rules.trade_controls.is_empty()); + } +} diff --git a/nac-rwa-legal-model/src/ownership.rs b/nac-rwa-legal-model/src/ownership.rs new file mode 100644 index 0000000..abe4f68 --- /dev/null +++ b/nac-rwa-legal-model/src/ownership.rs @@ -0,0 +1,367 @@ +// NAC RWA 产权结构模型 +// 覆盖全球主要法律体系的产权表达方式 + +use serde::{Deserialize, Serialize}; + +/// 全球法律体系分类 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum LegalSystem { + /// 大陆法系(Civil Law)— 德国、法国、日本、中国、韩国、巴西等 + CivilLaw, + /// 普通法系(Common Law)— 英国、美国、澳大利亚、香港、新加坡等 + CommonLaw, + /// 伊斯兰法系(Sharia Law)— 沙特、阿联酋部分、马来西亚部分 + ShariaLaw, + /// 混合法系(Mixed)— 南非、以色列、菲律宾等 + Mixed(Box, Box), + /// 北欧法系(Nordic)— 北欧五国 + Nordic, +} + +/// 法律主体类型 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum LegalEntityType { + /// 自然人(Natural Person) + NaturalPerson, + /// 法人(Legal Person / Corporation) + Corporation, + /// 合伙企业(Partnership) + Partnership, + /// 信托(Trust)— 普通法系常见 + Trust, + /// 基金(Fund) + Fund, + /// 政府机构(Government Entity) + GovernmentEntity, + /// 国际组织(International Organization) + InternationalOrganization, + /// 特殊目的载体(SPV — Special Purpose Vehicle) + SPV, + /// 伊斯兰基金(Waqf — Islamic Endowment) + Waqf, +} + +/// 产权束(Bundle of Rights)— 现代产权理论 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PropertyRightsBundle { + /// 所有权(Ownership / Title) + pub ownership: OwnershipRight, + /// 使用权(Right to Use / Usufruct) + pub usage_right: UsageRight, + /// 收益权(Right to Income / Fruits) + pub income_right: IncomeRight, + /// 处置权(Right to Dispose / Alienation) + pub disposal_right: DisposalRight, + /// 排他权(Right to Exclude) + pub exclusion_right: bool, + /// 抵押/质押状态(Encumbrance Status) + pub encumbrance: EncumbranceStatus, +} + +/// 所有权详情 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct OwnershipRight { + /// 所有权人 + pub owner: LegalEntityType, + /// 所有权形式 + pub ownership_form: OwnershipForm, + /// 是否经过政府登记 + pub registered: bool, + /// 登记机构 + pub registry: Option, + /// 登记证书编号 + pub certificate_id: Option, +} + +/// 所有权形式 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum OwnershipForm { + /// 完全所有权(Fee Simple / Freehold) + FeeSImple, + /// 共有(Co-ownership / Joint Tenancy) + CoOwnership, + /// 按份共有(Tenancy in Common) + TenancyInCommon, + /// 夫妻共有(Community Property) + CommunityProperty, + /// 信托持有(Held in Trust) + HeldInTrust, + /// 租赁权(Leasehold) + Leasehold, + /// 地上权(Surface Rights / Superficies) + SurfaceRights, + /// 永佃权(Emphyteusis) + Emphyteusis, + /// 国有(State Ownership) + StateOwnership, + /// 集体所有(Collective Ownership)— 中国特色 + CollectiveOwnership, +} + +/// 使用权详情 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UsageRight { + /// 使用权人(可与所有权人不同) + pub holder: Option, + /// 使用期限(年,None 表示永久) + pub duration_years: Option, + /// 使用限制 + pub restrictions: Vec, + /// 是否可转让 + pub transferable: bool, +} + +/// 使用限制类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum UsageRestriction { + /// 仅住宅用途 + ResidentialOnly, + /// 仅商业用途 + CommercialOnly, + /// 仅工业用途 + IndustrialOnly, + /// 仅农业用途 + AgriculturalOnly, + /// 禁止转租 + NoSublet, + /// 禁止改建 + NoAlteration, + /// 文物保护限制 + HeritageProtection, + /// 环境保护限制 + EnvironmentalProtection, + /// 外国人持有限制 + ForeignOwnershipRestriction, +} + +/// 收益权详情 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IncomeRight { + /// 收益权人 + pub holder: Option, + /// 收益分配比例(百分比,0-100) + pub distribution_ratio: f64, + /// 收益类型 + pub income_types: Vec, +} + +/// 收益类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum IncomeType { + /// 租金收益 + RentalIncome, + /// 资本增值 + CapitalGain, + /// 股息/分红 + Dividend, + /// 利息(注:伊斯兰法禁止) + Interest, + /// 特许权使用费(版税) + Royalty, + /// 经营收益 + OperatingIncome, + /// 资源开采收益 + ResourceExtractionIncome, +} + +/// 处置权详情 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DisposalRight { + /// 是否可自由出售 + pub freely_transferable: bool, + /// 转让限制 + pub transfer_restrictions: Vec, + /// 优先购买权持有人 + pub right_of_first_refusal: Option, + /// 政府审批要求 + pub government_approval_required: bool, +} + +/// 转让限制类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TransferRestriction { + /// 锁定期(Lock-up Period) + LockUpPeriod(u32), // 月数 + /// 禁止向外国人转让 + NoTransferToForeigners, + /// 禁止向竞争对手转让 + NoTransferToCompetitors, + /// 需要共有人同意 + CoOwnerConsent, + /// 需要政府批准 + GovernmentApproval, + /// 需要监管机构批准 + RegulatoryApproval, + /// 继承限制 + InheritanceRestriction, +} + +/// 抵押/质押状态 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct EncumbranceStatus { + /// 是否存在抵押 + pub has_mortgage: bool, + /// 是否存在质押 + pub has_pledge: bool, + /// 是否存在查封/冻结 + pub has_seizure: bool, + /// 是否存在地役权 + pub has_easement: bool, + /// 是否存在优先权 + pub has_lien: bool, + /// 抵押金额(USD) + pub mortgage_amount_usd: Option, + /// 抵押权人 + pub mortgagee: Option, +} + +impl PropertyRightsBundle { + /// 创建完全清洁产权(无任何限制和负担) + pub fn clean_freehold(owner_type: LegalEntityType) -> Self { + Self { + ownership: OwnershipRight { + owner: owner_type, + ownership_form: OwnershipForm::FeeSImple, + registered: true, + registry: None, + certificate_id: None, + }, + usage_right: UsageRight { + holder: None, + duration_years: None, + restrictions: vec![], + transferable: true, + }, + income_right: IncomeRight { + holder: None, + distribution_ratio: 100.0, + income_types: vec![IncomeType::RentalIncome, IncomeType::CapitalGain], + }, + disposal_right: DisposalRight { + freely_transferable: true, + transfer_restrictions: vec![], + right_of_first_refusal: None, + government_approval_required: false, + }, + exclusion_right: true, + encumbrance: EncumbranceStatus { + has_mortgage: false, + has_pledge: false, + has_seizure: false, + has_easement: false, + has_lien: false, + mortgage_amount_usd: None, + mortgagee: None, + }, + } + } + + /// 检查产权是否清洁(无负担) + pub fn is_clean(&self) -> bool { + !self.encumbrance.has_mortgage + && !self.encumbrance.has_pledge + && !self.encumbrance.has_seizure + && !self.encumbrance.has_lien + && self.disposal_right.freely_transferable + } + + /// 检查是否可以上链(最低要求) + pub fn can_be_tokenized(&self) -> Result<(), String> { + if self.encumbrance.has_seizure { + return Err("资产处于查封/冻结状态,无法上链".to_string()); + } + if !self.ownership.registered { + return Err("资产产权未经政府登记,无法上链".to_string()); + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_clean_freehold() { + let rights = PropertyRightsBundle::clean_freehold(LegalEntityType::NaturalPerson); + assert!(rights.is_clean()); + assert!(rights.can_be_tokenized().is_ok()); + } + + #[test] + fn test_seized_asset_cannot_tokenize() { + let mut rights = PropertyRightsBundle::clean_freehold(LegalEntityType::Corporation); + rights.encumbrance.has_seizure = true; + assert!(rights.can_be_tokenized().is_err()); + } + + #[test] + fn test_unregistered_cannot_tokenize() { + let mut rights = PropertyRightsBundle::clean_freehold(LegalEntityType::NaturalPerson); + rights.ownership.registered = false; + assert!(rights.can_be_tokenized().is_err()); + } + + #[test] + fn test_mortgaged_not_clean_but_can_tokenize() { + let mut rights = PropertyRightsBundle::clean_freehold(LegalEntityType::Corporation); + rights.encumbrance.has_mortgage = true; + rights.encumbrance.mortgage_amount_usd = Some(500_000.0); + // 有抵押但未查封,可以上链(需披露抵押信息) + assert!(!rights.is_clean()); + assert!(rights.can_be_tokenized().is_ok()); + } + + #[test] + fn test_legal_systems() { + let civil = LegalSystem::CivilLaw; + let common = LegalSystem::CommonLaw; + let sharia = LegalSystem::ShariaLaw; + assert_ne!(civil, common); + assert_ne!(common, sharia); + } + + #[test] + fn test_collective_ownership_china() { + // 中国农村土地集体所有制 + let rights = PropertyRightsBundle { + ownership: OwnershipRight { + owner: LegalEntityType::GovernmentEntity, + ownership_form: OwnershipForm::CollectiveOwnership, + registered: true, + registry: Some("中国不动产登记中心".to_string()), + certificate_id: Some("CNRE2024001".to_string()), + }, + usage_right: UsageRight { + holder: Some(LegalEntityType::NaturalPerson), + duration_years: Some(30), + restrictions: vec![UsageRestriction::AgriculturalOnly], + transferable: false, + }, + income_right: IncomeRight { + holder: Some(LegalEntityType::NaturalPerson), + distribution_ratio: 100.0, + income_types: vec![IncomeType::OperatingIncome], + }, + disposal_right: DisposalRight { + freely_transferable: false, + transfer_restrictions: vec![TransferRestriction::GovernmentApproval], + right_of_first_refusal: None, + government_approval_required: true, + }, + exclusion_right: true, + encumbrance: EncumbranceStatus { + has_mortgage: false, + has_pledge: false, + has_seizure: false, + has_easement: false, + has_lien: false, + mortgage_amount_usd: None, + mortgagee: None, + }, + }; + // 集体所有土地使用权可以上链(已登记),但转让受限 + assert!(rights.can_be_tokenized().is_ok()); + assert!(!rights.disposal_right.freely_transferable); + } +} diff --git a/nac-rwa-legal-model/src/tax_elements.rs b/nac-rwa-legal-model/src/tax_elements.rs new file mode 100644 index 0000000..428a279 --- /dev/null +++ b/nac-rwa-legal-model/src/tax_elements.rs @@ -0,0 +1,429 @@ +// NAC RWA 税收要素模型 +// 覆盖全球主要辖区的资产交易税收规则 + +use serde::{Deserialize, Serialize}; + +/// 税收类型枚举 +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum TaxType { + // ===== 交易税 ===== + /// 契税/产权转让税(不动产) + PropertyTransferTax, + /// 增值税(VAT/GST) + ValueAddedTax, + /// 印花税 + StampDuty, + /// 资本利得税 + CapitalGainsTax, + /// 遗产税/赠与税 + InheritanceOrGiftTax, + + // ===== 持有税 ===== + /// 房产税/不动产税 + PropertyTax, + /// 土地使用税 + LandUseTax, + /// 财富税 + WealthTax, + + // ===== 收益税 ===== + /// 企业所得税 + CorporateIncomeTax, + /// 个人所得税 + PersonalIncomeTax, + /// 预提税(跨境支付) + WithholdingTax, + /// 特许权使用费税(版税) + RoyaltyTax, + + // ===== 跨境税 ===== + /// 进口关税 + ImportDuty, + /// 出口关税 + ExportDuty, + /// 反倾销税 + AntiDumpingDuty, + /// 反补贴税 + CountervailingDuty, + + // ===== 特殊税 ===== + /// 外国人购置附加税(如新加坡 ABSD) + ForeignBuyerSurcharge, + /// 数字服务税 + DigitalServicesTax, + /// 碳税 + CarbonTax, + /// 金融交易税 + FinancialTransactionTax, +} + +/// 税率结构 +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub enum TaxRateStructure { + /// 固定税率 + Flat(f64), + /// 阶梯税率 + Progressive(Vec), + /// 区间税率(最低-最高) + Range { min: f64, max: f64 }, + /// 免税 + Exempt, + /// 零税率(仍需申报) + ZeroRated, + /// 待定(需根据具体情况确定) + ToBeDetermined, +} + +/// 税率阶梯 +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TaxBracket { + /// 起征点(USD) + pub threshold_usd: f64, + /// 适用税率 + pub rate: f64, + /// 说明 + pub description: String, +} + +/// 税收豁免条件 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaxExemptionCondition { + /// 首套自住房 + FirstHomeOwnerOccupied, + /// 持有满指定年限 + HoldingPeriodMet(u32), // 年数 + /// 小额交易豁免 + SmallTransactionThreshold, + /// 特定资产类型豁免 + SpecificAssetType, + /// 外交豁免 + DiplomaticImmunity, + /// 慈善机构豁免 + CharitableOrganization, + /// 政府机构豁免 + GovernmentEntity, + /// 双边税收协定豁免 + DTAExemption(String), // 协定名称 + /// 伊斯兰金融豁免(部分国家) + IslamicFinanceExemption, +} + +/// 单辖区税收规则 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct JurisdictionTaxRule { + /// 辖区代码 + pub jurisdiction: String, + /// 税收类型 + pub tax_type: TaxType, + /// 税率结构 + pub rate_structure: TaxRateStructure, + /// 纳税义务人(买方/卖方/双方) + pub taxpayer: TaxpayerType, + /// 豁免条件 + pub exemptions: Vec, + /// 外国人是否适用不同税率 + pub foreign_rate_different: bool, + /// 外国人税率(如适用) + pub foreign_rate: Option, + /// 申报截止期(天,从交易日起) + pub filing_deadline_days: Option, + /// 法律依据 + pub legal_basis: String, + /// 备注 + pub notes: Option, +} + +/// 纳税义务人 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaxpayerType { + Buyer, + Seller, + Both, + Shared { buyer_ratio: u32, seller_ratio: u32 }, // 百分比 + Withholding, // 由支付方代扣代缴 +} + +/// 双边税收协定(DTA) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DoubleTaxationAgreement { + /// 协定名称 + pub name: String, + /// 缔约方辖区1 + pub jurisdiction_a: String, + /// 缔约方辖区2 + pub jurisdiction_b: String, + /// 生效日期(Unix 时间戳) + pub effective_date: u64, + /// 股息预提税率(%) + pub dividend_withholding_rate: f64, + /// 利息预提税率(%) + pub interest_withholding_rate: f64, + /// 特许权使用费预提税率(%) + pub royalty_withholding_rate: f64, + /// 资本利得是否豁免 + pub capital_gains_exempt: bool, + /// 不动产收益适用规则 + pub real_estate_income_rule: RealEstateIncomeRule, + /// 信息交换条款 + pub information_exchange: bool, + /// 备注 + pub notes: Option, +} + +/// 不动产收益适用规则(DTA 中的标准条款) +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum RealEstateIncomeRule { + /// 适用所在国税法(OECD 标准) + SourceCountryTaxes, + /// 居住国税法 + ResidenceCountryTaxes, + /// 双方均可征税 + BothMayTax, +} + +/// 税收计算结果 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TaxCalculationResult { + /// 辖区 + pub jurisdiction: String, + /// 税收类型 + pub tax_type: TaxType, + /// 计税基础(USD) + pub tax_base_usd: f64, + /// 适用税率 + pub applicable_rate: f64, + /// 应纳税额(USD) + pub tax_amount_usd: f64, + /// 是否享有豁免 + pub exemption_applied: bool, + /// 豁免依据 + pub exemption_basis: Option, + /// 是否适用 DTA + pub dta_applied: bool, + /// DTA 名称 + pub dta_name: Option, +} + +/// 全球主要 DTA 数据库(核心双边协定) +pub fn get_major_dta_database() -> Vec { + vec![ + DoubleTaxationAgreement { + name: "中日税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "JP".to_string(), + effective_date: 631152000, // 1990-01-01 + dividend_withholding_rate: 10.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中日双边税收协定,1990年生效".to_string()), + }, + DoubleTaxationAgreement { + name: "中新税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "SG".to_string(), + effective_date: 694224000, // 1992-01-01 + dividend_withholding_rate: 5.0, + interest_withholding_rate: 7.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中新双边税收协定,多次修订".to_string()), + }, + DoubleTaxationAgreement { + name: "中英税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "GB".to_string(), + effective_date: 536457600, // 1987-01-01 + dividend_withholding_rate: 10.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中英双边税收协定".to_string()), + }, + DoubleTaxationAgreement { + name: "中德税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "EU-DE".to_string(), + effective_date: 536457600, + dividend_withholding_rate: 10.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中德双边税收协定".to_string()), + }, + DoubleTaxationAgreement { + name: "中澳税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "AU".to_string(), + effective_date: 536457600, + dividend_withholding_rate: 15.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中澳双边税收协定".to_string()), + }, + DoubleTaxationAgreement { + name: "中韩税收协定".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "KR".to_string(), + effective_date: 757382400, // 1994-01-01 + dividend_withholding_rate: 10.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 10.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("中韩双边税收协定".to_string()), + }, + DoubleTaxationAgreement { + name: "EU-JP 经济伙伴协定(税收部分)".to_string(), + jurisdiction_a: "EU".to_string(), + jurisdiction_b: "JP".to_string(), + effective_date: 1548979200, // 2019-02-01 + dividend_withholding_rate: 5.0, + interest_withholding_rate: 10.0, + royalty_withholding_rate: 5.0, + capital_gains_exempt: false, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("EU-JP EPA 税收条款".to_string()), + }, + DoubleTaxationAgreement { + name: "中港 CEPA 税收安排".to_string(), + jurisdiction_a: "CN".to_string(), + jurisdiction_b: "HK".to_string(), + effective_date: 1072915200, // 2004-01-01 + dividend_withholding_rate: 5.0, + interest_withholding_rate: 7.0, + royalty_withholding_rate: 7.0, + capital_gains_exempt: true, + real_estate_income_rule: RealEstateIncomeRule::SourceCountryTaxes, + information_exchange: true, + notes: Some("CEPA 框架下的税收安排,优惠税率".to_string()), + }, + ] +} + +/// 查找适用的双边税收协定 +pub fn find_dta(jurisdiction_a: &str, jurisdiction_b: &str) -> Option { + let db = get_major_dta_database(); + db.into_iter().find(|dta| { + (dta.jurisdiction_a == jurisdiction_a && dta.jurisdiction_b == jurisdiction_b) + || (dta.jurisdiction_a == jurisdiction_b && dta.jurisdiction_b == jurisdiction_a) + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_find_cn_jp_dta() { + let dta = find_dta("CN", "JP"); + assert!(dta.is_some()); + let dta = dta.unwrap(); + assert_eq!(dta.dividend_withholding_rate, 10.0); + assert_eq!(dta.royalty_withholding_rate, 10.0); + } + + #[test] + fn test_find_cn_hk_dta() { + let dta = find_dta("HK", "CN"); + assert!(dta.is_some()); + let dta = dta.unwrap(); + // CEPA 优惠税率 + assert_eq!(dta.dividend_withholding_rate, 5.0); + assert!(dta.capital_gains_exempt); + } + + #[test] + fn test_no_cn_us_dta() { + // 中美之间没有全面税收协定(仅有有限协定) + let dta = find_dta("CN", "US"); + assert!(dta.is_none()); + } + + #[test] + fn test_tax_rate_progressive() { + let progressive = TaxRateStructure::Progressive(vec![ + TaxBracket { + threshold_usd: 0.0, + rate: 0.01, + description: "首套住宅,面积90平米以下".to_string(), + }, + TaxBracket { + threshold_usd: 0.0, + rate: 0.015, + description: "首套住宅,面积90-144平米".to_string(), + }, + TaxBracket { + threshold_usd: 0.0, + rate: 0.03, + description: "非首套或面积超144平米".to_string(), + }, + ]); + if let TaxRateStructure::Progressive(brackets) = progressive { + assert_eq!(brackets.len(), 3); + assert_eq!(brackets[0].rate, 0.01); + } + } + + #[test] + fn test_singapore_absd_foreign_buyer() { + let rule = JurisdictionTaxRule { + jurisdiction: "SG".to_string(), + tax_type: TaxType::ForeignBuyerSurcharge, + rate_structure: TaxRateStructure::Flat(0.60), // 60% ABSD for foreigners + taxpayer: TaxpayerType::Buyer, + exemptions: vec![TaxExemptionCondition::DTAExemption( + "SG-US FTA".to_string(), + )], + foreign_rate_different: true, + foreign_rate: Some(TaxRateStructure::Flat(0.60)), + filing_deadline_days: Some(14), + legal_basis: "Stamp Duties Act, Additional Buyer's Stamp Duty".to_string(), + notes: Some("外国人购买新加坡住宅附加印花税60%(2023年起)".to_string()), + }; + assert_eq!(rule.jurisdiction, "SG"); + if let TaxRateStructure::Flat(rate) = rule.rate_structure { + assert_eq!(rate, 0.60); + } + } + + #[test] + fn test_uae_no_property_tax() { + let rule = JurisdictionTaxRule { + jurisdiction: "AE".to_string(), + tax_type: TaxType::PropertyTax, + rate_structure: TaxRateStructure::Exempt, + taxpayer: TaxpayerType::Both, + exemptions: vec![], + foreign_rate_different: false, + foreign_rate: None, + filing_deadline_days: None, + legal_basis: "UAE 无个人所得税和房产持有税".to_string(), + notes: Some("阿联酋不征收房产持有税,仅收4% DLD转让费".to_string()), + }; + assert_eq!(rule.rate_structure, TaxRateStructure::Exempt); + } + + #[test] + fn test_dta_database_coverage() { + let db = get_major_dta_database(); + assert!(db.len() >= 8); + // 验证关键协定存在 + assert!(db.iter().any(|d| d.jurisdiction_a == "CN" && d.jurisdiction_b == "JP")); + assert!(db.iter().any(|d| d.jurisdiction_a == "CN" && d.jurisdiction_b == "HK")); + assert!(db.iter().any(|d| d.jurisdiction_a == "CN" && d.jurisdiction_b == "SG")); + } +} diff --git a/nac-rwa-sharia-compliance/Cargo.lock b/nac-rwa-sharia-compliance/Cargo.lock new file mode 100644 index 0000000..b2d5baa --- /dev/null +++ b/nac-rwa-sharia-compliance/Cargo.lock @@ -0,0 +1,96 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "nac-rwa-sharia-compliance" +version = "1.0.0" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/nac-rwa-sharia-compliance/Cargo.toml b/nac-rwa-sharia-compliance/Cargo.toml new file mode 100644 index 0000000..d901ecb --- /dev/null +++ b/nac-rwa-sharia-compliance/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "nac-rwa-sharia-compliance" +version = "1.0.0" +edition = "2021" +description = "NAC RWA 伊斯兰合规合约层 — AE/SA/MY 辖区 Sharia 合规" +authors = ["NAC Development Team"] + +[lib] +name = "nac_rwa_sharia_compliance" +path = "src/lib.rs" + +[lints.rust] +warnings = "deny" + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" diff --git a/nac-rwa-sharia-compliance/src/lib.rs b/nac-rwa-sharia-compliance/src/lib.rs new file mode 100644 index 0000000..729d915 --- /dev/null +++ b/nac-rwa-sharia-compliance/src/lib.rs @@ -0,0 +1,771 @@ +// NAC RWA 伊斯兰合规合约层(Sharia Compliance Layer) +// 版本:1.0.0 +// +// 覆盖辖区: +// AE(阿联酋)、SA(沙特阿拉伯)、MY(马来西亚) +// +// 核心原则: +// 1. 禁止利息(Riba)—— 任何形式的固定利息均被禁止 +// 2. 禁止不确定性(Gharar)—— 合同条款须明确,不能有过度不确定性 +// 3. 禁止赌博(Maysir)—— 禁止投机性交易 +// 4. 禁止非法商品(Haram)—— 禁止猪肉、酒精、武器等非法商品 +// 5. 风险共担(Musharakah)—— 利润和损失须共同承担 +// 6. 资产支持(Asset-Backed)—— 金融交易须有真实资产支撑 + +use serde::{Deserialize, Serialize}; + +/// 伊斯兰金融结构类型 +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum IslamicFinanceStructure { + /// Murabaha(成本加成融资)—— 银行购买资产后以成本加利润出售给客户 + Murabaha, + /// Ijara(伊斯兰租赁)—— 类似融资租赁,但无利息 + Ijara, + /// Ijara wa Iqtina(租赁并购买)—— 租赁期满后转让所有权 + IjaraWaIqtina, + /// Musharakah(合伙)—— 双方共同出资,按比例分享利润和损失 + Musharakah, + /// Mudarabah(信托融资)—— 一方出资,另一方经营,按约定比例分配利润 + Mudarabah, + /// Sukuk(伊斯兰债券)—— 基于资产的证券,代表对资产的所有权份额 + Sukuk, + /// Istisna(制造合同)—— 预先约定制造某物品的合同 + Istisna, + /// Salam(预付货款)—— 预先付款,未来交付商品 + Salam, + /// Wakalah(代理)—— 委托代理关系 + Wakalah, + /// Takaful(伊斯兰保险)—— 互助保险,基于共同担保原则 + Takaful, +} + +/// Sharia 审查委员会要求 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ShariaBoardRequirement { + /// 是否需要 Sharia 审查委员会批准 + pub required: bool, + /// 最低委员人数 + pub minimum_scholars: u8, + /// 是否需要 Fatwa(宗教裁定) + pub fatwa_required: bool, + /// 推荐的 Sharia 审查机构 + pub recommended_boards: Vec, + /// 持续合规监督要求 + pub ongoing_monitoring: bool, +} + +/// 禁止条款(Haram 清单) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct HaramProhibitions { + /// 禁止商品类别 + pub prohibited_goods: Vec, + /// 禁止行业 + pub prohibited_industries: Vec, + /// 禁止金融结构 + pub prohibited_structures: Vec, + /// 禁止合同条款 + pub prohibited_clauses: Vec, +} + +/// Sharia 合规资产要求 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ShariaAssetRequirements { + /// 资产须为真实有形资产 + pub must_be_tangible: bool, + /// 资产须合法(Halal) + pub must_be_halal: bool, + /// 资产须可识别和确定 + pub must_be_identifiable: bool, + /// 资产须已存在(Salam 除外) + pub must_exist_at_contract: bool, + /// 资产须可交付 + pub must_be_deliverable: bool, + /// 特殊说明 + pub special_notes: Vec, +} + +/// 利润分配规则(替代利息) +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ProfitSharingRule { + /// 金融结构类型 + pub structure: IslamicFinanceStructure, + /// 利润分配比例描述 + pub profit_sharing_ratio: String, + /// 损失承担规则 + pub loss_bearing_rule: String, + /// 基准利率替代(如 LIBOR 替代) + pub benchmark_alternative: Option, + /// 说明 + pub notes: String, +} + +/// Sukuk(伊斯兰债券)结构 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SukukStructure { + /// Sukuk 类型 + pub sukuk_type: IslamicFinanceStructure, + /// 基础资产描述 + pub underlying_asset: String, + /// SPV(特殊目的载体)要求 + pub spv_required: bool, + /// 资产转让要求 + pub asset_transfer_required: bool, + /// 收益率计算方式(替代利息) + pub return_calculation: String, + /// 赎回机制 + pub redemption_mechanism: String, + /// Sharia 审查要求 + pub sharia_board: ShariaBoardRequirement, +} + +/// 辖区 Sharia 合规框架 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ShariaComplianceFramework { + /// 辖区代码 + pub jurisdiction: String, + /// 辖区名称 + pub jurisdiction_name: String, + /// 伊斯兰金融监管机构 + pub regulatory_body: String, + /// 适用的伊斯兰金融法律 + pub applicable_laws: Vec, + /// Sharia 审查委员会要求 + pub sharia_board: ShariaBoardRequirement, + /// 禁止条款 + pub prohibitions: HaramProhibitions, + /// 资产要求 + pub asset_requirements: ShariaAssetRequirements, + /// 支持的金融结构 + pub supported_structures: Vec, + /// 利润分配规则 + pub profit_sharing_rules: Vec, + /// Sukuk 发行要求(如支持) + pub sukuk_requirements: Option, + /// 不动产 Sharia 合规要求 + pub real_estate_sharia_requirements: Vec, + /// 商品交易 Sharia 合规要求 + pub goods_trade_sharia_requirements: Vec, + /// 知识产权 Sharia 合规要求 + pub ip_sharia_requirements: Vec, + /// 与传统金融的互操作性说明 + pub conventional_interoperability: String, +} + +/// 获取辖区 Sharia 合规框架 +pub fn get_sharia_framework(jurisdiction: &str) -> Option { + match jurisdiction.to_uppercase().as_str() { + "AE" => Some(ae_sharia_framework()), + "SA" => Some(sa_sharia_framework()), + "MY" => Some(my_sharia_framework()), + _ => None, + } +} + +/// 验证合同是否符合 Sharia 原则 +pub fn validate_sharia_compliance( + jurisdiction: &str, + structure: &IslamicFinanceStructure, + has_interest: bool, + has_excessive_uncertainty: bool, + involves_haram_goods: bool, +) -> ShariaValidationResult { + let framework = match get_sharia_framework(jurisdiction) { + Some(f) => f, + None => return ShariaValidationResult { + is_compliant: false, + violations: vec![format!("辖区 {} 不在 Sharia 合规覆盖范围内", jurisdiction)], + recommendations: vec![], + requires_fatwa: false, + }, + }; + + let mut violations = Vec::new(); + let mut recommendations = Vec::new(); + + if has_interest { + violations.push("违反禁止利息原则(Riba):合同包含固定利息条款".to_string()); + recommendations.push(format!("建议将利息结构替换为 {:?} 结构", IslamicFinanceStructure::Murabaha)); + } + + if has_excessive_uncertainty { + violations.push("违反禁止不确定性原则(Gharar):合同条款存在过度不确定性".to_string()); + recommendations.push("建议明确所有合同条款,消除不确定性".to_string()); + } + + if involves_haram_goods { + violations.push("违反禁止非法商品原则(Haram):交易涉及禁止商品".to_string()); + recommendations.push("须确认交易商品符合 Halal 标准".to_string()); + } + + if !framework.supported_structures.contains(structure) { + violations.push(format!("金融结构 {:?} 在 {} 辖区不被支持", structure, jurisdiction)); + recommendations.push(format!("建议使用支持的结构:{:?}", framework.supported_structures)); + } + + let requires_fatwa = framework.sharia_board.fatwa_required && violations.is_empty(); + + ShariaValidationResult { + is_compliant: violations.is_empty(), + violations, + recommendations, + requires_fatwa, + } +} + +/// Sharia 合规验证结果 +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ShariaValidationResult { + /// 是否合规 + pub is_compliant: bool, + /// 违规项目 + pub violations: Vec, + /// 建议 + pub recommendations: Vec, + /// 是否需要 Fatwa + pub requires_fatwa: bool, +} + +fn ae_sharia_framework() -> ShariaComplianceFramework { + ShariaComplianceFramework { + jurisdiction: "AE".to_string(), + jurisdiction_name: "阿联酋(United Arab Emirates)".to_string(), + regulatory_body: "阿联酋中央银行(CBUAE)+ 迪拜伊斯兰经济局(DIEDC)+ AAOIFI".to_string(), + applicable_laws: vec![ + "联邦第6号法律(2004年):伊斯兰银行法".to_string(), + "联邦第14号法律(2018年):伊斯兰金融机构法".to_string(), + "迪拜国际金融中心(DIFC):伊斯兰金融规则".to_string(), + "AAOIFI Sharia Standards(会计和审计组织标准)".to_string(), + ], + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: true, + recommended_boards: vec![ + "AAOIFI(伊斯兰金融机构会计和审计组织)".to_string(), + "迪拜伊斯兰银行 Sharia 委员会".to_string(), + "阿布扎比伊斯兰银行 Sharia 委员会".to_string(), + ], + ongoing_monitoring: true, + }, + prohibitions: HaramProhibitions { + prohibited_goods: vec![ + "猪肉及猪肉制品".to_string(), + "酒精及含酒精饮料".to_string(), + "武器弹药(民用)".to_string(), + "色情内容".to_string(), + "赌博设备".to_string(), + ], + prohibited_industries: vec![ + "传统银行(基于利息)".to_string(), + "酒类生产和销售".to_string(), + "赌博业".to_string(), + "猪肉相关产业".to_string(), + "烟草业(部分学者认为禁止)".to_string(), + ], + prohibited_structures: vec![ + "固定利率贷款(Riba al-Nasi'ah)".to_string(), + "超额利息(Riba al-Fadl)".to_string(), + "期权和期货(Gharar过度)".to_string(), + "空头卖出(不拥有资产即出售)".to_string(), + "信用违约互换(CDS)".to_string(), + ], + prohibited_clauses: vec![ + "固定利率条款".to_string(), + "罚息条款(迟延利息)".to_string(), + "不确定价格条款".to_string(), + "条件性销售(买方须购买另一商品)".to_string(), + ], + }, + asset_requirements: ShariaAssetRequirements { + must_be_tangible: true, + must_be_halal: true, + must_be_identifiable: true, + must_exist_at_contract: true, + must_be_deliverable: true, + special_notes: vec![ + "Sukuk 须基于真实资产,不能是纯债务".to_string(), + "Murabaha 中银行须实际拥有资产后再出售".to_string(), + "Ijara 中出租物须为合法资产".to_string(), + ], + }, + supported_structures: vec![ + IslamicFinanceStructure::Murabaha, + IslamicFinanceStructure::Ijara, + IslamicFinanceStructure::IjaraWaIqtina, + IslamicFinanceStructure::Musharakah, + IslamicFinanceStructure::Mudarabah, + IslamicFinanceStructure::Sukuk, + IslamicFinanceStructure::Istisna, + IslamicFinanceStructure::Wakalah, + IslamicFinanceStructure::Takaful, + ], + profit_sharing_rules: vec![ + ProfitSharingRule { + structure: IslamicFinanceStructure::Musharakah, + profit_sharing_ratio: "按约定比例分配利润(通常与出资比例相关)".to_string(), + loss_bearing_rule: "按出资比例承担损失".to_string(), + benchmark_alternative: Some("EIBOR(阿联酋银行间利率)作为参考基准,但不作为利息".to_string()), + notes: "利润分配比例须在合同签订时明确约定".to_string(), + }, + ProfitSharingRule { + structure: IslamicFinanceStructure::Mudarabah, + profit_sharing_ratio: "出资方(Rab al-Mal)和经营方(Mudarib)按约定比例分配利润".to_string(), + loss_bearing_rule: "损失由出资方承担,经营方损失时间和劳动".to_string(), + benchmark_alternative: None, + notes: "经营方不保证利润,但须尽职经营".to_string(), + }, + ], + sukuk_requirements: Some(SukukStructure { + sukuk_type: IslamicFinanceStructure::Sukuk, + underlying_asset: "须为真实有形资产(不动产、基础设施、设备等)".to_string(), + spv_required: true, + asset_transfer_required: true, + return_calculation: "基于资产收益(租金、利润分成),而非固定利率".to_string(), + redemption_mechanism: "到期按约定价格赎回,或通过资产处置".to_string(), + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: true, + recommended_boards: vec![ + "AAOIFI认证的 Sharia 委员会".to_string(), + "迪拜金融服务局(DFSA)认可的 Sharia 顾问".to_string(), + ], + ongoing_monitoring: true, + }, + }), + real_estate_sharia_requirements: vec![ + "不动产融资须使用 Ijara wa Iqtina(租赁并购买)或 Musharakah Mutanaqisah(递减合伙)结构".to_string(), + "禁止传统抵押贷款(含固定利息)".to_string(), + "DLD(迪拜土地局)须完成产权登记".to_string(), + "须获得 DLD 的 NOC(无异议证明)".to_string(), + "伊斯兰银行须实际拥有不动产后再转让给买方".to_string(), + "不动产须为 Halal 用途(不能用于酒吧、赌场等)".to_string(), + ], + goods_trade_sharia_requirements: vec![ + "商品须为 Halal(合法)商品".to_string(), + "商品须在合同签订时已存在(Salam 除外)".to_string(), + "价格须在合同签订时明确确定".to_string(), + "禁止出售尚未拥有的商品(除 Salam 和 Istisna)".to_string(), + "商品融资可使用 Murabaha 结构".to_string(), + ], + ip_sharia_requirements: vec![ + "知识产权可作为 Sharia 合规资产".to_string(), + "许可费须为固定金额或明确的利润分成,不能为利息".to_string(), + "可使用 Wakalah(代理)结构管理知识产权".to_string(), + "须确保知识产权用途符合 Halal 原则".to_string(), + ], + conventional_interoperability: "阿联酋同时存在传统金融和伊斯兰金融体系,DIFC 内可使用传统金融结构,但须明确标注非 Sharia 合规".to_string(), + } +} + +fn sa_sharia_framework() -> ShariaComplianceFramework { + ShariaComplianceFramework { + jurisdiction: "SA".to_string(), + jurisdiction_name: "沙特阿拉伯(Kingdom of Saudi Arabia)".to_string(), + regulatory_body: "沙特中央银行(SAMA)+ 资本市场局(CMA)+ 沙特伊斯兰金融委员会".to_string(), + applicable_laws: vec![ + "皇家法令 M/5(1966年):银行管制法".to_string(), + "资本市场法(2003年)".to_string(), + "Sukuk 监管框架(2021年)".to_string(), + "AAOIFI Sharia Standards".to_string(), + "IFSB(伊斯兰金融服务委员会)标准".to_string(), + ], + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: true, + recommended_boards: vec![ + "沙特阿拉伯伊斯兰大学 Sharia 委员会".to_string(), + "AAOIFI 认证学者".to_string(), + "IFSB 认可的 Sharia 顾问".to_string(), + ], + ongoing_monitoring: true, + }, + prohibitions: HaramProhibitions { + prohibited_goods: vec![ + "猪肉及猪肉制品".to_string(), + "酒精(严格禁止)".to_string(), + "武器弹药(未经许可)".to_string(), + "色情内容".to_string(), + "赌博设备".to_string(), + "偶像崇拜相关物品".to_string(), + ], + prohibited_industries: vec![ + "传统银行(基于利息)".to_string(), + "酒类(严格禁止)".to_string(), + "赌博业".to_string(), + "娱乐业(部分)".to_string(), + "烟草业".to_string(), + ], + prohibited_structures: vec![ + "固定利率贷款".to_string(), + "任何形式的 Riba".to_string(), + "期权和期货(Gharar)".to_string(), + "传统保险(须用 Takaful 替代)".to_string(), + ], + prohibited_clauses: vec![ + "固定利率条款".to_string(), + "罚息条款".to_string(), + "不确定价格条款".to_string(), + ], + }, + asset_requirements: ShariaAssetRequirements { + must_be_tangible: true, + must_be_halal: true, + must_be_identifiable: true, + must_exist_at_contract: true, + must_be_deliverable: true, + special_notes: vec![ + "沙特对 Sharia 合规要求极为严格,须获得正式 Fatwa".to_string(), + "Vision 2030 框架下,部分娱乐业已开放,但须确认具体项目的合规性".to_string(), + "NEOM 等新城市项目有特殊的 Sharia 合规安排".to_string(), + ], + }, + supported_structures: vec![ + IslamicFinanceStructure::Murabaha, + IslamicFinanceStructure::Ijara, + IslamicFinanceStructure::IjaraWaIqtina, + IslamicFinanceStructure::Musharakah, + IslamicFinanceStructure::Mudarabah, + IslamicFinanceStructure::Sukuk, + IslamicFinanceStructure::Istisna, + IslamicFinanceStructure::Salam, + IslamicFinanceStructure::Wakalah, + IslamicFinanceStructure::Takaful, + ], + profit_sharing_rules: vec![ + ProfitSharingRule { + structure: IslamicFinanceStructure::Musharakah, + profit_sharing_ratio: "按约定比例分配利润".to_string(), + loss_bearing_rule: "按出资比例承担损失".to_string(), + benchmark_alternative: Some("SAIBOR(沙特银行间利率)作为参考基准".to_string()), + notes: "沙特对 Musharakah 结构有严格的 Sharia 审查要求".to_string(), + }, + ], + sukuk_requirements: Some(SukukStructure { + sukuk_type: IslamicFinanceStructure::Sukuk, + underlying_asset: "须为真实有形资产,沙特政府 Sukuk 通常基于基础设施资产".to_string(), + spv_required: true, + asset_transfer_required: true, + return_calculation: "基于资产收益,通常参考 SAIBOR 加点".to_string(), + redemption_mechanism: "到期按约定价格赎回".to_string(), + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: true, + recommended_boards: vec![ + "AAOIFI 认证的 Sharia 委员会".to_string(), + "沙特 CMA 认可的 Sharia 顾问".to_string(), + ], + ongoing_monitoring: true, + }, + }), + real_estate_sharia_requirements: vec![ + "不动产融资须使用 Ijara 或 Musharakah Mutanaqisah 结构".to_string(), + "须在沙特不动产登记局(Notary Public)完成登记".to_string(), + "外资购买不动产受限(须获得 SAGIA 批准)".to_string(), + "不动产须为 Halal 用途".to_string(), + "须获得正式 Fatwa 确认合规性".to_string(), + ], + goods_trade_sharia_requirements: vec![ + "商品须为 Halal 商品(须有 Halal 认证)".to_string(), + "食品须符合沙特食品药品局(SFDA)的 Halal 认证".to_string(), + "商品融资可使用 Murabaha 或 Salam 结构".to_string(), + "禁止出售酒精、猪肉等 Haram 商品".to_string(), + ], + ip_sharia_requirements: vec![ + "知识产权须用于 Halal 目的".to_string(), + "许可费须为固定金额,不能含利息成分".to_string(), + "须获得 Sharia 委员会确认许可结构合规".to_string(), + ], + conventional_interoperability: "沙特金融体系几乎完全基于伊斯兰金融,传统金融机构须设立独立的伊斯兰金融窗口".to_string(), + } +} + +fn my_sharia_framework() -> ShariaComplianceFramework { + ShariaComplianceFramework { + jurisdiction: "MY".to_string(), + jurisdiction_name: "马来西亚(Malaysia)".to_string(), + regulatory_body: "马来西亚国家银行(BNM)+ 证券委员会(SC)+ 国家 Sharia 咨询委员会(SAC)".to_string(), + applicable_laws: vec![ + "伊斯兰金融服务法(IFSA 2013)".to_string(), + "伊斯兰资本市场框架".to_string(), + "BNM Sharia 标准".to_string(), + "SC 伊斯兰证券指南".to_string(), + "AAOIFI Sharia Standards(参考)".to_string(), + ], + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: false, + recommended_boards: vec![ + "BNM 国家 Sharia 咨询委员会(SAC)".to_string(), + "SC Sharia 咨询委员会".to_string(), + "ISRA(伊斯兰金融研究院)".to_string(), + ], + ongoing_monitoring: true, + }, + prohibitions: HaramProhibitions { + prohibited_goods: vec![ + "猪肉及猪肉制品".to_string(), + "酒精".to_string(), + "武器弹药(未经许可)".to_string(), + "色情内容".to_string(), + ], + prohibited_industries: vec![ + "传统银行(基于利息)".to_string(), + "酒类".to_string(), + "赌博业".to_string(), + "烟草业".to_string(), + ], + prohibited_structures: vec![ + "固定利率贷款(Riba)".to_string(), + "任何形式的 Riba(利息)均被禁止".to_string(), + "传统保险(须用 Takaful 替代)".to_string(), + "Gharar 过度的衍生品".to_string(), + ], + prohibited_clauses: vec![ + "固定利率条款".to_string(), + "罚息条款(但可收取 Ta'widh 实际损失补偿)".to_string(), + ], + }, + asset_requirements: ShariaAssetRequirements { + must_be_tangible: true, + must_be_halal: true, + must_be_identifiable: true, + must_exist_at_contract: true, + must_be_deliverable: true, + special_notes: vec![ + "马来西亚是全球最成熟的伊斯兰金融市场之一".to_string(), + "BNM 允许 Ta'widh(实际损失补偿),替代罚息".to_string(), + "马来西亚同时存在传统金融和伊斯兰金融双轨制".to_string(), + "AIBIM(伊斯兰银行协会)提供行业指导".to_string(), + ], + }, + supported_structures: vec![ + IslamicFinanceStructure::Murabaha, + IslamicFinanceStructure::Ijara, + IslamicFinanceStructure::IjaraWaIqtina, + IslamicFinanceStructure::Musharakah, + IslamicFinanceStructure::Mudarabah, + IslamicFinanceStructure::Sukuk, + IslamicFinanceStructure::Istisna, + IslamicFinanceStructure::Salam, + IslamicFinanceStructure::Wakalah, + IslamicFinanceStructure::Takaful, + ], + profit_sharing_rules: vec![ + ProfitSharingRule { + structure: IslamicFinanceStructure::Musharakah, + profit_sharing_ratio: "按约定比例分配利润(通常与出资比例相关)".to_string(), + loss_bearing_rule: "按出资比例承担损失".to_string(), + benchmark_alternative: Some("KLIBOR(吉隆坡银行间利率)作为参考基准".to_string()), + notes: "马来西亚 Musharakah 实践较为灵活".to_string(), + }, + ProfitSharingRule { + structure: IslamicFinanceStructure::Mudarabah, + profit_sharing_ratio: "出资方和经营方按约定比例分配利润(通常70:30或80:20)".to_string(), + loss_bearing_rule: "损失由出资方承担".to_string(), + benchmark_alternative: None, + notes: "马来西亚 Mudarabah 存款广泛使用".to_string(), + }, + ], + sukuk_requirements: Some(SukukStructure { + sukuk_type: IslamicFinanceStructure::Sukuk, + underlying_asset: "须为真实资产,马来西亚 Sukuk 市场全球最大".to_string(), + spv_required: true, + asset_transfer_required: true, + return_calculation: "基于资产收益,通常参考 KLIBOR 加点".to_string(), + redemption_mechanism: "到期按约定价格赎回".to_string(), + sharia_board: ShariaBoardRequirement { + required: true, + minimum_scholars: 3, + fatwa_required: false, + recommended_boards: vec![ + "SC Sharia 咨询委员会".to_string(), + "BNM SAC 认可的 Sharia 顾问".to_string(), + ], + ongoing_monitoring: true, + }, + }), + real_estate_sharia_requirements: vec![ + "不动产融资可使用 Bai' Bithaman Ajil(BBA,延期付款买卖)或 Musharakah Mutanaqisah".to_string(), + "须在马来西亚土地局(Pejabat Tanah)完成产权登记".to_string(), + "外资购买不动产须遵守各州规定(通常须获批准)".to_string(), + "不动产须为 Halal 用途".to_string(), + ], + goods_trade_sharia_requirements: vec![ + "商品须为 Halal 商品(须有 JAKIM Halal 认证)".to_string(), + "商品融资可使用 Murabaha 或 Tawarruq 结构".to_string(), + "禁止出售 Haram 商品".to_string(), + ], + ip_sharia_requirements: vec![ + "知识产权须用于 Halal 目的".to_string(), + "许可费须为固定金额或明确的利润分成".to_string(), + "马来西亚 SC 已发布知识产权 Sukuk 指南".to_string(), + ], + conventional_interoperability: "马来西亚实行双轨制金融体系,传统金融和伊斯兰金融并存,须明确标注合同类型".to_string(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_ae_framework_exists() { + let f = get_sharia_framework("AE"); + assert!(f.is_some()); + let f = f.unwrap(); + assert_eq!(f.jurisdiction, "AE"); + assert!(f.sharia_board.required); + assert!(f.sharia_board.fatwa_required); + } + + #[test] + fn test_sa_framework_exists() { + let f = get_sharia_framework("SA"); + assert!(f.is_some()); + let f = f.unwrap(); + assert_eq!(f.jurisdiction, "SA"); + assert!(f.sharia_board.required); + } + + #[test] + fn test_my_framework_exists() { + let f = get_sharia_framework("MY"); + assert!(f.is_some()); + let f = f.unwrap(); + assert_eq!(f.jurisdiction, "MY"); + assert!(f.sharia_board.required); + } + + #[test] + fn test_unknown_jurisdiction_returns_none() { + let f = get_sharia_framework("XX"); + assert!(f.is_none()); + } + + #[test] + fn test_all_frameworks_prohibit_riba() { + for j in &["AE", "SA", "MY"] { + let f = get_sharia_framework(j).unwrap(); + assert!( + f.prohibitions.prohibited_structures.iter().any(|s| s.contains("利息") || s.contains("Riba")), + "{} 框架未明确禁止利息(Riba)", j + ); + } + } + + #[test] + fn test_all_frameworks_support_murabaha() { + for j in &["AE", "SA", "MY"] { + let f = get_sharia_framework(j).unwrap(); + assert!( + f.supported_structures.contains(&IslamicFinanceStructure::Murabaha), + "{} 框架不支持 Murabaha 结构", j + ); + } + } + + #[test] + fn test_all_frameworks_support_sukuk() { + for j in &["AE", "SA", "MY"] { + let f = get_sharia_framework(j).unwrap(); + assert!( + f.supported_structures.contains(&IslamicFinanceStructure::Sukuk), + "{} 框架不支持 Sukuk", j + ); + assert!(f.sukuk_requirements.is_some(), "{} 框架缺少 Sukuk 要求", j); + } + } + + #[test] + fn test_validate_compliant_musharakah() { + let result = validate_sharia_compliance( + "AE", + &IslamicFinanceStructure::Musharakah, + false, + false, + false, + ); + assert!(result.is_compliant); + assert!(result.violations.is_empty()); + } + + #[test] + fn test_validate_riba_violation() { + let result = validate_sharia_compliance( + "AE", + &IslamicFinanceStructure::Musharakah, + true, + false, + false, + ); + assert!(!result.is_compliant); + assert!(result.violations.iter().any(|v| v.contains("Riba"))); + } + + #[test] + fn test_validate_haram_goods_violation() { + let result = validate_sharia_compliance( + "SA", + &IslamicFinanceStructure::Murabaha, + false, + false, + true, + ); + assert!(!result.is_compliant); + assert!(result.violations.iter().any(|v| v.contains("Haram"))); + } + + #[test] + fn test_validate_gharar_violation() { + let result = validate_sharia_compliance( + "MY", + &IslamicFinanceStructure::Murabaha, + false, + true, + false, + ); + assert!(!result.is_compliant); + assert!(result.violations.iter().any(|v| v.contains("Gharar"))); + } + + #[test] + fn test_all_frameworks_have_real_estate_requirements() { + for j in &["AE", "SA", "MY"] { + let f = get_sharia_framework(j).unwrap(); + assert!( + !f.real_estate_sharia_requirements.is_empty(), + "{} 框架缺少不动产 Sharia 要求", j + ); + } + } + + #[test] + fn test_all_frameworks_have_goods_requirements() { + for j in &["AE", "SA", "MY"] { + let f = get_sharia_framework(j).unwrap(); + assert!( + !f.goods_trade_sharia_requirements.is_empty(), + "{} 框架缺少商品 Sharia 要求", j + ); + } + } + + #[test] + fn test_ae_has_sukuk_spv_requirement() { + let f = get_sharia_framework("AE").unwrap(); + let sukuk = f.sukuk_requirements.unwrap(); + assert!(sukuk.spv_required); + assert!(sukuk.asset_transfer_required); + } + + #[test] + fn test_my_dual_system_note() { + let f = get_sharia_framework("MY").unwrap(); + // 马来西亚是双轨制,须有互操作性说明 + assert!(f.conventional_interoperability.contains("双轨制")); + } +}