From 2760f00a30aa168a8249a985072ad209d80f09e9 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Mon, 5 May 2025 11:32:09 +0300 Subject: [PATCH] Vocabulary fixes --- actix_mvc_app/src/controllers/asset.rs | 76 ++--- actix_mvc_app/src/controllers/defi.rs | 107 ++++--- actix_mvc_app/src/controllers/flow.rs | 34 +-- actix_mvc_app/src/controllers/governance.rs | 10 +- actix_mvc_app/src/controllers/marketplace.rs | 18 +- actix_mvc_app/src/models/asset.rs | 4 +- actix_mvc_app/src/models/defi.rs | 98 +++---- actix_mvc_app/src/models/mod.rs | 2 +- actix_mvc_app/src/routes/mod.rs | 4 +- actix_mvc_app/src/views/assets/index.html | 4 +- actix_mvc_app/src/views/assets/list.html | 2 +- actix_mvc_app/src/views/base.html | 4 +- actix_mvc_app/src/views/contact.html | 2 +- actix_mvc_app/src/views/defi/index.html | 6 +- .../src/views/defi/tabs/collateral.html | 12 +- .../views/defi/tabs/lending_borrowing.html | 112 ++++---- .../src/views/defi/tabs/liquidity.html | 52 ++-- .../src/views/defi/tabs/overview.html | 2 +- .../views/defi/tabs/providing_receiving.html | 260 ++++++++++++++++++ .../src/views/defi/tabs/staking.html | 36 +-- actix_mvc_app/src/views/defi/tabs/swap.html | 38 +-- .../src/views/marketplace/create_listing.html | 2 +- .../src/views/marketplace/index.html | 2 +- .../src/views/marketplace/listing_detail.html | 2 +- .../src/views/marketplace/listings.html | 4 +- actix_mvc_app/static/js/defi.js | 18 +- specs/rwda/README.md | 6 +- 27 files changed, 588 insertions(+), 329 deletions(-) create mode 100644 actix_mvc_app/src/views/defi/tabs/providing_receiving.html diff --git a/actix_mvc_app/src/controllers/asset.rs b/actix_mvc_app/src/controllers/asset.rs index 5bd5451..6e937c6 100644 --- a/actix_mvc_app/src/controllers/asset.rs +++ b/actix_mvc_app/src/controllers/asset.rs @@ -65,7 +65,7 @@ impl AssetController { // Add assets by type let asset_types = vec![ - AssetType::NFT, + AssetType::Artwork, AssetType::Token, AssetType::RealEstate, AssetType::Commodity, @@ -209,7 +209,7 @@ impl AssetController { // Add asset types for dropdown let asset_types = vec![ - ("NFT", "NFT"), + ("Artwork", "Artwork"), ("Token", "Token"), ("RealEstate", "Real Estate"), ("Commodity", "Commodity"), @@ -473,7 +473,7 @@ impl AssetController { "token_price": 75.0 }), image_url: Some("https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=600&q=80".to_string()), - external_url: Some("https://oceanviewholdings.zaz/resort".to_string()), + external_url: Some("https://oceanviewholdings.zdfz/resort".to_string()), }; zanzibar_resort.add_blockchain_info(BlockchainInfo { @@ -486,9 +486,9 @@ impl AssetController { timestamp: Some(now - Duration::days(120)), }); - zanzibar_resort.add_valuation(650000.0, "USD", "ZAZ Property Registry", Some("Initial tokenization valuation".to_string())); + zanzibar_resort.add_valuation(650000.0, "USD", "ZDFZ Property Registry", Some("Initial tokenization valuation".to_string())); zanzibar_resort.add_valuation(700000.0, "USD", "International Property Appraisers", Some("Independent third-party valuation".to_string())); - zanzibar_resort.add_valuation(750000.0, "USD", "ZAZ Property Registry", Some("Updated valuation after infrastructure improvements".to_string())); + zanzibar_resort.add_valuation(750000.0, "USD", "ZDFZ Property Registry", Some("Updated valuation after infrastructure improvements".to_string())); zanzibar_resort.add_transaction( "Tokenization", @@ -497,7 +497,7 @@ impl AssetController { Some(650000.0), Some("USD".to_string()), Some("0xabcdef123456789abcdef123456789abcdef123456789abcdef123456789abcd".to_string()), - Some("Initial property tokenization under ZAZ Property Registry".to_string()), + Some("Initial property tokenization under ZDFZ Property Registry".to_string()), ); zanzibar_resort.add_transaction( @@ -512,14 +512,14 @@ impl AssetController { assets.push(zanzibar_resort); - // Create ZAZ Governance Token + // Create ZDFZ Governance Token let mut zaz_token = Asset { - id: "asset-zaz-governance".to_string(), - name: "ZAZ Governance Token".to_string(), + id: "asset-zdfz-governance".to_string(), + name: "ZDFZ Governance Token".to_string(), description: "Official governance token of the Zanzibar Digital Freezone, used for voting on proposals and zone-wide decisions".to_string(), asset_type: AssetType::Token, status: AssetStatus::Active, - owner_id: "entity-zaz-foundation".to_string(), + owner_id: "entity-zdfz-foundation".to_string(), owner_name: "Zanzibar Digital Freezone Foundation".to_string(), created_at: now - Duration::days(365), updated_at: now - Duration::days(2), @@ -537,7 +537,7 @@ impl AssetController { "launch_date": (now - Duration::days(365)).to_rfc3339() }), image_url: Some("https://images.unsplash.com/photo-1431540015161-0bf868a2d407?q=80&w=3540&?auto=format&fit=crop&w=600&q=80".to_string()), - external_url: Some("https://governance.zaz/token".to_string()), + external_url: Some("https://governance.zdfz/token".to_string()), }; zaz_token.add_blockchain_info(BlockchainInfo { @@ -550,9 +550,9 @@ impl AssetController { timestamp: Some(now - Duration::days(365)), }); - zaz_token.add_valuation(300000.0, "USD", "ZAZ Token Exchange", Some("Initial valuation at launch".to_string())); - zaz_token.add_valuation(320000.0, "USD", "ZAZ Token Exchange", Some("Valuation after successful governance implementation".to_string())); - zaz_token.add_valuation(350000.0, "USD", "ZAZ Token Exchange", Some("Current market valuation".to_string())); + zaz_token.add_valuation(300000.0, "USD", "ZDFZ Token Exchange", Some("Initial valuation at launch".to_string())); + zaz_token.add_valuation(320000.0, "USD", "ZDFZ Token Exchange", Some("Valuation after successful governance implementation".to_string())); + zaz_token.add_valuation(350000.0, "USD", "ZDFZ Token Exchange", Some("Current market valuation".to_string())); zaz_token.add_transaction( "Distribution", @@ -602,7 +602,7 @@ impl AssetController { "incorporation_date": (now - Duration::days(180)).to_rfc3339() }), image_url: Some("https://images.unsplash.com/photo-1464983953574-0892a716854b?auto=format&fit=crop&w=600&q=80".to_string()), - external_url: Some("https://spicetrade.zaz".to_string()), + external_url: Some("https://spicetrade.zdfz".to_string()), }; spice_trade_shares.add_blockchain_info(BlockchainInfo { @@ -615,9 +615,9 @@ impl AssetController { timestamp: Some(now - Duration::days(180)), }); - spice_trade_shares.add_valuation(150000.0, "USD", "ZAZ Business Registry", Some("Initial company valuation at incorporation".to_string())); - spice_trade_shares.add_valuation(175000.0, "USD", "ZAZ Business Registry", Some("Valuation after first export contracts".to_string())); - spice_trade_shares.add_valuation(200000.0, "USD", "ZAZ Business Registry", Some("Current valuation after expansion to European markets".to_string())); + spice_trade_shares.add_valuation(150000.0, "USD", "ZDFZ Business Registry", Some("Initial company valuation at incorporation".to_string())); + spice_trade_shares.add_valuation(175000.0, "USD", "ZDFZ Business Registry", Some("Valuation after first export contracts".to_string())); + spice_trade_shares.add_valuation(200000.0, "USD", "ZDFZ Business Registry", Some("Current valuation after expansion to European markets".to_string())); spice_trade_shares.add_transaction( "Share Issuance", @@ -648,8 +648,8 @@ impl AssetController { description: "Patent for an innovative tidal energy harvesting system designed specifically for the coastal conditions of Zanzibar".to_string(), asset_type: AssetType::IntellectualProperty, status: AssetStatus::Active, - owner_id: "entity-zaz-energy-innovations".to_string(), - owner_name: "ZAZ Energy Innovations".to_string(), + owner_id: "entity-zdfz-energy-innovations".to_string(), + owner_name: "ZDFZ Energy Innovations".to_string(), created_at: now - Duration::days(210), updated_at: now - Duration::days(30), blockchain_info: None, @@ -659,7 +659,7 @@ impl AssetController { valuation_history: Vec::new(), transaction_history: Vec::new(), metadata: serde_json::json!({ - "patent_number": "ZAZ-PAT-2024-0142", + "patent_number": "ZDFZ-PAT-2024-0142", "filing_date": (now - Duration::days(210)).to_rfc3339(), "grant_date": (now - Duration::days(120)).to_rfc3339(), "patent_type": "Utility", @@ -667,7 +667,7 @@ impl AssetController { "inventors": ["Dr. Amina Juma", "Eng. Ibrahim Hassan", "Dr. Sarah Mbeki"] }), image_url: Some("https://images.unsplash.com/photo-1708851148146-783a5b7da55d?q=80&w=3474&?auto=format&fit=crop&w=600&q=80".to_string()), - external_url: Some("https://patents.zaz/ZAZ-PAT-2024-0142".to_string()), + external_url: Some("https://patents.zdfz/ZDFZ-PAT-2024-0142".to_string()), }; tidal_energy_patent.add_blockchain_info(BlockchainInfo { @@ -680,9 +680,9 @@ impl AssetController { timestamp: Some(now - Duration::days(120)), }); - tidal_energy_patent.add_valuation(80000.0, "USD", "ZAZ IP Registry", Some("Initial patent valuation upon filing".to_string())); - tidal_energy_patent.add_valuation(100000.0, "USD", "ZAZ IP Registry", Some("Valuation after successful prototype testing".to_string())); - tidal_energy_patent.add_valuation(120000.0, "USD", "ZAZ IP Registry", Some("Current valuation after pilot implementation".to_string())); + tidal_energy_patent.add_valuation(80000.0, "USD", "ZDFZ IP Registry", Some("Initial patent valuation upon filing".to_string())); + tidal_energy_patent.add_valuation(100000.0, "USD", "ZDFZ IP Registry", Some("Valuation after successful prototype testing".to_string())); + tidal_energy_patent.add_valuation(120000.0, "USD", "ZDFZ IP Registry", Some("Current valuation after pilot implementation".to_string())); tidal_energy_patent.add_transaction( "Registration", @@ -706,15 +706,15 @@ impl AssetController { assets.push(tidal_energy_patent); - // Create Digital Art NFT + // Create Digital Art Artwork let mut zanzibar_heritage_nft = Asset { - id: "asset-heritage-nft".to_string(), + id: "asset-heritage-Artwork".to_string(), name: "Zanzibar Heritage Collection #1".to_string(), - description: "Limited edition digital art NFT showcasing Zanzibar's cultural heritage, created by renowned local artist Fatma Busaidy".to_string(), - asset_type: AssetType::NFT, + description: "Limited edition digital art Artwork showcasing Zanzibar's cultural heritage, created by renowned local artist Fatma Busaidy".to_string(), + asset_type: AssetType::Artwork, status: AssetStatus::Active, - owner_id: "entity-zaz-digital-arts".to_string(), - owner_name: "ZAZ Digital Arts Collective".to_string(), + owner_id: "entity-zdfz-digital-arts".to_string(), + owner_name: "ZDFZ Digital Arts Collective".to_string(), created_at: now - Duration::days(90), updated_at: now - Duration::days(10), blockchain_info: None, @@ -729,10 +729,10 @@ impl AssetController { "medium": "Digital Mixed Media", "dimensions": "4000x3000 px", "creation_date": (now - Duration::days(95)).to_rfc3339(), - "authenticity_certificate": "ZAZ-ART-CERT-2024-089" + "authenticity_certificate": "ZDFZ-ART-CERT-2024-089" }), image_url: Some("https://images.unsplash.com/photo-1519125323398-675f0ddb6308?auto=format&fit=crop&w=600&q=80".to_string()), - external_url: Some("https://digitalarts.zaz/collections/heritage/1".to_string()), + external_url: Some("https://digitalarts.zdfz/collections/heritage/1".to_string()), }; zanzibar_heritage_nft.add_blockchain_info(BlockchainInfo { @@ -745,9 +745,9 @@ impl AssetController { timestamp: Some(now - Duration::days(90)), }); - zanzibar_heritage_nft.add_valuation(5000.0, "USD", "ZAZ NFT Marketplace", Some("Initial offering price".to_string())); - zanzibar_heritage_nft.add_valuation(5500.0, "USD", "ZAZ NFT Marketplace", Some("Valuation after artist exhibition".to_string())); - zanzibar_heritage_nft.add_valuation(6000.0, "USD", "ZAZ NFT Marketplace", Some("Current market valuation".to_string())); + zanzibar_heritage_nft.add_valuation(5000.0, "USD", "ZDFZ Artwork Marketplace", Some("Initial offering price".to_string())); + zanzibar_heritage_nft.add_valuation(5500.0, "USD", "ZDFZ Artwork Marketplace", Some("Valuation after artist exhibition".to_string())); + zanzibar_heritage_nft.add_valuation(6000.0, "USD", "ZDFZ Artwork Marketplace", Some("Current market valuation".to_string())); zanzibar_heritage_nft.add_transaction( "Minting", @@ -756,7 +756,7 @@ impl AssetController { Some(0.0), Some("ETH".to_string()), Some("0x123456789abcdef123456789abcdef123456789abcdef123456789abcdef1234".to_string()), - Some("Initial NFT minting by artist".to_string()), + Some("Initial Artwork minting by artist".to_string()), ); zanzibar_heritage_nft.add_transaction( @@ -766,7 +766,7 @@ impl AssetController { Some(5000.0), Some("USD".to_string()), Some("0x234567890abcdef123456789abcdef123456789abcdef123456789abcdef1234".to_string()), - Some("Primary sale to ZAZ Digital Arts Collective".to_string()), + Some("Primary sale to ZDFZ Digital Arts Collective".to_string()), ); assets.push(zanzibar_heritage_nft); diff --git a/actix_mvc_app/src/controllers/defi.rs b/actix_mvc_app/src/controllers/defi.rs index e4018c7..ec74d0b 100644 --- a/actix_mvc_app/src/controllers/defi.rs +++ b/actix_mvc_app/src/controllers/defi.rs @@ -6,19 +6,19 @@ use serde::Deserialize; use uuid::Uuid; use crate::models::asset::{Asset, AssetType, AssetStatus}; -use crate::models::defi::{DefiPosition, DefiPositionType, DefiPositionStatus, LendingPosition, BorrowingPosition, DEFI_DB}; +use crate::models::defi::{DefiPosition, DefiPositionType, DefiPositionStatus, ProvidingPosition, ReceivingPosition, DEFI_DB}; use crate::utils::render_template; // Form structs for DeFi operations #[derive(Debug, Deserialize)] -pub struct LendingForm { +pub struct ProvidingForm { pub asset_id: String, pub amount: f64, pub duration: i32, } #[derive(Debug, Deserialize)] -pub struct BorrowingForm { +pub struct ReceivingForm { pub collateral_asset_id: String, pub collateral_amount: f64, pub amount: f64, @@ -53,8 +53,8 @@ pub struct CollateralForm { pub asset_id: String, pub amount: f64, pub purpose: String, - pub loan_amount: Option, - pub loan_term: Option, + pub funds_amount: Option, + pub funds_term: Option, } pub struct DefiController; @@ -86,22 +86,22 @@ impl DefiController { context.insert("recent_assets", &recent_assets); - // Get user's lending positions + // Get user's providing positions let db = DEFI_DB.lock().unwrap(); - let lending_positions = db.get_user_lending_positions("user123"); - let lending_positions_json: Vec = lending_positions + let providing_positions = db.get_user_providing_positions("user123"); + let providing_positions_json: Vec = providing_positions .iter() .map(|p| serde_json::to_value(p).unwrap()) .collect(); - context.insert("lending_positions", &lending_positions_json); + context.insert("providing_positions", &providing_positions_json); - // Get user's borrowing positions - let borrowing_positions = db.get_user_borrowing_positions("user123"); - let borrowing_positions_json: Vec = borrowing_positions + // Get user's receiving positions + let receiving_positions = db.get_user_receiving_positions("user123"); + let receiving_positions_json: Vec = receiving_positions .iter() .map(|p| serde_json::to_value(p).unwrap()) .collect(); - context.insert("borrowing_positions", &borrowing_positions_json); + context.insert("receiving_positions", &receiving_positions_json); // Add success message if present in query params if let Some(success) = req.query_string().strip_prefix("success=") { @@ -115,17 +115,17 @@ impl DefiController { response } - // Process lending request - pub async fn create_lending(_tmpl: web::Data, form: web::Form) -> Result { - println!("DEBUG: Processing lending request: {:?}", form); + // Process providing request + pub async fn create_providing(_tmpl: web::Data, form: web::Form) -> Result { + println!("DEBUG: Processing providing request: {:?}", form); - // Get the asset details (in a real app, this would come from a database) + // Get the asset obligationails (in a real app, this would come from a database) let assets = Self::get_mock_assets(); let asset = assets.iter().find(|a| a.id == form.asset_id); if let Some(asset) = asset { - // Calculate interest and return amount - let apy = match form.duration { + // Calculate profit share and return amount + let profit_share = match form.duration { 7 => 2.5, 30 => 4.2, 90 => 6.8, @@ -134,38 +134,37 @@ impl DefiController { _ => 4.2, // Default to 30 days rate }; - let interest = form.amount * (apy / 100.0) * (form.duration as f64 / 365.0); - let return_amount = form.amount + interest; + let return_amount = form.amount + (form.amount * (profit_share / 100.0) * (form.duration as f64 / 365.0)); - // Create a new lending position - let lending_position = LendingPosition { + // Create a new providing position + let providing_position = ProvidingPosition { base: DefiPosition { id: Uuid::new_v4().to_string(), - position_type: DefiPositionType::Lending, + position_type: DefiPositionType::Providing, status: DefiPositionStatus::Active, - asset_id: asset.id.clone(), + asset_id: form.asset_id.clone(), asset_name: asset.name.clone(), - asset_symbol: asset.asset_type.as_str().to_string(), // Using asset_type as symbol for now + asset_symbol: asset.asset_type.as_str().to_string(), amount: form.amount, - value_usd: form.amount * asset.latest_valuation().map_or(0.5, |v| v.value), // Assuming 0.5 USD per token if no valuation - apy, + value_usd: form.amount * asset.current_valuation.unwrap_or(0.0), + expected_return: profit_share, created_at: Utc::now(), expires_at: Some(Utc::now() + Duration::days(form.duration as i64)), user_id: "user123".to_string(), // Hardcoded user ID for now }, duration_days: form.duration, - interest_earned: interest, + profit_share_earned: profit_share, return_amount, }; // Add the position to the database { let mut db = DEFI_DB.lock().unwrap(); - db.add_lending_position(lending_position); + db.add_providing_position(providing_position); } // Redirect with success message - let success_message = format!("Successfully lent {} {} at {}% APY", form.amount, asset.name, apy); + let success_message = format!("Successfully provided {} {} for {} days", form.amount, asset.name, form.duration); Ok(HttpResponse::SeeOther() .append_header(("Location", format!("/defi?success={}", urlencoding::encode(&success_message)))) .finish()) @@ -177,17 +176,17 @@ impl DefiController { } } - // Process borrowing request - pub async fn create_borrowing(_tmpl: web::Data, form: web::Form) -> Result { - println!("DEBUG: Processing borrowing request: {:?}", form); + // Process receiving request + pub async fn create_receiving(_tmpl: web::Data, form: web::Form) -> Result { + println!("DEBUG: Processing receiving request: {:?}", form); - // Get the asset details (in a real app, this would come from a database) + // Get the asset obligationails (in a real app, this would come from a database) let assets = Self::get_mock_assets(); let collateral_asset = assets.iter().find(|a| a.id == form.collateral_asset_id); if let Some(collateral_asset) = collateral_asset { - // Calculate interest rate based on duration - let interest_rate = match form.duration { + // Calculate profit share rate based on duration + let profit_share_rate = match form.duration { 7 => 3.5, 30 => 5.0, 90 => 6.5, @@ -196,26 +195,26 @@ impl DefiController { _ => 5.0, // Default to 30 days rate }; - // Calculate interest and total to repay - let interest = form.amount * (interest_rate / 100.0) * (form.duration as f64 / 365.0); - let total_to_repay = form.amount + interest; + // Calculate profit share and total to repay + let profit_share = form.amount * (profit_share_rate / 100.0) * (form.duration as f64 / 365.0); + let total_to_repay = form.amount + profit_share; // Calculate collateral value and ratio let collateral_value = form.collateral_amount * collateral_asset.latest_valuation().map_or(0.5, |v| v.value); let collateral_ratio = (collateral_value / form.amount) * 100.0; - // Create a new borrowing position - let borrowing_position = BorrowingPosition { + // Create a new receiving position + let receiving_position = ReceivingPosition { base: DefiPosition { id: Uuid::new_v4().to_string(), - position_type: DefiPositionType::Borrowing, + position_type: DefiPositionType::Receiving, status: DefiPositionStatus::Active, - asset_id: "ZAZ".to_string(), // Hardcoded for now, in a real app this would be a parameter + asset_id: "ZDFZ".to_string(), // Hardcoded for now, in a real app this would be a parameter asset_name: "Zanzibar Token".to_string(), - asset_symbol: "ZAZ".to_string(), + asset_symbol: "ZDFZ".to_string(), amount: form.amount, - value_usd: form.amount * 0.5, // Assuming 0.5 USD per ZAZ - apy: interest_rate, + value_usd: form.amount * 0.5, // Assuming 0.5 USD per ZDFZ + expected_return: profit_share_rate, created_at: Utc::now(), expires_at: Some(Utc::now() + Duration::days(form.duration as i64)), user_id: "user123".to_string(), // Hardcoded user ID for now @@ -226,8 +225,8 @@ impl DefiController { collateral_amount: form.collateral_amount, collateral_value_usd: collateral_value, duration_days: form.duration, - interest_rate, - interest_owed: interest, + profit_share_rate, + profit_share_owed: profit_share, total_to_repay, collateral_ratio, }; @@ -235,11 +234,11 @@ impl DefiController { // Add the position to the database { let mut db = DEFI_DB.lock().unwrap(); - db.add_borrowing_position(borrowing_position); + db.add_receiving_position(receiving_position); } // Redirect with success message - let success_message = format!("Successfully borrowed {} ZAZ using {} {} as collateral", + let success_message = format!("Successfully borrowed {} ZDFZ using {} {} as collateral", form.amount, form.collateral_amount, collateral_asset.name); Ok(HttpResponse::SeeOther() .append_header(("Location", format!("/defi?success={}", urlencoding::encode(&success_message)))) @@ -304,7 +303,7 @@ impl DefiController { // For now, we'll just redirect back to the DeFi dashboard with a success message let purpose_str = match form.purpose.as_str() { - "loan" => "secure a loan", + "funds" => "secure a funds", "synthetic" => "generate synthetic assets", "leverage" => "leverage trading", _ => "collateralization", @@ -324,8 +323,8 @@ impl DefiController { // Handle Option by unwrapping with expect stats.insert("total_value_locked".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(1250000.0).expect("Valid float"))); - stats.insert("lending_volume".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(450000.0).expect("Valid float"))); - stats.insert("borrowing_volume".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(320000.0).expect("Valid float"))); + stats.insert("providing_volume".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(450000.0).expect("Valid float"))); + stats.insert("receiving_volume".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(320000.0).expect("Valid float"))); stats.insert("liquidity_pools_count".to_string(), serde_json::Value::Number(serde_json::Number::from(12))); stats.insert("active_stakers".to_string(), serde_json::Value::Number(serde_json::Number::from(156))); stats.insert("total_swap_volume".to_string(), serde_json::Value::Number(serde_json::Number::from_f64(780000.0).expect("Valid float"))); diff --git a/actix_mvc_app/src/controllers/flow.rs b/actix_mvc_app/src/controllers/flow.rs index 9853428..0757448 100644 --- a/actix_mvc_app/src/controllers/flow.rs +++ b/actix_mvc_app/src/controllers/flow.rs @@ -187,7 +187,7 @@ impl FlowController { // Create a few mock flows let mut flow1 = Flow { id: "flow-1".to_string(), - name: "ZAZ Business Entity Registration".to_string(), + name: "ZDFZ Business Entity Registration".to_string(), description: "Register a new business entity within the Zanzibar Digital Freezone legal framework".to_string(), flow_type: FlowType::CompanyRegistration, status: FlowStatus::InProgress, @@ -223,7 +223,7 @@ impl FlowController { FlowStep { id: "step-1-2".to_string(), name: "Regulatory Review".to_string(), - description: "ZAZ Business Registry review of submitted documents and compliance with regulatory requirements".to_string(), + description: "ZDFZ Business Registry review of submitted documents and compliance with regulatory requirements".to_string(), order: 2, status: StepStatus::InProgress, started_at: Some(Utc::now() - Duration::days(3)), @@ -231,7 +231,7 @@ impl FlowController { logs: vec![ FlowLog { id: "log-1-2-1".to_string(), - message: "Regulatory review initiated by ZAZ Business Registry".to_string(), + message: "Regulatory review initiated by ZDFZ Business Registry".to_string(), timestamp: Utc::now() - Duration::days(3), }, FlowLog { @@ -249,7 +249,7 @@ impl FlowController { FlowStep { id: "step-1-3".to_string(), name: "Digital Identity Creation".to_string(), - description: "Creation of the entity's digital identity and blockchain credentials within the ZAZ ecosystem".to_string(), + description: "Creation of the entity's digital identity and blockchain credentials within the ZDFZ ecosystem".to_string(), order: 3, status: StepStatus::Pending, started_at: None, @@ -280,7 +280,7 @@ impl FlowController { let mut flow2 = Flow { id: "flow-2".to_string(), name: "Digital Asset Tokenization Approval".to_string(), - description: "Process for approving the tokenization of a real estate asset within the ZAZ regulatory framework".to_string(), + description: "Process for approving the tokenization of a real estate asset within the ZDFZ regulatory framework".to_string(), flow_type: FlowType::AssetTokenization, status: FlowStatus::Completed, owner_id: "user-2".to_string(), @@ -302,7 +302,7 @@ impl FlowController { }, FlowLog { id: "log-2-1-2".to_string(), - message: "Independent valuation completed by ZAZ Property Registry".to_string(), + message: "Independent valuation completed by ZDFZ Property Registry".to_string(), timestamp: Utc::now() - Duration::days(27), }, FlowLog { @@ -315,7 +315,7 @@ impl FlowController { FlowStep { id: "step-2-2".to_string(), name: "Tokenization Structure Review".to_string(), - description: "Review of the proposed token structure, distribution model, and compliance with ZAZ tokenization standards".to_string(), + description: "Review of the proposed token structure, distribution model, and compliance with ZDFZ tokenization standards".to_string(), order: 2, status: StepStatus::Completed, started_at: Some(Utc::now() - Duration::days(24)), @@ -328,7 +328,7 @@ impl FlowController { }, FlowLog { id: "log-2-2-2".to_string(), - message: "Technical review completed by ZAZ Digital Assets Committee".to_string(), + message: "Technical review completed by ZDFZ Digital Assets Committee".to_string(), timestamp: Utc::now() - Duration::days(22), }, FlowLog { @@ -359,7 +359,7 @@ impl FlowController { }, FlowLog { id: "log-2-3-3".to_string(), - message: "Smart contracts deployed to ZAZ-approved blockchain".to_string(), + message: "Smart contracts deployed to ZDFZ-approved blockchain".to_string(), timestamp: Utc::now() - Duration::days(15), }, ], @@ -367,7 +367,7 @@ impl FlowController { FlowStep { id: "step-2-4".to_string(), name: "Final Approval and Listing".to_string(), - description: "Final regulatory approval and listing on the ZAZ Digital Asset Exchange".to_string(), + description: "Final regulatory approval and listing on the ZDFZ Digital Asset Exchange".to_string(), order: 4, status: StepStatus::Completed, started_at: Some(Utc::now() - Duration::days(14)), @@ -380,12 +380,12 @@ impl FlowController { }, FlowLog { id: "log-2-4-2".to_string(), - message: "Regulatory approval granted by ZAZ Financial Authority".to_string(), + message: "Regulatory approval granted by ZDFZ Financial Authority".to_string(), timestamp: Utc::now() - Duration::days(12), }, FlowLog { id: "log-2-4-3".to_string(), - message: "Asset tokens listed on ZAZ Digital Asset Exchange".to_string(), + message: "Asset tokens listed on ZDFZ Digital Asset Exchange".to_string(), timestamp: Utc::now() - Duration::days(10), }, ], @@ -403,7 +403,7 @@ impl FlowController { let mut flow3 = Flow { id: "flow-3".to_string(), name: "Sustainable Tourism Certification".to_string(), - description: "Application process for ZAZ Sustainable Tourism Certification for eco-tourism businesses".to_string(), + description: "Application process for ZDFZ Sustainable Tourism Certification for eco-tourism businesses".to_string(), flow_type: FlowType::Certification, status: FlowStatus::Stuck, owner_id: "user-3".to_string(), @@ -474,7 +474,7 @@ impl FlowController { FlowStep { id: "step-3-4".to_string(), name: "Certification Issuance".to_string(), - description: "Final review and issuance of ZAZ Sustainable Tourism Certification".to_string(), + description: "Final review and issuance of ZDFZ Sustainable Tourism Certification".to_string(), order: 4, status: StepStatus::Pending, started_at: None, @@ -494,7 +494,7 @@ impl FlowController { let mut flow4 = Flow { id: "flow-4".to_string(), name: "Digital Payment Provider License".to_string(), - description: "Application for a license to operate as a digital payment provider within the ZAZ financial system".to_string(), + description: "Application for a license to operate as a digital payment provider within the ZDFZ financial system".to_string(), flow_type: FlowType::LicenseApplication, status: FlowStatus::InProgress, owner_id: "user-4".to_string(), @@ -529,7 +529,7 @@ impl FlowController { FlowStep { id: "step-4-2".to_string(), name: "Technical Infrastructure Review".to_string(), - description: "Review of the technical infrastructure, security measures, and compliance with ZAZ financial standards".to_string(), + description: "Review of the technical infrastructure, security measures, and compliance with ZDFZ financial standards".to_string(), order: 2, status: StepStatus::Completed, started_at: Some(Utc::now() - Duration::days(17)), @@ -542,7 +542,7 @@ impl FlowController { }, FlowLog { id: "log-4-2-2".to_string(), - message: "Security audit initiated by ZAZ Financial Technology Office".to_string(), + message: "Security audit initiated by ZDFZ Financial Technology Office".to_string(), timestamp: Utc::now() - Duration::days(15), }, FlowLog { diff --git a/actix_mvc_app/src/controllers/governance.rs b/actix_mvc_app/src/controllers/governance.rs index 483428e..eeadfde 100644 --- a/actix_mvc_app/src/controllers/governance.rs +++ b/actix_mvc_app/src/controllers/governance.rs @@ -241,7 +241,7 @@ impl GovernanceController { id: "prop-002".to_string(), creator_id: 2, creator_name: "Amina Salim".to_string(), - title: "ZAZ Sustainable Tourism Framework".to_string(), + title: "ZDFZ Sustainable Tourism Framework".to_string(), description: "A comprehensive framework for sustainable tourism development within the Zanzibar Digital Freezone. This proposal outlines environmental standards, community benefit-sharing mechanisms, and digital infrastructure for eco-tourism businesses. It includes tokenization standards for tourism assets and a certification system for sustainable operators.".to_string(), status: ProposalStatus::Approved, created_at: now - Duration::days(15), @@ -265,7 +265,7 @@ impl GovernanceController { id: "prop-004".to_string(), creator_id: 1, creator_name: "Ibrahim Faraji".to_string(), - title: "ZAZ Regulatory Framework for Digital Financial Services".to_string(), + title: "ZDFZ Regulatory Framework for Digital Financial Services".to_string(), description: "Establish a comprehensive regulatory framework for digital financial services within the Zanzibar Digital Freezone. This includes licensing requirements for crypto exchanges, digital payment providers, and tokenized asset platforms operating within the zone, while ensuring compliance with international AML/KYC standards.".to_string(), status: ProposalStatus::Rejected, created_at: now - Duration::days(20), @@ -277,8 +277,8 @@ impl GovernanceController { id: "prop-005".to_string(), creator_id: 4, creator_name: "Fatma Busaidy".to_string(), - title: "Digital Arts Incubator and NFT Marketplace".to_string(), - description: "Create a dedicated digital arts incubator and NFT marketplace to support Zanzibar's creative economy. The initiative will provide technical training, equipment, and a curated marketplace for local artists to create and sell digital art that celebrates Zanzibar's rich cultural heritage while accessing global markets.".to_string(), + title: "Digital Arts Incubator and Artwork Marketplace".to_string(), + description: "Create a dedicated digital arts incubator and Artwork marketplace to support Zanzibar's creative economy. The initiative will provide technical training, equipment, and a curated marketplace for local artists to create and sell digital art that celebrates Zanzibar's rich cultural heritage while accessing global markets.".to_string(), status: ProposalStatus::Active, created_at: now - Duration::days(7), updated_at: now - Duration::days(7), @@ -301,7 +301,7 @@ impl GovernanceController { id: "prop-007".to_string(), creator_id: 6, creator_name: "Saida Juma".to_string(), - title: "ZAZ Educational Technology Initiative".to_string(), + title: "ZDFZ Educational Technology Initiative".to_string(), description: "Establish a comprehensive educational technology program within the Zanzibar Digital Freezone to develop local tech talent. This initiative includes coding academies, blockchain development courses, and digital entrepreneurship training, with a focus on preparing Zanzibar's youth for careers in the zone's growing digital economy.".to_string(), status: ProposalStatus::Draft, created_at: now - Duration::days(3), diff --git a/actix_mvc_app/src/controllers/marketplace.rs b/actix_mvc_app/src/controllers/marketplace.rs index 9ba00ce..f7e3f83 100644 --- a/actix_mvc_app/src/controllers/marketplace.rs +++ b/actix_mvc_app/src/controllers/marketplace.rs @@ -100,7 +100,7 @@ impl MarketplaceController { ]); context.insert("asset_types", &[ AssetType::Token.as_str(), - AssetType::NFT.as_str(), + AssetType::Artwork.as_str(), AssetType::RealEstate.as_str(), AssetType::IntellectualProperty.as_str(), AssetType::Commodity.as_str(), @@ -168,7 +168,7 @@ impl MarketplaceController { // Add current user info for bid/purchase forms let user_id = "user-123"; - let user_name = "John Doe"; + let user_name = "Alice Hostly"; context.insert("user_id", &user_id); context.insert("user_name", &user_name); @@ -237,7 +237,7 @@ impl MarketplaceController { // Mock user data let user_id = "user-123"; - let user_name = "John Doe"; + let user_name = "Alice Hostly"; // Create the listing let _listing = Listing::new( @@ -347,7 +347,7 @@ impl MarketplaceController { // Mock user data let user_ids = vec!["user-123", "user-456", "user-789"]; - let user_names = vec!["John Doe", "Jane Smith", "Bob Johnson"]; + let user_names = vec!["Alice Hostly", "Ethan Cloudman", "Priya Servera"]; // Create some fixed price listings for i in 0..6 { @@ -357,7 +357,7 @@ impl MarketplaceController { let price = match asset.asset_type { AssetType::Token => 50.0 + (i as f64 * 10.0), - AssetType::NFT => 500.0 + (i as f64 * 100.0), + AssetType::Artwork => 500.0 + (i as f64 * 100.0), AssetType::RealEstate => 50000.0 + (i as f64 * 10000.0), AssetType::IntellectualProperty => 2000.0 + (i as f64 * 500.0), AssetType::Commodity => 1000.0 + (i as f64 * 200.0), @@ -398,7 +398,7 @@ impl MarketplaceController { let starting_price = match asset.asset_type { AssetType::Token => 40.0 + (i as f64 * 5.0), - AssetType::NFT => 400.0 + (i as f64 * 50.0), + AssetType::Artwork => 400.0 + (i as f64 * 50.0), AssetType::RealEstate => 40000.0 + (i as f64 * 5000.0), AssetType::IntellectualProperty => 1500.0 + (i as f64 * 300.0), AssetType::Commodity => 800.0 + (i as f64 * 100.0), @@ -454,7 +454,7 @@ impl MarketplaceController { let value = match asset.asset_type { AssetType::Token => 60.0 + (i as f64 * 15.0), - AssetType::NFT => 600.0 + (i as f64 * 150.0), + AssetType::Artwork => 600.0 + (i as f64 * 150.0), AssetType::RealEstate => 60000.0 + (i as f64 * 15000.0), AssetType::IntellectualProperty => 2500.0 + (i as f64 * 600.0), AssetType::Commodity => 1200.0 + (i as f64 * 300.0), @@ -491,7 +491,7 @@ impl MarketplaceController { let price = match asset.asset_type { AssetType::Token => 55.0 + (i as f64 * 12.0), - AssetType::NFT => 550.0 + (i as f64 * 120.0), + AssetType::Artwork => 550.0 + (i as f64 * 120.0), AssetType::RealEstate => 55000.0 + (i as f64 * 12000.0), AssetType::IntellectualProperty => 2200.0 + (i as f64 * 550.0), AssetType::Commodity => 1100.0 + (i as f64 * 220.0), @@ -540,7 +540,7 @@ impl MarketplaceController { let price = match asset.asset_type { AssetType::Token => 45.0 + (i as f64 * 8.0), - AssetType::NFT => 450.0 + (i as f64 * 80.0), + AssetType::Artwork => 450.0 + (i as f64 * 80.0), AssetType::RealEstate => 45000.0 + (i as f64 * 8000.0), AssetType::IntellectualProperty => 1800.0 + (i as f64 * 400.0), AssetType::Commodity => 900.0 + (i as f64 * 180.0), diff --git a/actix_mvc_app/src/models/asset.rs b/actix_mvc_app/src/models/asset.rs index d48e35c..f2ed183 100644 --- a/actix_mvc_app/src/models/asset.rs +++ b/actix_mvc_app/src/models/asset.rs @@ -5,7 +5,7 @@ use uuid::Uuid; /// Asset types representing different categories of digital assets #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum AssetType { - NFT, + Artwork, Token, RealEstate, Commodity, @@ -18,7 +18,7 @@ pub enum AssetType { impl AssetType { pub fn as_str(&self) -> &str { match self { - AssetType::NFT => "NFT", + AssetType::Artwork => "Artwork", AssetType::Token => "Token", AssetType::RealEstate => "Real Estate", AssetType::Commodity => "Commodity", diff --git a/actix_mvc_app/src/models/defi.rs b/actix_mvc_app/src/models/defi.rs index c6c1b9f..d1986b0 100644 --- a/actix_mvc_app/src/models/defi.rs +++ b/actix_mvc_app/src/models/defi.rs @@ -28,8 +28,8 @@ impl DefiPositionStatus { // DeFi position type #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum DefiPositionType { - Lending, - Borrowing, + Providing, + Receiving, Liquidity, Staking, Collateral, @@ -38,8 +38,8 @@ pub enum DefiPositionType { impl DefiPositionType { pub fn as_str(&self) -> &str { match self { - DefiPositionType::Lending => "Lending", - DefiPositionType::Borrowing => "Borrowing", + DefiPositionType::Providing => "Providing", + DefiPositionType::Receiving => "Receiving", DefiPositionType::Liquidity => "Liquidity", DefiPositionType::Staking => "Staking", DefiPositionType::Collateral => "Collateral", @@ -58,24 +58,24 @@ pub struct DefiPosition { pub asset_symbol: String, pub amount: f64, pub value_usd: f64, - pub apy: f64, + pub expected_return: f64, pub created_at: DateTime, pub expires_at: Option>, pub user_id: String, } -// Lending position +// Providing position #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct LendingPosition { +pub struct ProvidingPosition { pub base: DefiPosition, pub duration_days: i32, - pub interest_earned: f64, + pub profit_share_earned: f64, pub return_amount: f64, } -// Borrowing position +// Receiving position #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct BorrowingPosition { +pub struct ReceivingPosition { pub base: DefiPosition, pub collateral_asset_id: String, pub collateral_asset_name: String, @@ -83,61 +83,61 @@ pub struct BorrowingPosition { pub collateral_amount: f64, pub collateral_value_usd: f64, pub duration_days: i32, - pub interest_rate: f64, - pub interest_owed: f64, + pub profit_share_rate: f64, + pub profit_share_owed: f64, pub total_to_repay: f64, pub collateral_ratio: f64, } // In-memory database for DeFi positions pub struct DefiDatabase { - lending_positions: HashMap, - borrowing_positions: HashMap, + providing_positions: HashMap, + receiving_positions: HashMap, } impl DefiDatabase { pub fn new() -> Self { Self { - lending_positions: HashMap::new(), - borrowing_positions: HashMap::new(), + providing_positions: HashMap::new(), + receiving_positions: HashMap::new(), } } - // Lending operations - pub fn add_lending_position(&mut self, position: LendingPosition) { - self.lending_positions.insert(position.base.id.clone(), position); + // Providing operations + pub fn add_providing_position(&mut self, position: ProvidingPosition) { + self.providing_positions.insert(position.base.id.clone(), position); } - pub fn get_lending_position(&self, id: &str) -> Option<&LendingPosition> { - self.lending_positions.get(id) + pub fn get_providing_position(&self, id: &str) -> Option<&ProvidingPosition> { + self.providing_positions.get(id) } - pub fn get_all_lending_positions(&self) -> Vec<&LendingPosition> { - self.lending_positions.values().collect() + pub fn get_all_providing_positions(&self) -> Vec<&ProvidingPosition> { + self.providing_positions.values().collect() } - pub fn get_user_lending_positions(&self, user_id: &str) -> Vec<&LendingPosition> { - self.lending_positions + pub fn get_user_providing_positions(&self, user_id: &str) -> Vec<&ProvidingPosition> { + self.providing_positions .values() .filter(|p| p.base.user_id == user_id) .collect() } - // Borrowing operations - pub fn add_borrowing_position(&mut self, position: BorrowingPosition) { - self.borrowing_positions.insert(position.base.id.clone(), position); + // Receiving operations + pub fn add_receiving_position(&mut self, position: ReceivingPosition) { + self.receiving_positions.insert(position.base.id.clone(), position); } - pub fn get_borrowing_position(&self, id: &str) -> Option<&BorrowingPosition> { - self.borrowing_positions.get(id) + pub fn get_receiving_position(&self, id: &str) -> Option<&ReceivingPosition> { + self.receiving_positions.get(id) } - pub fn get_all_borrowing_positions(&self) -> Vec<&BorrowingPosition> { - self.borrowing_positions.values().collect() + pub fn get_all_receiving_positions(&self) -> Vec<&ReceivingPosition> { + self.receiving_positions.values().collect() } - pub fn get_user_borrowing_positions(&self, user_id: &str) -> Vec<&BorrowingPosition> { - self.borrowing_positions + pub fn get_user_receiving_positions(&self, user_id: &str) -> Vec<&ReceivingPosition> { + self.receiving_positions .values() .filter(|p| p.base.user_id == user_id) .collect() @@ -153,40 +153,40 @@ lazy_static! { pub fn initialize_mock_data() { let mut db = DEFI_DB.lock().unwrap(); - // Add mock lending positions - let lending_position = LendingPosition { + // Add mock providing positions + let providing_position = ProvidingPosition { base: DefiPosition { id: Uuid::new_v4().to_string(), - position_type: DefiPositionType::Lending, + position_type: DefiPositionType::Providing, status: DefiPositionStatus::Active, asset_id: "TFT".to_string(), asset_name: "ThreeFold Token".to_string(), asset_symbol: "TFT".to_string(), amount: 1000.0, value_usd: 500.0, - apy: 4.2, + expected_return: 4.2, created_at: Utc::now(), expires_at: Some(Utc::now() + chrono::Duration::days(30)), user_id: "user123".to_string(), }, duration_days: 30, - interest_earned: 3.5, + profit_share_earned: 3.5, return_amount: 1003.5, }; - db.add_lending_position(lending_position); + db.add_providing_position(providing_position); - // Add mock borrowing positions - let borrowing_position = BorrowingPosition { + // Add mock receiving positions + let receiving_position = ReceivingPosition { base: DefiPosition { id: Uuid::new_v4().to_string(), - position_type: DefiPositionType::Borrowing, + position_type: DefiPositionType::Receiving, status: DefiPositionStatus::Active, - asset_id: "ZAZ".to_string(), + asset_id: "ZDFZ".to_string(), asset_name: "Zanzibar Token".to_string(), - asset_symbol: "ZAZ".to_string(), + asset_symbol: "ZDFZ".to_string(), amount: 500.0, value_usd: 250.0, - apy: 5.8, + expected_return: 5.8, created_at: Utc::now(), expires_at: Some(Utc::now() + chrono::Duration::days(90)), user_id: "user123".to_string(), @@ -197,10 +197,10 @@ pub fn initialize_mock_data() { collateral_amount: 1500.0, collateral_value_usd: 750.0, duration_days: 90, - interest_rate: 5.8, - interest_owed: 3.625, + profit_share_rate: 5.8, + profit_share_owed: 3.625, total_to_repay: 503.625, collateral_ratio: 300.0, }; - db.add_borrowing_position(borrowing_position); + db.add_receiving_position(receiving_position); } diff --git a/actix_mvc_app/src/models/mod.rs b/actix_mvc_app/src/models/mod.rs index b32c1c0..2e9448b 100644 --- a/actix_mvc_app/src/models/mod.rs +++ b/actix_mvc_app/src/models/mod.rs @@ -14,4 +14,4 @@ pub use user::User; pub use ticket::{Ticket, TicketComment, TicketStatus, TicketPriority}; pub use calendar::{CalendarEvent, CalendarViewMode}; pub use marketplace::{Listing, ListingStatus, ListingType, Bid, BidStatus, MarketplaceStatistics}; -pub use defi::{DefiPosition, DefiPositionType, DefiPositionStatus, LendingPosition, BorrowingPosition, DEFI_DB, initialize_mock_data}; +pub use defi::{DefiPosition, DefiPositionType, DefiPositionStatus, ProvidingPosition, ReceivingPosition, DEFI_DB, initialize_mock_data}; diff --git a/actix_mvc_app/src/routes/mod.rs b/actix_mvc_app/src/routes/mod.rs index 2df0d7a..08622e3 100644 --- a/actix_mvc_app/src/routes/mod.rs +++ b/actix_mvc_app/src/routes/mod.rs @@ -126,8 +126,8 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) { .service( web::scope("/defi") .route("", web::get().to(DefiController::index)) - .route("/lending", web::post().to(DefiController::create_lending)) - .route("/borrowing", web::post().to(DefiController::create_borrowing)) + .route("/providing", web::post().to(DefiController::create_providing)) + .route("/receiving", web::post().to(DefiController::create_receiving)) .route("/liquidity", web::post().to(DefiController::add_liquidity)) .route("/staking", web::post().to(DefiController::create_staking)) .route("/swap", web::post().to(DefiController::swap_tokens)) diff --git a/actix_mvc_app/src/views/assets/index.html b/actix_mvc_app/src/views/assets/index.html index 004519d..fc8bf37 100644 --- a/actix_mvc_app/src/views/assets/index.html +++ b/actix_mvc_app/src/views/assets/index.html @@ -89,7 +89,7 @@
{% if asset.asset_type == "Token" %} - {% elif asset.asset_type == "NFT" %} + {% elif asset.asset_type == "Artwork" %} {% elif asset.asset_type == "Real Estate" %} @@ -162,7 +162,7 @@
{% if asset_type.type == "Token" %} - {% elif asset_type.type == "NFT" %} + {% elif asset_type.type == "Artwork" %} {% elif asset_type.type == "Real Estate" %} diff --git a/actix_mvc_app/src/views/assets/list.html b/actix_mvc_app/src/views/assets/list.html index 53989f2..435ac2f 100644 --- a/actix_mvc_app/src/views/assets/list.html +++ b/actix_mvc_app/src/views/assets/list.html @@ -23,7 +23,7 @@ - + {% for asset in recent_assets %} {% if asset.status == 'Active' %}
@@ -64,12 +64,12 @@
- Borrow Against Assets + Receive Against Assets
-

Borrow digital assets using your existing assets as collateral.

+

Receive digital assets by contributing your existing assets as security.

-
+
+ +
- +
- - TFT + + TFT
-
You can borrow up to 70% of your collateral value.
+
You can receive up to 70% of your collateral value.
- - + + + +
Collateral Ratio: - 0% + 0%
- Interest Due: - 0.00 TFT + Obligation Due: + 0.00 TFT
Total Repayment: - 0.00 TFT + 0.00 TFT
-
+
- +
@@ -141,23 +141,23 @@
- +
Your Active Positions
-
- +
- ZAZ -
Zanzibar Token (ZAZ)
+ ZDFZ +
Zanzibar Token (ZDFZ)
Total Staked: - 2,750,000 ZAZ + 2,750,000 ZDFZ
Your Stake: - 500 ZAZ + 500 ZDFZ
APY: @@ -99,7 +99,7 @@
- +
- ZAZ + + ZDFZ
Estimated Rewards: - 0 ZAZ + 0 ZDFZ
- +
@@ -177,7 +177,7 @@
Reward Token: - ZAZ + ZDFZ
@@ -239,16 +239,16 @@
- ZAZ - Zanzibar Token (ZAZ) + ZDFZ + Zanzibar Token (ZDFZ)
- 500 ZAZ + 500 ZDFZ $250 2025-04-01 2025-05-01 12.0% - 5.0 ZAZ + 5.0 ZDFZ Active @@ -258,15 +258,15 @@
- Beach Property NFT + Beach Property Artwork
- 1 NFT + 1 Artwork $25,000 2025-02-10 2026-02-10 10.0% - 450 ZAZ + 450 ZDFZ Active diff --git a/actix_mvc_app/src/views/defi/tabs/swap.html b/actix_mvc_app/src/views/defi/tabs/swap.html index 1dface0..54b6edf 100644 --- a/actix_mvc_app/src/views/defi/tabs/swap.html +++ b/actix_mvc_app/src/views/defi/tabs/swap.html @@ -41,11 +41,11 @@ Balance: 10,000 TFT -
  • - ZAZ +
  • + ZDFZ
    Zanzibar Token
    - Balance: 5,000 ZAZ + Balance: 5,000 ZDFZ
  • @@ -82,17 +82,17 @@
    - Balance: 5,000 ZAZ + Balance: 5,000 ZDFZ ≈ $2,500.00
    @@ -115,11 +115,11 @@
    Exchange Rate: - 1 TFT = 0.5 ZAZ + 1 TFT = 0.5 ZDFZ
    Minimum Received: - 0 ZAZ + 0 ZDFZ
    Price Impact: @@ -169,8 +169,8 @@
    - ZAZ - 250 ZAZ + ZDFZ + 250 ZDFZ
    $250.00 @@ -195,8 +195,8 @@ 2025-04-12 16:45
    - ZAZ - 100 ZAZ + ZDFZ + 100 ZDFZ
    @@ -235,9 +235,9 @@
    TFT - ZAZ + ZDFZ
    - TFT/ZAZ + TFT/ZDFZ
    0.5 @@ -262,10 +262,10 @@
    - ZAZ + ZDFZ USDT
    - ZAZ/USDT + ZDFZ/USDT
    0.5 diff --git a/actix_mvc_app/src/views/marketplace/create_listing.html b/actix_mvc_app/src/views/marketplace/create_listing.html index 82e44a0..7d7824a 100644 --- a/actix_mvc_app/src/views/marketplace/create_listing.html +++ b/actix_mvc_app/src/views/marketplace/create_listing.html @@ -199,7 +199,7 @@ previewContainer.innerHTML = previewHtml; // Suggest listing type based on asset type - if (assetType === 'NFT') { + if (assetType === 'Artwork') { listingTypeSelect.value = 'Auction'; } else if (assetType === 'Token') { listingTypeSelect.value = 'Fixed Price'; diff --git a/actix_mvc_app/src/views/marketplace/index.html b/actix_mvc_app/src/views/marketplace/index.html index 1eee45b..f456828 100644 --- a/actix_mvc_app/src/views/marketplace/index.html +++ b/actix_mvc_app/src/views/marketplace/index.html @@ -180,7 +180,7 @@ {% if listing.asset_type == "Token" %} {{ listing.asset_type }} - {% elif listing.asset_type == "NFT" %} + {% elif listing.asset_type == "Artwork" %} {{ listing.asset_type }} {% elif listing.asset_type == "RealEstate" %} Real Estate diff --git a/actix_mvc_app/src/views/marketplace/listing_detail.html b/actix_mvc_app/src/views/marketplace/listing_detail.html index 9daa872..f4f58a8 100644 --- a/actix_mvc_app/src/views/marketplace/listing_detail.html +++ b/actix_mvc_app/src/views/marketplace/listing_detail.html @@ -61,7 +61,7 @@

    Asset Type: {% if listing.asset_type == "Token" %} {{ listing.asset_type }} - {% elif listing.asset_type == "NFT" %} + {% elif listing.asset_type == "Artwork" %} {{ listing.asset_type }} {% elif listing.asset_type == "RealEstate" %} Real Estate diff --git a/actix_mvc_app/src/views/marketplace/listings.html b/actix_mvc_app/src/views/marketplace/listings.html index bfe9777..af5df5b 100644 --- a/actix_mvc_app/src/views/marketplace/listings.html +++ b/actix_mvc_app/src/views/marketplace/listings.html @@ -99,7 +99,7 @@ {{ listing.listing_type }} {% if listing.asset_type == "Token" %} {{ listing.asset_type }} - {% elif listing.asset_type == "NFT" %} + {% elif listing.asset_type == "Artwork" %} {{ listing.asset_type }} {% elif listing.asset_type == "RealEstate" %} Real Estate @@ -175,7 +175,7 @@ {% if listing.asset_type == "Token" %} {{ listing.asset_type }} - {% elif listing.asset_type == "NFT" %} + {% elif listing.asset_type == "Artwork" %} {{ listing.asset_type }} {% elif listing.asset_type == "RealEstate" %} Real Estate diff --git a/actix_mvc_app/static/js/defi.js b/actix_mvc_app/static/js/defi.js index 6c7bdc8..52b12fe 100644 --- a/actix_mvc_app/static/js/defi.js +++ b/actix_mvc_app/static/js/defi.js @@ -83,7 +83,7 @@ document.addEventListener('DOMContentLoaded', function() { // Mock prices for demonstration const assetPrices = { 'TFT': 0.5, - 'ZAZ': 0.5, + 'ZDFZ': 0.5, 'USDT': 1.0 }; @@ -152,11 +152,11 @@ document.addEventListener('DOMContentLoaded', function() { const token1Label = document.getElementById('token1Label'); const token2Label = document.getElementById('token2Label'); - if (selectedOption.value === 'tft-zaz') { + if (selectedOption.value === 'tft-zdfz') { if (token1Label) token1Label.textContent = 'TFT'; - if (token2Label) token2Label.textContent = 'ZAZ'; - } else if (selectedOption.value === 'zaz-usdt') { - if (token1Label) token1Label.textContent = 'ZAZ'; + if (token2Label) token2Label.textContent = 'ZDFZ'; + } else if (selectedOption.value === 'zdfz-usdt') { + if (token1Label) token1Label.textContent = 'ZDFZ'; if (token2Label) token2Label.textContent = 'USDT'; } @@ -190,7 +190,7 @@ document.addEventListener('DOMContentLoaded', function() { tftStakingPeriodSelect.addEventListener('change', calculateTftStakingRewards); } - // ZAZ Staking calculations + // ZDFZ Staking calculations const zazStakeAmountInput = document.getElementById('zazStakeAmount'); const zazStakingPeriodSelect = document.getElementById('zazStakingPeriod'); const zazEstimatedRewardsElement = document.getElementById('zazEstimatedRewards'); @@ -208,7 +208,7 @@ document.addEventListener('DOMContentLoaded', function() { // Calculate rewards (simple interest for demonstration) const rewards = amount * apy * (termDays / 365); - zazEstimatedRewardsElement.textContent = rewards.toFixed(2) + ' ZAZ'; + zazEstimatedRewardsElement.textContent = rewards.toFixed(2) + ' ZDFZ'; }; zazStakeAmountInput.addEventListener('input', calculateZazStakingRewards); @@ -264,13 +264,13 @@ document.addEventListener('DOMContentLoaded', function() { // Mock token data const tokenData = { 'TFT': { price: 0.5, balance: '10,000 TFT', usdValue: '5,000.00' }, - 'ZAZ': { price: 0.5, balance: '5,000 ZAZ', usdValue: '2,500.00' }, + 'ZDFZ': { price: 0.5, balance: '5,000 ZDFZ', usdValue: '2,500.00' }, 'USDT': { price: 1.0, balance: '2,500 USDT', usdValue: '2,500.00' } }; if (swapFromAmountInput && swapToAmountElement) { let fromToken = 'TFT'; - let toToken = 'ZAZ'; + let toToken = 'ZDFZ'; const calculateSwap = () => { const fromAmount = parseFloat(swapFromAmountInput.value) || 0; diff --git a/specs/rwda/README.md b/specs/rwda/README.md index 1152268..b06ed61 100644 --- a/specs/rwda/README.md +++ b/specs/rwda/README.md @@ -16,7 +16,7 @@ Real World Digital Assets (RWDAs) represent digitized ownership of real-world as - **Description**: Comprehensive description of the asset and its underlying value - **Asset Type**: Classification (e.g., Real Estate, Business Equity (Shares), Commodity (Gold, Copper)) - **Creation Date**: When the RWDA was created/tokenized -- **Issuer**: Entity responsible for creating and managing the RWDA, needs to be linked to a Entity in ZAZ +- **Issuer**: Entity responsible for creating and managing the RWDA, needs to be linked to a Entity in ZDFZ #### 1.2. Media and Documentation - **Logo/Image**: Visual representation of the asset @@ -70,9 +70,9 @@ Real World Digital Assets (RWDAs) represent digitized ownership of real-world as - **Investor Qualification**: Requirements for investors (accreditation, KYC level, etc.) #### 3.3. Legal Framework -- **Governing Law**: Jurisdiction governing the asset (will normally be ZAZ) +- **Governing Law**: Jurisdiction governing the asset (will normally be ZDFZ) - **Regulatory Compliance**: Applicable regulations and compliance status (there should be a default) -- **Dispute Resolution**: Process for resolving disputes (ZAZ) +- **Dispute Resolution**: Process for resolving disputes (ZDFZ) - **Liability Limitations**: Extent of issuer and platform liability - **Termination Conditions**: Circumstances under which the RWDA can be terminated