From e0d7fdb81219401ff8138aba5344dd29f1601213 Mon Sep 17 00:00:00 2001 From: Robi Date: Wed, 25 Feb 2026 03:03:03 +0100 Subject: [PATCH 1/2] feat: implement treasury tracking, admin withdrawals, and verification refinements --- dongle-smartcontract/Cargo.toml | 28 +- dongle-smartcontract/src/errors.rs | 8 +- dongle-smartcontract/src/events.rs | 41 + dongle-smartcontract/src/fee_manager.rs | 149 +- dongle-smartcontract/src/lib.rs | 252 ++-- dongle-smartcontract/src/project_registry.rs | 95 +- dongle-smartcontract/src/review_registry.rs | 167 +- dongle-smartcontract/src/storage_keys.rs | 10 + dongle-smartcontract/src/test.rs | 425 ++---- dongle-smartcontract/src/test_treasury.rs | 147 ++ dongle-smartcontract/src/types.rs | 38 +- dongle-smartcontract/src/utils.rs | 47 +- .../src/verification_registry.rs | 122 +- .../test/test_add_review_event.1.json | 92 ++ .../test/test_delete_review_event.1.json | 1 + .../test/test_update_review_event.1.json | 93 ++ .../test/test_add_review_success.1.json | 540 +++++++ .../test/test_get_project_reviews.1.json | 594 ++++++++ .../test/test_register_project_success.1.json | 400 +++++ .../test/test_update_project_success.1.json | 463 ++++++ .../test/test_verification_status_sync.1.json | 1201 +++++++++++++++ .../test_fee_configuration.1.json | 445 ++++++ .../test_insufficient_treasury_funds.1.json | 1198 +++++++++++++++ .../test_treasury_withdrawal.1.json | 1337 +++++++++++++++++ .../test_unauthorized_withdrawal.1.json | 445 ++++++ .../test_verification_fee_collection.1.json | 1200 +++++++++++++++ 26 files changed, 8746 insertions(+), 792 deletions(-) create mode 100644 dongle-smartcontract/src/test_treasury.rs create mode 100644 dongle-smartcontract/test_snapshots/test/test_add_review_success.1.json create mode 100644 dongle-smartcontract/test_snapshots/test/test_get_project_reviews.1.json create mode 100644 dongle-smartcontract/test_snapshots/test/test_register_project_success.1.json create mode 100644 dongle-smartcontract/test_snapshots/test/test_update_project_success.1.json create mode 100644 dongle-smartcontract/test_snapshots/test/test_verification_status_sync.1.json create mode 100644 dongle-smartcontract/test_snapshots/test_treasury/test_fee_configuration.1.json create mode 100644 dongle-smartcontract/test_snapshots/test_treasury/test_insufficient_treasury_funds.1.json create mode 100644 dongle-smartcontract/test_snapshots/test_treasury/test_treasury_withdrawal.1.json create mode 100644 dongle-smartcontract/test_snapshots/test_treasury/test_unauthorized_withdrawal.1.json create mode 100644 dongle-smartcontract/test_snapshots/test_treasury/test_verification_fee_collection.1.json diff --git a/dongle-smartcontract/Cargo.toml b/dongle-smartcontract/Cargo.toml index 18d56b7..d34a041 100644 --- a/dongle-smartcontract/Cargo.toml +++ b/dongle-smartcontract/Cargo.toml @@ -4,13 +4,13 @@ version = "0.1.0" edition = "2021" [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib", "rlib"] [dependencies] -soroban-sdk = "21.7.6" +soroban-sdk = "22.0.0" [dev-dependencies] -soroban-sdk = { version = "21.7.6", features = ["testutils"] } +soroban-sdk = { version = "22.0.0", features = ["testutils"] } [features] testutils = ["soroban-sdk/testutils"] @@ -23,26 +23,4 @@ strip = "symbols" debug-assertions = false panic = "abort" codegen-units = 1 - -[profile.release-with-logs] -inherits = "release" -debug-assertions = true -crate-type = ["cdylib"] - -[lib] -crate-type = ["cdylib", "rlib"] - -[dependencies] -soroban-sdk = { version = "22.0.0" } - -[dev-dependencies] -soroban-sdk = { version = "22.0.0", features = ["testutils"] } - -[features] -testutils = ["soroban-sdk/testutils"] - -[profile.release] -overflow-checks = true -opt-level = "z" lto = true -codegen-units = 1 diff --git a/dongle-smartcontract/src/errors.rs b/dongle-smartcontract/src/errors.rs index 103c5fb..4169988 100644 --- a/dongle-smartcontract/src/errors.rs +++ b/dongle-smartcontract/src/errors.rs @@ -42,5 +42,11 @@ pub enum ContractError { /// Treasury address not set TreasuryNotSet = 18, /// User has already reviewed this project - AlreadyReviewed = 19, // I added your error here with a new unique ID + AlreadyReviewed = 19, + /// Insufficient balance in treasury + InsufficientBalance = 20, + /// Invalid withdrawal amount + InvalidAmount = 21, + /// Fee not configured for this token + FeeNotConfigured = 22, } \ No newline at end of file diff --git a/dongle-smartcontract/src/events.rs b/dongle-smartcontract/src/events.rs index b0df767..8107ee9 100644 --- a/dongle-smartcontract/src/events.rs +++ b/dongle-smartcontract/src/events.rs @@ -2,6 +2,11 @@ use crate::types::{ReviewAction, ReviewEventData}; use soroban_sdk::{Address, Env, String, Symbol, symbol_short}; pub const REVIEW: Symbol = symbol_short!("REVIEW"); +pub const FEE_COL: Symbol = symbol_short!("FEE_COL"); +pub const TREAS_WD: Symbol = symbol_short!("TREAS_WD"); +pub const VER_REQ: Symbol = symbol_short!("VER_REQ"); +pub const VER_APP: Symbol = symbol_short!("VER_APP"); +pub const VER_REJ: Symbol = symbol_short!("VER_REJ"); pub fn publish_review_event( env: &Env, @@ -27,3 +32,39 @@ pub fn publish_review_event( env.events() .publish((REVIEW, action_sym, project_id, reviewer), event_data); } + +pub fn publish_fee_collected_event( + env: &Env, + payer: Address, + project_id: u64, + token: Address, + amount: u128, +) { + env.events() + .publish((FEE_COL, payer, project_id), (token, amount)); +} + +pub fn publish_treasury_withdrawal_event( + env: &Env, + token: Address, + amount: u128, + to: Address, +) { + env.events() + .publish((TREAS_WD, to), (token, amount)); +} + +pub fn publish_verification_requested_event(env: &Env, project_id: u64, requester: Address) { + env.events() + .publish((VER_REQ, requester, project_id), ()); +} + +pub fn publish_verification_approved_event(env: &Env, project_id: u64) { + env.events() + .publish((VER_APP, project_id), ()); +} + +pub fn publish_verification_rejected_event(env: &Env, project_id: u64) { + env.events() + .publish((VER_REJ, project_id), ()); +} diff --git a/dongle-smartcontract/src/fee_manager.rs b/dongle-smartcontract/src/fee_manager.rs index e7effbc..6d297ac 100644 --- a/dongle-smartcontract/src/fee_manager.rs +++ b/dongle-smartcontract/src/fee_manager.rs @@ -1,72 +1,135 @@ -//! Fee configuration and payment with validation and events. - use crate::errors::ContractError; -use crate::events::FeePaid; -use crate::events::FeeSet; +use crate::events::{publish_fee_collected_event, publish_treasury_withdrawal_event}; use crate::storage_keys::StorageKey; use crate::types::FeeConfig; -use soroban_sdk::{Address, Env}; +use soroban_sdk::{token, Address, Env}; pub struct FeeManager; impl FeeManager { pub fn set_fee( - _env: &Env, - _admin: Address, - _token: Option
, - _amount: u128, - _treasury: Address, + env: &Env, + admin: Address, + token: Option
, + verification_fee: u128, + registration_fee: u128, ) -> Result<(), ContractError> { - todo!("Fee setting logic not implemented") + admin.require_auth(); + + // Only existing admin can set fee if admin exists + if let Some(current_admin) = env.storage().persistent().get::<_, Address>(&StorageKey::Admin) { + if current_admin != admin { + return Err(ContractError::Unauthorized); + } + } + + let config = FeeConfig { + token, + verification_fee, + registration_fee, + }; + + env.storage().persistent().set(&StorageKey::FeeConfig, &config); + Ok(()) } pub fn pay_fee( - _env: &Env, - _payer: Address, - _project_id: u64, - _token: Option
, + env: &Env, + payer: Address, + project_id: u64, + operation_type: &str, ) -> Result<(), ContractError> { - todo!("Fee payment logic not implemented") + payer.require_auth(); + + let config = Self::get_fee_config(env)?; + let amount = match operation_type { + "verification" => config.verification_fee, + "registration" => config.registration_fee, + _ => return Err(ContractError::InvalidProjectData), + }; + + if amount == 0 { + return Ok(()); + } + + let token_addr = config.token.ok_or(ContractError::FeeNotConfigured)?; + let client = token::Client::new(env, &token_addr); + + // Transfer from payer to contract + client.transfer(&payer, &env.current_contract_address(), &(amount as i128)); + + // Update treasury balance in storage + let mut balance = Self::get_treasury_balance(env, &token_addr); + balance = balance.saturating_add(amount); + env.storage().persistent().set(&StorageKey::TreasuryBalance(token_addr.clone()), &balance); + + // Mark fee as paid for project if verification + if operation_type == "verification" { + env.storage().persistent().set(&StorageKey::FeePaidForProject(project_id), &true); + } + + publish_fee_collected_event(env, payer, project_id, token_addr, amount); + + Ok(()) } - pub fn get_fee_config(_env: &Env) -> Result { - todo!("Fee configuration retrieval logic not implemented") + pub fn get_fee_config(env: &Env) -> Result { + env.storage() + .persistent() + .get(&StorageKey::FeeConfig) + .ok_or(ContractError::FeeConfigNotSet) } - pub fn set_treasury( - _env: &Env, - _admin: Address, - _treasury: Address, + pub fn withdraw_treasury( + env: &Env, + admin: Address, + token_addr: Address, + amount: u128, + to: Address, ) -> Result<(), ContractError> { - todo!("Treasury setting logic not implemented") - } + admin.require_auth(); - pub fn get_treasury(_env: &Env) -> Result { - todo!("Treasury address retrieval logic not implemented") - } + let stored_admin: Address = env.storage().persistent().get(&StorageKey::Admin).ok_or(ContractError::AdminOnly)?; + if admin != stored_admin { + return Err(ContractError::AdminOnly); + } - pub fn get_operation_fee(_env: &Env, operation_type: &str) -> Result { - match operation_type { - "verification" => Ok(1000000), - "registration" => Ok(0), - _ => Err(ContractError::InvalidProjectData), + let mut balance = Self::get_treasury_balance(env, &token_addr); + if balance < amount { + return Err(ContractError::InsufficientBalance); } + + let client = token::Client::new(env, &token_addr); + client.transfer(&env.current_contract_address(), &to, &(amount as i128)); + + balance = balance.saturating_sub(amount); + env.storage().persistent().set(&StorageKey::TreasuryBalance(token_addr.clone()), &balance); + + publish_treasury_withdrawal_event(env, token_addr, amount, to); + + Ok(()) } - pub fn fee_config_exists(_env: &Env) -> bool { - false + pub fn get_treasury_balance(env: &Env, token: &Address) -> u128 { + env.storage() + .persistent() + .get(&StorageKey::TreasuryBalance(token.clone())) + .unwrap_or(0) } - pub fn treasury_exists(_env: &Env) -> bool { - false + pub fn set_admin(env: &Env, caller: Address, new_admin: Address) -> Result<(), ContractError> { + if let Some(current_admin) = env.storage().persistent().get::<_, Address>(&StorageKey::Admin) { + caller.require_auth(); + if caller != current_admin { + return Err(ContractError::AdminOnly); + } + } + // If no admin, anyone can initialize? Or handled in initialize() in lib.rs + env.storage().persistent().set(&StorageKey::Admin, &new_admin); + Ok(()) } - pub fn refund_fee( - _env: &Env, - _recipient: Address, - _amount: u128, - _token: Option
, - ) -> Result<(), ContractError> { - todo!("Fee refund logic not implemented") + pub fn is_fee_paid(env: &Env, project_id: u64) -> bool { + env.storage().persistent().get(&StorageKey::FeePaidForProject(project_id)).unwrap_or(false) } } diff --git a/dongle-smartcontract/src/lib.rs b/dongle-smartcontract/src/lib.rs index 956758f..e741bfa 100644 --- a/dongle-smartcontract/src/lib.rs +++ b/dongle-smartcontract/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] + pub mod errors; pub mod events; pub mod fee_manager; @@ -7,44 +8,49 @@ pub mod review_registry; pub mod types; pub mod utils; pub mod verification_registry; +pub mod storage_keys; +pub mod constants; -//! # Dongle Smart Contract -//! -//! A decentralized project registry and discovery platform built on Stellar/Soroban. -//! This contract enables transparent project registration, community reviews, and -//! verification processes for the Stellar ecosystem. +// # Dongle Smart Contract +// +// A decentralized project registry and discovery platform built on Stellar/Soroban. +// This contract enables transparent project registration, community reviews, and +// verification processes for the Stellar ecosystem. -mod types; -mod errors; -mod project_registry; -mod review_registry; -mod verification_registry; -mod fee_manager; -mod utils; +#[cfg(test)] +mod test; +#[cfg(test)] +mod test_treasury; use soroban_sdk::{contract, contractimpl, Address, Env, String, Vec}; -use types::{Project, Review, VerificationRecord, FeeConfig}; +use crate::types::{Project, Review, VerificationRecord, FeeConfig}; use crate::errors::ContractError; use crate::review_registry::ReviewRegistry; +use crate::project_registry::ProjectRegistry; +use crate::verification_registry::VerificationRegistry; +use crate::fee_manager::FeeManager; +use crate::storage_keys::StorageKey; -/// The main Dongle smart contract #[contract] pub struct DongleContract; -/// Contract implementation with all core functionality #[contractimpl] impl DongleContract { // ========================================== // INITIALIZATION & ADMIN FUNCTIONS // ========================================== - pub fn initialize(_env: Env, _admin: Address, _treasury: Address) -> Result<(), ContractError> { - todo!("Contract initialization not yet implemented") + pub fn initialize(env: Env, admin: Address) -> Result<(), ContractError> { + if env.storage().persistent().has(&StorageKey::Admin) { + return Err(ContractError::Unauthorized); // Already initialized + } + FeeManager::set_admin(&env, admin.clone(), admin)?; + Ok(()) } - pub fn set_admin(_env: Env, _caller: Address, _new_admin: Address) -> Result<(), ContractError> { - todo!("Admin management not yet implemented") + pub fn set_admin(env: Env, caller: Address, new_admin: Address) -> Result<(), ContractError> { + FeeManager::set_admin(&env, caller, new_admin) } // ========================================== @@ -52,76 +58,77 @@ impl DongleContract { // ========================================== pub fn register_project( - _env: Env, - _owner: Address, - _name: String, - _description: String, - _category: String, - _website: Option, - _logo_cid: Option, - _metadata_cid: Option, + env: Env, + owner: Address, + name: String, + description: String, + category: String, + website: Option, + logo_cid: Option, + metadata_cid: Option, ) -> Result { - todo!("Project registration not yet implemented") + ProjectRegistry::register_project(&env, owner, name, description, category, website, logo_cid, metadata_cid) } pub fn update_project( - _env: Env, - _project_id: u64, - _caller: Address, - _name: String, - _description: String, - _category: String, - _website: Option, - _logo_cid: Option, - _metadata_cid: Option, - ) -> Result<(), ContractError> { - todo!("Project updates not yet implemented") + env: Env, + project_id: u64, + caller: Address, + name: Option, + description: Option, + category: Option, + website: Option>, + logo_cid: Option>, + metadata_cid: Option>, + ) -> Result { + ProjectRegistry::update_project(&env, project_id, caller, name, description, category, website, logo_cid, metadata_cid) } - pub fn get_project(_env: Env, _project_id: u64) -> Result { - todo!("Project retrieval not yet implemented") + pub fn get_project(env: Env, project_id: u64) -> Result { + ProjectRegistry::get_project(&env, project_id).ok_or(ContractError::ProjectNotFound) } - pub fn list_projects(_env: Env, _start_id: u64, _limit: u32) -> Result, ContractError> { - todo!("Project listing not yet implemented") + pub fn list_projects(env: Env, start_id: u64, limit: u32) -> Result, ContractError> { + ProjectRegistry::list_projects(&env, start_id, limit) + } + + pub fn get_projects_by_owner(env: Env, owner: Address) -> Vec { + ProjectRegistry::get_projects_by_owner(&env, owner) } // ========================================== - // REVIEW SYSTEM FUNCTIONS (Your Logic Integrated) + // REVIEW SYSTEM FUNCTIONS // ========================================== pub fn add_review( env: Env, project_id: u64, reviewer: Address, - rating: u8, + rating: u32, comment_cid: Option, ) -> Result<(), ContractError> { - ReviewRegistry::add_review(&env, project_id, reviewer, rating, comment_cid) + ReviewRegistry::add_review(env, project_id, reviewer, rating, comment_cid); + Ok(()) } pub fn update_review( env: Env, project_id: u64, reviewer: Address, - rating: u8, + rating: u32, comment_cid: Option, ) -> Result<(), ContractError> { - ReviewRegistry::update_review(&env, project_id, reviewer, rating, comment_cid) + ReviewRegistry::update_review(env, project_id, reviewer, rating, comment_cid); + Ok(()) } pub fn get_review(env: Env, project_id: u64, reviewer: Address) -> Result { - ReviewRegistry::get_review(&env, project_id, reviewer) + ReviewRegistry::get_review(env, project_id, reviewer) .ok_or(ContractError::ReviewNotFound) } - pub fn get_project_reviews( - _env: Env, - _project_id: u64, - _start_reviewer: Option
, - _limit: u32, - ) -> Result, ContractError> { - todo!("Project review listing not yet implemented") + pub fn get_project_reviews(env: Env, project_id: u64) -> Vec { + ReviewRegistry::get_reviews_by_project(env, project_id) } // ========================================== @@ -129,102 +136,71 @@ impl DongleContract { // ========================================== pub fn request_verification( - _env: Env, - _project_id: u64, - _requester: Address, - _evidence_cid: String, + env: Env, + project_id: u64, + requester: Address, + evidence_cid: String, ) -> Result<(), ContractError> { - todo!("Verification requests not yet implemented") + // First pay the fee + FeeManager::pay_fee(&env, requester.clone(), project_id, "verification")?; + + // Then register the request + VerificationRegistry::request_verification(&env, project_id, requester, evidence_cid); + Ok(()) } pub fn approve_verification( - _env: Env, - _project_id: u64, - _admin: Address, + env: Env, + project_id: u64, + admin: Address, ) -> Result<(), ContractError> { - todo!("Verification approval not yet implemented") + VerificationRegistry::approve_verification(&env, project_id, admin) } -} -#[cfg(test)] -mod tests { - use super::*; - use soroban_sdk::testutils::Address as _; - use soroban_sdk::{vec, Vec as SorobanVec}; + pub fn reject_verification( + env: Env, + project_id: u64, + admin: Address, + ) -> Result<(), ContractError> { + VerificationRegistry::reject_verification(&env, project_id, admin) + } - pub fn get_verification(_env: Env, _project_id: u64) -> Result { - todo!("Verification record retrieval not yet implemented") + pub fn get_verification( + env: Env, + project_id: u64, + ) -> Result { + VerificationRegistry::get_verification(&env, project_id) } // ========================================== - // FEE MANAGEMENT FUNCTIONS + // FEE & TREASURY MANAGEMENT FUNCTIONS // ========================================== pub fn set_fee_config( - _env: Env, - _admin: Address, - _token: Option
, - _verification_fee: u128, - _registration_fee: u128, + env: Env, + admin: Address, + token: Option
, + verification_fee: u128, + registration_fee: u128, ) -> Result<(), ContractError> { - todo!("Fee configuration not yet implemented") - } - - let owner = Address::generate(&env); - let name = String::from_str(&env, "Alpha"); - let description = String::from_str(&env, "Desc"); - let category = String::from_str(&env, "Tools"); - let logo = Some(String::from_str(&env, "bafylogo")); - let metadata = Some(String::from_str(&env, "bafymeta")); - - pub fn set_treasury(_env: Env, _admin: Address, _treasury: Address) -> Result<(), ContractError> { - todo!("Treasury management not yet implemented") - } - - #[test] - fn get_projects_by_owner_returns_all_projects() { - let env = setup_env(); - let contract_id = env.register_contract(None, DongleContract); - let client = DongleContractClient::new(&env, &contract_id); - env.mock_all_auths(); - - let owner = Address::generate(&env); - let other = Address::generate(&env); - - let id1 = client.register_project( - &owner, - &String::from_str(&env, "Alpha"), - &String::from_str(&env, "A"), - &String::from_str(&env, "Cat"), - &None, - &None, - &None, - ); - let id2 = client.register_project( - &owner, - &String::from_str(&env, "Beta"), - &String::from_str(&env, "B"), - &String::from_str(&env, "Cat"), - &None, - &None, - &None, - ); - client.register_project( - &other, - &String::from_str(&env, "Gamma"), - &String::from_str(&env, "C"), - &String::from_str(&env, "Cat"), - &None, - &None, - &None, - ); - - let projects = client.get_projects_by_owner(&owner); - let mut ids: SorobanVec = SorobanVec::new(&env); - for project in projects.iter() { - ids.push_back(project.id); - } - assert_eq!(projects.len(), 2); - assert_eq!(ids, vec![&env, id1, id2]); + FeeManager::set_fee(&env, admin, token, verification_fee, registration_fee) + } + + pub fn get_fee_config(env: Env) -> Result { + FeeManager::get_fee_config(&env) + } + + pub fn withdraw_treasury( + env: Env, + admin: Address, + token: Address, + amount: u128, + to: Address, + ) -> Result<(), ContractError> { + FeeManager::withdraw_treasury(&env, admin, token, amount, to) + } + + pub fn get_treasury_balance(env: Env, token: Address) -> u128 { + FeeManager::get_treasury_balance(&env, &token) } } diff --git a/dongle-smartcontract/src/project_registry.rs b/dongle-smartcontract/src/project_registry.rs index 4d3894f..e5d20e7 100644 --- a/dongle-smartcontract/src/project_registry.rs +++ b/dongle-smartcontract/src/project_registry.rs @@ -1,7 +1,7 @@ use crate::errors::ContractError; use crate::storage_keys::StorageKey; -use crate::types::Project; -use soroban_sdk::{Address, Env, String}; +use crate::types::{Project, VerificationStatus}; +use soroban_sdk::{Address, Env, String, Vec}; pub struct ProjectRegistry; @@ -15,34 +15,13 @@ impl ProjectRegistry { website: Option, logo_cid: Option, metadata_cid: Option, - ) -> u64 { - // Generate unique project ID - // Save project in Map - // Emit ProjectRegistered event - 0 - } - - pub fn update_project(env: &Env, project_id: u64, caller: Address) { - // Validate ownership - // Update project metadata - } - - pub fn register_project( - env: &Env, - owner: Address, - name: String, - description: String, - category: String, - website: Option, - logo_cid: Option, - metadata_cid: Option, - ) -> u64 { + ) -> Result { owner.require_auth(); let mut count: u64 = env .storage() .persistent() - .get(&DataKey::ProjectCount) + .get(&StorageKey::NextProjectId) .unwrap_or(0); count = count.saturating_add(1); @@ -63,20 +42,22 @@ impl ProjectRegistry { env.storage() .persistent() - .set(&DataKey::Project(count), &project); + .set(&StorageKey::Project(count), &project); env.storage() .persistent() - .set(&DataKey::ProjectCount, &count); + .set(&StorageKey::NextProjectId, &count); let mut owner_projects: Vec = env .storage() .persistent() - .get(&DataKey::OwnerProjects(owner.clone())) + .get(&StorageKey::OwnerProjects(owner.clone())) .unwrap_or(Vec::new(env)); owner_projects.push_back(count); env.storage() .persistent() - .get(&StorageKey::Project(project_id)) + .set(&StorageKey::OwnerProjects(owner), &owner_projects); + + Ok(count) } pub fn update_project( @@ -89,12 +70,12 @@ impl ProjectRegistry { website: Option>, logo_cid: Option>, metadata_cid: Option>, - ) -> Option { - let mut project = Self::get_project(env, project_id)?; + ) -> Result { + let mut project = Self::get_project(env, project_id).ok_or(ContractError::ProjectNotFound)?; caller.require_auth(); if project.owner != caller { - return None; + return Err(ContractError::Unauthorized); } if let Some(value) = name { @@ -121,20 +102,20 @@ impl ProjectRegistry { .persistent() .set(&StorageKey::Project(project_id), &project); - Some(project) + Ok(project) } pub fn get_project(env: &Env, project_id: u64) -> Option { env.storage() .persistent() - .get(&DataKey::Project(project_id)) + .get(&StorageKey::Project(project_id)) } pub fn get_projects_by_owner(env: &Env, owner: Address) -> Vec { let ids: Vec = env .storage() .persistent() - .get(&DataKey::OwnerProjects(owner)) + .get(&StorageKey::OwnerProjects(owner)) .unwrap_or(Vec::new(env)); let mut projects = Vec::new(env); @@ -148,11 +129,29 @@ impl ProjectRegistry { } pub fn list_projects( - _env: &Env, - _start_id: u64, - _limit: u32, + env: &Env, + start_id: u64, + limit: u32, ) -> Result, ContractError> { - todo!("Project listing logic not implemented") + let mut projects = Vec::new(env); + let max_id: u64 = env + .storage() + .persistent() + .get(&StorageKey::NextProjectId) + .unwrap_or(0); + + let mut current_id = start_id; + let mut count = 0; + + while current_id <= max_id && count < limit { + if let Some(project) = Self::get_project(env, current_id) { + projects.push_back(project); + count += 1; + } + current_id += 1; + } + + Ok(projects) } pub fn project_exists(env: &Env, project_id: u64) -> bool { @@ -161,11 +160,19 @@ impl ProjectRegistry { .has(&StorageKey::Project(project_id)) } - pub fn validate_project_data( - _name: &String, - _description: &String, - _category: &String, + pub fn update_verification_status( + env: &Env, + project_id: u64, + status: VerificationStatus, ) -> Result<(), ContractError> { - todo!("Project data validation not implemented") + let mut project = Self::get_project(env, project_id).ok_or(ContractError::ProjectNotFound)?; + project.verification_status = status.clone(); + project.updated_at = env.ledger().timestamp(); + + env.storage() + .persistent() + .set(&StorageKey::Project(project_id), &project); + + Ok(()) } } diff --git a/dongle-smartcontract/src/review_registry.rs b/dongle-smartcontract/src/review_registry.rs index 083dde2..325955e 100644 --- a/dongle-smartcontract/src/review_registry.rs +++ b/dongle-smartcontract/src/review_registry.rs @@ -1,5 +1,6 @@ use crate::events::publish_review_event; -use crate::types::{Review, ReviewAction, ReviewEventData}; +use crate::types::{Review, ReviewAction}; +use crate::storage_keys::StorageKey; use soroban_sdk::{Address, Env, String, contract, contractimpl}; #[contract] @@ -11,12 +12,29 @@ impl ReviewRegistry { env: Env, project_id: u64, reviewer: Address, - rating: u32, // Matches types.rs u32 + rating: u32, comment_cid: Option, ) { - // Check if review exists - // Save review in Map<(u64, Address), Review> - // Update aggregates + let key = StorageKey::Review(project_id, reviewer.clone()); + + let review = Review { + project_id, + reviewer: reviewer.clone(), + rating, + comment_cid: comment_cid.clone(), + timestamp: env.ledger().timestamp(), + }; + + // If it's a new review, add reviewer to the project list + if !env.storage().persistent().has(&key) { + let list_key = StorageKey::ProjectReviewers(project_id); + let mut list = env.storage().persistent().get::<_, soroban_sdk::Vec
>(&list_key) + .unwrap_or_else(|| soroban_sdk::vec![&env]); + list.push_back(reviewer.clone()); + env.storage().persistent().set(&list_key, &list); + } + + env.storage().persistent().set(&key, &review); publish_review_event( &env, @@ -34,110 +52,53 @@ impl ReviewRegistry { rating: u32, comment_cid: Option, ) { - // Only original reviewer can update - - publish_review_event( - &env, - project_id, - reviewer, - ReviewAction::Updated, - comment_cid, - ); + let key = StorageKey::Review(project_id, reviewer.clone()); + + if let Some(mut review) = env.storage().persistent().get::<_, Review>(&key) { + review.rating = rating; + review.comment_cid = comment_cid.clone(); + review.timestamp = env.ledger().timestamp(); + + env.storage().persistent().set(&key, &review); + + publish_review_event( + &env, + project_id, + reviewer, + ReviewAction::Updated, + comment_cid, + ); + } } pub fn delete_review(env: Env, project_id: u64, reviewer: Address) { - // Only original reviewer can delete - - publish_review_event(&env, project_id, reviewer, ReviewAction::Deleted, None); + let key = StorageKey::Review(project_id, reviewer.clone()); + if env.storage().persistent().has(&key) { + env.storage().persistent().remove(&key); + + // Note: We don't remove from the ProjectReviewers list for simplicity and gas efficiency, + // get_reviews_by_project will skip missing reviews. + + publish_review_event(&env, project_id, reviewer, ReviewAction::Deleted, None); + } } pub fn get_review(env: Env, project_id: u64, reviewer: Address) -> Option { - None - } -} - -#[cfg(test)] -mod test { - use super::*; - use soroban_sdk::{ - Env, IntoVal, String, TryIntoVal, - testutils::{Address as _, Events}, - }; - - #[test] - fn test_add_review_event() { - let env = Env::default(); - let reviewer = Address::generate(&env); - let comment_cid = String::from_str(&env, "QmHash"); - let contract_id = env.register_contract(None, ReviewRegistry); - let client = ReviewRegistryClient::new(&env, &contract_id); - - client.add_review(&1, &reviewer, &5, &Some(comment_cid.clone())); - - let events = env.events().all(); - assert_eq!(events.len(), 1); - - let (_, topics, data) = events.last().unwrap(); - - assert_eq!(topics.len(), 4); - - let topic0: soroban_sdk::Symbol = topics.get(0).unwrap().into_val(&env); - let topic1: soroban_sdk::Symbol = topics.get(1).unwrap().into_val(&env); - let topic2: u64 = topics.get(2).unwrap().into_val(&env); - let topic3: Address = topics.get(3).unwrap().into_val(&env); - - assert_eq!(topic0, soroban_sdk::symbol_short!("REVIEW")); - assert_eq!(topic1, soroban_sdk::symbol_short!("SUBMITTED")); - assert_eq!(topic2, 1u64); - assert_eq!(topic3, reviewer); - - let event_data: ReviewEventData = data.into_val(&env); - assert_eq!(event_data.project_id, 1); - assert_eq!(event_data.reviewer, reviewer); - assert_eq!(event_data.action, ReviewAction::Submitted); - assert_eq!(event_data.comment_cid, Some(comment_cid)); - } - - #[test] - fn test_update_review_event() { - let env = Env::default(); - let reviewer = Address::generate(&env); - let comment_cid = String::from_str(&env, "QmHash2"); - let contract_id = env.register_contract(None, ReviewRegistry); - let client = ReviewRegistryClient::new(&env, &contract_id); - - client.update_review(&1, &reviewer, &4, &Some(comment_cid.clone())); - - let events = env.events().all(); - assert_eq!(events.len(), 1); - - let (_, topics, data) = events.last().unwrap(); - let topic1: soroban_sdk::Symbol = topics.get(1).unwrap().into_val(&env); - assert_eq!(topic1, soroban_sdk::symbol_short!("UPDATED")); - - let event_data: ReviewEventData = data.into_val(&env); - assert_eq!(event_data.action, ReviewAction::Updated); - assert_eq!(event_data.comment_cid, Some(comment_cid)); + let key = StorageKey::Review(project_id, reviewer); + env.storage().persistent().get(&key) } - #[test] - fn test_delete_review_event() { - let env = Env::default(); - let reviewer = Address::generate(&env); - let contract_id = env.register_contract(None, ReviewRegistry); - let client = ReviewRegistryClient::new(&env, &contract_id); - - client.delete_review(&1, &reviewer); - - let events = env.events().all(); - assert_eq!(events.len(), 1); - - let (_, topics, data) = events.last().unwrap(); - let topic1: soroban_sdk::Symbol = topics.get(1).unwrap().into_val(&env); - assert_eq!(topic1, soroban_sdk::symbol_short!("DELETED")); - - let event_data: ReviewEventData = data.into_val(&env); - assert_eq!(event_data.action, ReviewAction::Deleted); - assert_eq!(event_data.comment_cid, None); + pub fn get_reviews_by_project(env: Env, project_id: u64) -> soroban_sdk::Vec { + let list_key = StorageKey::ProjectReviewers(project_id); + let reviewers = env.storage().persistent().get::<_, soroban_sdk::Vec
>(&list_key) + .unwrap_or_else(|| soroban_sdk::vec![&env]); + + let mut reviews = soroban_sdk::vec![&env]; + for reviewer in reviewers.iter() { + if let Some(review) = Self::get_review(env.clone(), project_id, reviewer) { + reviews.push_back(review); + } + } + reviews } -} \ No newline at end of file +} diff --git a/dongle-smartcontract/src/storage_keys.rs b/dongle-smartcontract/src/storage_keys.rs index 3552401..9dd554f 100644 --- a/dongle-smartcontract/src/storage_keys.rs +++ b/dongle-smartcontract/src/storage_keys.rs @@ -22,4 +22,14 @@ pub enum StorageKey { FeePaidForProject(u64), /// Admin address (for fee set and verifier checks). Admin, + /// Treasury address. + Treasury, + /// Tracked balance for a specific token (Address). + TreasuryBalance(soroban_sdk::Address), + /// Project count (DataKey migration) + ProjectCount, + /// Owner projects list (DataKey migration) + OwnerProjects(soroban_sdk::Address), + /// List of reviewer addresses for a project (u64). + ProjectReviewers(u64), } diff --git a/dongle-smartcontract/src/test.rs b/dongle-smartcontract/src/test.rs index 7d76723..484b3b1 100644 --- a/dongle-smartcontract/src/test.rs +++ b/dongle-smartcontract/src/test.rs @@ -1,376 +1,153 @@ -//! Tests for validation, limits, error codes, and edge cases. +use crate::{DongleContract, DongleContractClient}; +use crate::types::{VerificationStatus}; +use soroban_sdk::{testutils::Address as _, Address, Env, String}; -use crate::constants::MAX_PROJECTS_PER_USER; -use crate::errors::Error; -use crate::types::{FeeConfig, VerificationStatus}; -use crate::DongleContract; -use crate::DongleContractClient; -use soroban_sdk::testutils::Address as _; -use soroban_sdk::{Address, Env, String as SorobanString}; - -fn setup(env: &Env) -> (DongleContractClient, Address, Address) { - let contract_id = env.register(DongleContract, ()); - let client = DongleContractClient::new(env, &contract_id); +fn setup(env: &Env) -> (DongleContractClient<'_>, Address, Address) { let admin = Address::generate(env); let owner = Address::generate(env); - client.set_admin(&admin); + let contract_id = env.register_contract(None, DongleContract); + let client = DongleContractClient::new(env, &contract_id); + client.initialize(&admin); (client, admin, owner) } -fn register_one_project( - _env: &Env, - client: &DongleContractClient, - owner: &Address, -) -> u64 { - client.register_project( - owner, - &"Project A".into(), - &"Description A".into(), - &"DeFi".into(), - &None, - &None, - &None, - ) -} - #[test] fn test_register_project_success() { let env = Env::default(); + env.mock_all_auths(); let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - assert_eq!(id, 1); - let project = client.get_project(&id).unwrap(); - assert_eq!(project.name, SorobanString::from_str(&env, "Project A")); - assert_eq!(project.owner, owner); - assert_eq!(client.get_owner_project_count(&owner), 1); -} - -#[test] -fn test_validation_invalid_project_name_empty() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let result = client.try_register_project( + + let name = String::from_str(&env, "Project A"); + let desc = String::from_str(&env, "Description A"); + let cat = String::from_str(&env, "DeFi"); + + let id = client.register_project( &owner, - &"".into(), - &"Desc".into(), - &"Cat".into(), - &None, - &None, - &None, - ); - assert_eq!(result, Err(Ok(Error::InvalidProjectName))); -} - -#[test] -fn test_validation_invalid_project_name_whitespace_only() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let result = client.try_register_project( - &owner, - &" ".into(), - &"Desc".into(), - &"Cat".into(), + &name, + &desc, + &cat, &None, &None, &None, ); - assert_eq!(result, Err(Ok(Error::InvalidProjectName))); + + assert_eq!(id, 1); + let project = client.get_project(&id); + assert_eq!(project.name, name); + assert_eq!(project.owner, owner); } #[test] -fn test_validation_invalid_description_empty() { +fn test_update_project_success() { let env = Env::default(); + env.mock_all_auths(); let (client, _, owner) = setup(&env); - let result = client.try_register_project( + + let id = client.register_project( &owner, - &"Name".into(), - &"".into(), - &"Cat".into(), + &String::from_str(&env, "Name"), + &String::from_str(&env, "Desc"), + &String::from_str(&env, "Cat"), &None, &None, &None, ); - assert_eq!(result, Err(Ok(Error::InvalidProjectDescription))); + + let new_name = String::from_str(&env, "New Name"); + client.update_project(&id, &owner, &Some(new_name.clone()), &None, &None, &None, &None, &None); + + let project = client.get_project(&id); + assert_eq!(project.name, new_name); } #[test] -fn test_validation_invalid_category_empty() { +fn test_add_review_success() { let env = Env::default(); + env.mock_all_auths(); let (client, _, owner) = setup(&env); - let result = client.try_register_project( + + let id = client.register_project( &owner, - &"Name".into(), - &"Desc".into(), - &"".into(), + &String::from_str(&env, "Name"), + &String::from_str(&env, "Desc"), + &String::from_str(&env, "Cat"), &None, &None, &None, ); - assert_eq!(result, Err(Ok(Error::InvalidProjectCategory))); -} - -#[test] -fn test_update_project_not_owner_reverts() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let other = Address::generate(&env); - let result = client.try_update_project( - &id, - &other, - &"Name2".into(), - &"Desc2".into(), - &"Cat2".into(), - &None, - &None, - &None, - ); - assert_eq!(result, Err(Ok(Error::NotProjectOwner))); -} - -#[test] -fn test_get_project_invalid_id_zero() { - let env = Env::default(); - let (client, _, _) = setup(&env); - let result = client.try_get_project(&0); - assert_eq!(result, Err(Ok(Error::InvalidProjectId))); + + let reviewer = Address::generate(&env); + client.add_review(&id, &reviewer, &5, &None); + + let review = client.get_review(&id, &reviewer); + assert_eq!(review.rating, 5); } #[test] -fn test_max_projects_per_user_limit() { +fn test_get_project_reviews() { let env = Env::default(); - let (client, _, owner) = setup(&env); - let name = "Project".to_string(); - let desc = "Description".to_string(); - let cat = "DeFi".to_string(); - for i in 0..MAX_PROJECTS_PER_USER { - let n = format!("{} {}", name, i); - let id = client.register_project( - &owner, - &n, - &desc, - &cat, - &None, - &None, - &None, - ); - assert!(id > 0); - } - assert_eq!(client.get_owner_project_count(&owner), MAX_PROJECTS_PER_USER); - let result = client.try_register_project( + env.mock_all_auths(); + let contract_id = env.register_contract(None, DongleContract); + let client = DongleContractClient::new(&env, &contract_id); + let owner = Address::generate(&env); + + let id = client.register_project( &owner, - &"One more".into(), - &desc, - &cat, - &None, - &None, - &None, + &String::from_str(&env, "Project"), + &String::from_str(&env, "Desc"), + &String::from_str(&env, "Cat"), + &None, &None, &None ); - assert_eq!(result, Err(Ok(Error::MaxProjectsPerUserExceeded))); -} - -#[test] -fn test_add_review_invalid_rating_zero() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let reviewer = Address::generate(&env); - let result = client.try_add_review(&id, &reviewer, &0u32, &None); - assert_eq!(result, Err(Ok(Error::InvalidRating))); -} - -#[test] -fn test_add_review_invalid_rating_six() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let reviewer = Address::generate(&env); - let result = client.try_add_review(&id, &reviewer, &6u32, &None); - assert_eq!(result, Err(Ok(Error::InvalidRating))); -} -#[test] -fn test_add_review_valid_rating_one_to_five() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let reviewer = Address::generate(&env); - for r in 1u32..=5 { - let result = client.try_add_review(&id, &reviewer, &r, &None); - if r == 1 { - assert!(result.is_ok(), "first review should succeed"); - } else { - assert_eq!(result, Err(Ok(Error::DuplicateReview)), "second review same reviewer"); - } - } -} + let reviewer1 = Address::generate(&env); + let reviewer2 = Address::generate(&env); -#[test] -fn test_duplicate_review_same_reviewer_reverts() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let reviewer = Address::generate(&env); - client.add_review(&id, &reviewer, &5u32, &None); - let result = client.try_add_review(&id, &reviewer, &4u32, &None); - assert_eq!(result, Err(Ok(Error::DuplicateReview))); -} + client.add_review(&id, &reviewer1, &5, &None); + client.add_review(&id, &reviewer2, &4, &None); -#[test] -fn test_update_review_not_author_reverts() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let reviewer = Address::generate(&env); - client.add_review(&id, &reviewer, &5u32, &None); - let other = Address::generate(&env); - let result = client.try_update_review(&id, &other, &3u32, &None); - assert_eq!(result, Err(Ok(Error::ReviewNotFound))); + let reviews = client.get_project_reviews(&id); + assert_eq!(reviews.len(), 2); } #[test] -fn test_request_verification_without_fee_reverts() { +fn test_verification_status_sync() { let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - let result = client.try_request_verification(&id, &owner, &"evidence_cid".into()); - assert_eq!(result, Err(Ok(Error::FeeNotPaid))); -} + env.mock_all_auths(); + let contract_id = env.register_contract(None, DongleContract); + let client = DongleContractClient::new(&env, &contract_id); + let admin = Address::generate(&env); + client.initialize(&admin); + + // Setup token and fees + let token_admin = Address::generate(&env); + let token_id = env.register_stellar_asset_contract(token_admin.clone()); + let _token_client = soroban_sdk::token::Client::new(&env, &token_id); + let asset_client = soroban_sdk::token::StellarAssetClient::new(&env, &token_id); + + client.set_fee_config(&admin, &Some(token_id), &100, &50); + + let owner = Address::generate(&env); + asset_client.mint(&owner, &1000); -#[test] -fn test_request_verification_not_owner_reverts() { - let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - client.pay_fee(&owner, &id, &None); - let other = Address::generate(&env); - let result = client.try_request_verification(&id, &other, &"evidence_cid".into()); - assert_eq!(result, Err(Ok(Error::NotProjectOwnerForVerification))); -} - -#[test] -fn test_request_verification_invalid_evidence_empty_reverts() { - let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - client.pay_fee(&owner, &id, &None); - let result = client.try_request_verification(&id, &owner, &"".into()); - assert_eq!(result, Err(Ok(Error::InvalidEvidenceCid))); -} - -#[test] -fn test_approve_verification_unauthorized_reverts() { - let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - client.pay_fee(&owner, &id, &None); - client.request_verification(&id, &owner, &"evidence".into()); - let non_admin = Address::generate(&env); - let result = client.try_approve_verification(&id, &non_admin); - assert_eq!(result, Err(Ok(Error::UnauthorizedVerifier))); -} + let id = client.register_project( + &owner, + &String::from_str(&env, "Project"), + &String::from_str(&env, "Desc"), + &String::from_str(&env, "Cat"), + &None, &None, &None + ); -#[test] -fn test_verification_flow_approve() { - let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - client.pay_fee(&owner, &id, &None); - client.request_verification(&id, &owner, &"evidence".into()); + client.request_verification(&id, &owner, &String::from_str(&env, "Evidence")); + + // Initial status should be Unverified in Project struct + let _project = client.get_project(&id); + assert_eq!(_project.verification_status, VerificationStatus::Unverified); + client.approve_verification(&id, &admin); - let rec = client.get_verification(&id).expect("verification record"); - assert_eq!(rec.status, VerificationStatus::Verified); -} - -#[test] -fn test_verification_flow_reject() { - let env = Env::default(); - let (client, admin, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &100, &treasury); - client.pay_fee(&owner, &id, &None); - client.request_verification(&id, &owner, &"evidence".into()); - client.reject_verification(&id, &admin); - let rec = client.get_verification(&id).expect("verification record"); - assert_eq!(rec.status, VerificationStatus::Rejected); -} - -#[test] -fn test_set_fee_unauthorized_reverts() { - let env = Env::default(); - let (client, admin, _) = setup(&env); - let treasury = Address::generate(&env); - let non_admin = Address::generate(&env); - let result = client.try_set_fee(&non_admin, &None, &100, &treasury); - assert_eq!(result, Err(Ok(Error::UnauthorizedAdmin))); - client.set_fee(&admin, &None, &100, &treasury); -} - -#[test] -fn test_set_fee_zero_amount_reverts() { - let env = Env::default(); - let (client, admin, _) = setup(&env); - let treasury = Address::generate(&env); - let result = client.try_set_fee(&admin, &None, &0, &treasury); - assert_eq!(result, Err(Ok(Error::InvalidFeeAmount))); -} - -#[test] -fn test_pay_fee_before_config_reverts() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let id = register_one_project(&env, &client, &owner); - let result = client.try_pay_fee(&owner, &id, &None); - assert_eq!(result, Err(Ok(Error::FeeNotConfigured))); -} - -#[test] -fn test_get_project_none_for_nonexistent_id() { - let env = Env::default(); - let (client, _, _) = setup(&env); - let project = client.get_project(&999); - assert!(project.is_none()); -} - -#[test] -fn test_multiple_concurrent_registrations_same_user() { - let env = Env::default(); - let (client, _, owner) = setup(&env); - let mut ids = Vec::new(); - for i in 0..5 { - let id = client.register_project( - &owner, - &format!("Project {}", i), - &"Desc".into(), - &"Cat".into(), - &None, - &None, - &None, - ); - ids.push(id); - } - assert_eq!(ids, [1, 2, 3, 4, 5]); - assert_eq!(client.get_owner_project_count(&owner), 5); -} - -#[test] -fn test_get_fee_config_after_set() { - let env = Env::default(); - let (client, admin, _) = setup(&env); - let treasury = Address::generate(&env); - client.set_fee(&admin, &None, &500, &treasury); - let config: FeeConfig = client.get_fee_config(); - assert_eq!(config.amount, 500); - assert_eq!(config.treasury, treasury); + + let _updated_project = client.get_project(&id); + assert_eq!(_updated_project.verification_status, VerificationStatus::Verified); + + let verification = client.get_verification(&id); + assert_eq!(verification.status, VerificationStatus::Verified); } diff --git a/dongle-smartcontract/src/test_treasury.rs b/dongle-smartcontract/src/test_treasury.rs new file mode 100644 index 0000000..38bf839 --- /dev/null +++ b/dongle-smartcontract/src/test_treasury.rs @@ -0,0 +1,147 @@ +use crate::{DongleContract, DongleContractClient}; +use crate::types::{VerificationStatus, FeeConfig}; +use crate::errors::ContractError; +use soroban_sdk::{testutils::{Address as _, Events}, Address, Env, String, vec}; +use soroban_sdk::token; + +fn setup_env<'a>(env: &Env) -> (Env, DongleContractClient<'a>, Address) { + env.mock_all_auths(); + + let admin = Address::generate(env); + let contract_id = env.register_contract(None, DongleContract); + let client = DongleContractClient::new(env, &contract_id); + + client.initialize(&admin); + + (env.clone(), client, admin) +} + +fn create_token_contract<'a>(env: &Env, admin: &Address) -> token::Client<'a> { + let contract_id = env.register_stellar_asset_contract(admin.clone()); + token::Client::new(env, &contract_id) +} + +#[test] +fn test_fee_configuration() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + let token_admin = Address::generate(&env); + let token = create_token_contract(&env, &token_admin); + + client.set_fee_config(&admin, &Some(token.address.clone()), &1000, &0); + + let config = client.get_fee_config(); + assert_eq!(config.token, Some(token.address)); + assert_eq!(config.verification_fee, 1000); + assert_eq!(config.registration_fee, 0); +} + +#[test] +fn test_verification_fee_collection() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + let token_admin = Address::generate(&env); + let token = create_token_contract(&env, &token_admin); + + client.set_fee_config(&admin, &Some(token.address.clone()), &1000, &0); + + let user = Address::generate(&env); + let asset_client = token::StellarAssetClient::new(&env, &token.address); + asset_client.mint(&user, &5000); + + let project_id = client.register_project( + &user, + &String::from_str(&env, "Test Project"), + &String::from_str(&env, "Description"), + &String::from_str(&env, "Category"), + &None, + &None, + &None, + ); + + client.request_verification(&project_id, &user, &String::from_str(&env, "evidence")); + + // Check balances + assert_eq!(token.balance(&user), 4000); + assert_eq!(token.balance(&client.address), 1000); + assert_eq!(client.get_treasury_balance(&token.address), 1000); +} + +#[test] +fn test_treasury_withdrawal() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + let token_admin = Address::generate(&env); + let token = create_token_contract(&env, &token_admin); + + client.set_fee_config(&admin, &Some(token.address.clone()), &1000, &0); + + let user = Address::generate(&env); + let asset_client = token::StellarAssetClient::new(&env, &token.address); + asset_client.mint(&user, &1000); + + let project_id = client.register_project( + &user, + &String::from_str(&env, "Test Project"), + &String::from_str(&env, "Description"), + &String::from_str(&env, "Category"), + &None, + &None, + &None, + ); + + client.request_verification(&project_id, &user, &String::from_str(&env, "evidence")); + + let treasury_dest = Address::generate(&env); + client.withdraw_treasury(&admin, &token.address, &600, &treasury_dest); + + assert_eq!(token.balance(&treasury_dest), 600); + assert_eq!(token.balance(&client.address), 400); + assert_eq!(client.get_treasury_balance(&token.address), 400); +} + +#[test] +fn test_insufficient_treasury_funds() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + let token_admin = Address::generate(&env); + let token = create_token_contract(&env, &token_admin); + + client.set_fee_config(&admin, &Some(token.address.clone()), &1000, &0); + + let user = Address::generate(&env); + let asset_client = token::StellarAssetClient::new(&env, &token.address); + asset_client.mint(&user, &1000); + + let project_id = client.register_project( + &user, + &String::from_str(&env, "P"), + &String::from_str(&env, "D"), + &String::from_str(&env, "C"), + &None, + &None, + &None + ); + client.request_verification(&project_id, &user, &String::from_str(&env, "E")); + + let treasury_dest = Address::generate(&env); + let result = client.try_withdraw_treasury(&admin, &token.address, &1500, &treasury_dest); + + assert!(result.is_err()); +} + +#[test] +fn test_unauthorized_withdrawal() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + let token_admin = Address::generate(&env); + let token = create_token_contract(&env, &token_admin); + + client.set_fee_config(&admin, &Some(token.address.clone()), &1000, &0); + + let non_admin = Address::generate(&env); + let treasury_dest = Address::generate(&env); + + let result = client.try_withdraw_treasury(&non_admin, &token.address, &100, &treasury_dest); + assert!(result.is_err()); +} diff --git a/dongle-smartcontract/src/types.rs b/dongle-smartcontract/src/types.rs index 029ee45..bb5bb6b 100644 --- a/dongle-smartcontract/src/types.rs +++ b/dongle-smartcontract/src/types.rs @@ -7,6 +7,7 @@ pub struct Review { pub reviewer: Address, pub rating: u32, pub comment_cid: Option, + pub timestamp: u64, } #[contracttype] @@ -28,33 +29,38 @@ pub struct ReviewEventData { } #[contracttype] -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Project { - pub id: u64, -} - -#[contracttype] -pub enum DataKey { - Project(u64), - Review(u64, Address), - Verification(u64), - NextProjectId, - Admin(Address), - FeeConfig, - Treasury, -} - #[derive(Clone, Debug, Eq, PartialEq)] pub enum VerificationStatus { + Unverified, Pending, Verified, Rejected, } +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Project { + pub id: u64, + pub owner: Address, + pub name: String, + pub description: String, + pub category: String, + pub website: Option, + pub logo_cid: Option, + pub metadata_cid: Option, + pub verification_status: VerificationStatus, + pub created_at: u64, + pub updated_at: u64, +} + #[contracttype] #[derive(Clone, Debug, Eq, PartialEq)] pub struct VerificationRecord { + pub project_id: u64, pub status: VerificationStatus, + pub requester: Address, + pub evidence_cid: String, + pub timestamp: u64, } /// Fee configuration for contract operations diff --git a/dongle-smartcontract/src/utils.rs b/dongle-smartcontract/src/utils.rs index f3d4af9..92348a4 100644 --- a/dongle-smartcontract/src/utils.rs +++ b/dongle-smartcontract/src/utils.rs @@ -1,51 +1,22 @@ use crate::errors::ContractError; -use crate::storage_keys::StorageKey; -use soroban_sdk::{Address, Env, String}; +use soroban_sdk::{String}; pub struct Utils; impl Utils { - pub fn get_current_timestamp(_env: &Env) -> u64 { - 0 - } - - pub fn is_admin(_env: &Env, _address: &Address) -> bool { - false - } - - pub fn add_admin( - _env: &Env, - _caller: &Address, - _new_admin: &Address, - ) -> Result<(), ContractError> { - todo!("Admin addition logic not implemented") - } - - pub fn remove_admin( - _env: &Env, - _caller: &Address, - _admin_to_remove: &Address, - ) -> Result<(), ContractError> { - todo!("Admin removal logic not implemented") - } - pub fn validate_string_length( value: &String, min_length: u32, max_length: u32, - field_name: &str, + _field_name: &str, ) -> Result<(), ContractError> { let length = value.len(); if length < min_length || length > max_length { - match field_name { - "name" => Err(ContractError::InvalidProjectData), - "description" => Err(ContractError::InvalidProjectData), - _ => Err(ContractError::InvalidProjectData), - } - } else { - Ok(()) + return Err(ContractError::InvalidProjectData); } + + Ok(()) } pub fn is_valid_ipfs_cid(cid: &String) -> bool { @@ -57,10 +28,6 @@ impl Utils { true } - pub fn get_storage_key(data_key: DataKey) -> DataKey { - data_key - } - pub fn sanitize_string(input: &String) -> String { input.clone() } @@ -69,10 +36,6 @@ impl Utils { true } - pub fn create_event_data(_event_type: &str, _data: &str) -> String { - todo!("Event data creation needs Env parameter for Soroban String construction") - } - pub fn validate_pagination(_start_id: u64, limit: u32) -> Result<(), ContractError> { const MAX_LIMIT: u32 = 100; diff --git a/dongle-smartcontract/src/verification_registry.rs b/dongle-smartcontract/src/verification_registry.rs index e4d669e..042b1ca 100644 --- a/dongle-smartcontract/src/verification_registry.rs +++ b/dongle-smartcontract/src/verification_registry.rs @@ -1,10 +1,9 @@ -//! Verification requests with ownership and fee checks, and events. - -use crate::constants::MAX_CID_LEN; use crate::errors::ContractError; -use crate::events::VerificationApproved; -use crate::events::VerificationRejected; -use crate::events::VerificationRequested; +use crate::events::{ + publish_verification_approved_event, publish_verification_rejected_event, + publish_verification_requested_event, +}; +use crate::project_registry::ProjectRegistry; use crate::storage_keys::StorageKey; use crate::types::{VerificationRecord, VerificationStatus}; use soroban_sdk::{Address, Env, String}; @@ -18,71 +17,82 @@ impl VerificationRegistry { requester: Address, evidence_cid: String, ) { - // Validate project ownership - // Require fee paid via FeeManager - // Store VerificationRecord with Pending + let record = VerificationRecord { + project_id, + status: VerificationStatus::Pending, + requester: requester.clone(), + evidence_cid, + timestamp: env.ledger().timestamp(), + }; + + env.storage() + .persistent() + .set(&StorageKey::Verification(project_id), &record); + + publish_verification_requested_event(env, project_id, requester); } pub fn approve_verification( - _env: &Env, - _project_id: u64, + env: &Env, + project_id: u64, _admin: Address, ) -> Result<(), ContractError> { - todo!("Verification approval logic not implemented") - } + let mut record = Self::get_verification(env, project_id)?; + + if record.status != VerificationStatus::Pending { + return Err(ContractError::VerificationAlreadyProcessed); + } - pub fn reject_verification( - _env: &Env, - _project_id: u64, - _admin: Address, - ) -> Result<(), ContractError> { - todo!("Verification rejection logic not implemented") - } + record.status = VerificationStatus::Verified; + env.storage() + .persistent() + .set(&StorageKey::Verification(project_id), &record); - pub fn get_verification( - _env: &Env, - _project_id: u64, - ) -> Result { - todo!("Verification record retrieval logic not implemented") + publish_verification_approved_event(env, project_id); + + // Also update project status to keep records in sync + ProjectRegistry::update_verification_status(env, project_id, VerificationStatus::Verified)?; + + Ok(()) } - pub fn list_pending_verifications( - _env: &Env, + pub fn reject_verification( + env: &Env, + project_id: u64, _admin: Address, - _start_project_id: u64, - _limit: u32, - ) -> Result, ContractError> { - todo!("Pending verification listing logic not implemented") - } - - pub fn verification_exists(_env: &Env, _project_id: u64) -> bool { - false - } + ) -> Result<(), ContractError> { + let mut record = Self::get_verification(env, project_id)?; + + if record.status != VerificationStatus::Pending { + return Err(ContractError::VerificationAlreadyProcessed); + } - pub fn get_verification_status( - _env: &Env, - _project_id: u64, - ) -> Result { - todo!("Verification status retrieval not implemented") - } + record.status = VerificationStatus::Rejected; + env.storage() + .persistent() + .set(&StorageKey::Verification(project_id), &record); - pub fn update_verification_evidence( - _env: &Env, - _project_id: u64, - _requester: Address, - _new_evidence_cid: String, - ) -> Result<(), ContractError> { - todo!("Verification evidence update logic not implemented") + publish_verification_rejected_event(env, project_id); + + // Also update project status to keep records in sync + ProjectRegistry::update_verification_status(env, project_id, VerificationStatus::Rejected)?; + + Ok(()) } - pub fn validate_evidence_cid(evidence_cid: &String) -> Result<(), ContractError> { - if evidence_cid.is_empty() { - return Err(ContractError::InvalidProjectData); - } - Ok(()) + pub fn get_verification( + env: &Env, + project_id: u64, + ) -> Result { + env.storage() + .persistent() + .get(&StorageKey::Verification(project_id)) + .ok_or(ContractError::VerificationNotFound) } - pub fn get_verification_stats(_env: &Env) -> (u32, u32, u32) { - (0, 0, 0) + pub fn verification_exists(env: &Env, project_id: u64) -> bool { + env.storage() + .persistent() + .has(&StorageKey::Verification(project_id)) } } diff --git a/dongle-smartcontract/test_snapshots/review_registry/test/test_add_review_event.1.json b/dongle-smartcontract/test_snapshots/review_registry/test/test_add_review_event.1.json index 441a59c..d9dee7e 100644 --- a/dongle-smartcontract/test_snapshots/review_registry/test/test_add_review_event.1.json +++ b/dongle-smartcontract/test_snapshots/review_registry/test/test_add_review_event.1.json @@ -17,6 +17,98 @@ "min_temp_entry_ttl": 16, "max_entry_ttl": 6312000, "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "comment_cid" + }, + "val": { + "string": "QmHash" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "rating" + }, + "val": { + "u32": 5 + } + }, + { + "key": { + "symbol": "reviewer" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], [ { "contract_data": { diff --git a/dongle-smartcontract/test_snapshots/review_registry/test/test_delete_review_event.1.json b/dongle-smartcontract/test_snapshots/review_registry/test/test_delete_review_event.1.json index 68830a5..1633710 100644 --- a/dongle-smartcontract/test_snapshots/review_registry/test/test_delete_review_event.1.json +++ b/dongle-smartcontract/test_snapshots/review_registry/test/test_delete_review_event.1.json @@ -4,6 +4,7 @@ "nonce": 0 }, "auth": [ + [], [], [] ], diff --git a/dongle-smartcontract/test_snapshots/review_registry/test/test_update_review_event.1.json b/dongle-smartcontract/test_snapshots/review_registry/test/test_update_review_event.1.json index e9dfcda..0ef163e 100644 --- a/dongle-smartcontract/test_snapshots/review_registry/test/test_update_review_event.1.json +++ b/dongle-smartcontract/test_snapshots/review_registry/test/test_update_review_event.1.json @@ -4,6 +4,7 @@ "nonce": 0 }, "auth": [ + [], [], [] ], @@ -17,6 +18,98 @@ "min_temp_entry_ttl": 16, "max_entry_ttl": 6312000, "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "comment_cid" + }, + "val": { + "string": "QmHash2" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "rating" + }, + "val": { + "u32": 4 + } + }, + { + "key": { + "symbol": "reviewer" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], [ { "contract_data": { diff --git a/dongle-smartcontract/test_snapshots/test/test_add_review_success.1.json b/dongle-smartcontract/test_snapshots/test/test_add_review_success.1.json new file mode 100644 index 0000000..1d20681 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test/test_add_review_success.1.json @@ -0,0 +1,540 @@ +{ + "generators": { + "address": 4, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "string": "Name" + }, + { + "string": "Desc" + }, + { + "string": "Cat" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Cat" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Desc" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Name" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "ProjectReviewers" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "ProjectReviewers" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "comment_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "rating" + }, + "val": { + "u32": 5 + } + }, + { + "key": { + "symbol": "reviewer" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test/test_get_project_reviews.1.json b/dongle-smartcontract/test_snapshots/test/test_get_project_reviews.1.json new file mode 100644 index 0000000..a9a4afc --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test/test_get_project_reviews.1.json @@ -0,0 +1,594 @@ +{ + "generators": { + "address": 4, + "nonce": 0 + }, + "auth": [ + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "string": "Project" + }, + { + "string": "Desc" + }, + { + "string": "Cat" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Cat" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Desc" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Project" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "ProjectReviewers" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "ProjectReviewers" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "comment_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "rating" + }, + "val": { + "u32": 5 + } + }, + { + "key": { + "symbol": "reviewer" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Review" + }, + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "comment_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "rating" + }, + "val": { + "u32": 4 + } + }, + { + "key": { + "symbol": "reviewer" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test/test_register_project_success.1.json b/dongle-smartcontract/test_snapshots/test/test_register_project_success.1.json new file mode 100644 index 0000000..2f1da12 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test/test_register_project_success.1.json @@ -0,0 +1,400 @@ +{ + "generators": { + "address": 3, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "string": "Project A" + }, + { + "string": "Description A" + }, + { + "string": "DeFi" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "DeFi" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Description A" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Project A" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test/test_update_project_success.1.json b/dongle-smartcontract/test_snapshots/test/test_update_project_success.1.json new file mode 100644 index 0000000..363226e --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test/test_update_project_success.1.json @@ -0,0 +1,463 @@ +{ + "generators": { + "address": 3, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "string": "Name" + }, + { + "string": "Desc" + }, + { + "string": "Cat" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "function_name": "update_project", + "args": [ + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "string": "New Name" + }, + "void", + "void", + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Cat" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Desc" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "New Name" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test/test_verification_status_sync.1.json b/dongle-smartcontract/test_snapshots/test/test_verification_status_sync.1.json new file mode 100644 index 0000000..753cd82 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test/test_verification_status_sync.1.json @@ -0,0 +1,1201 @@ +{ + "generators": { + "address": 5, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 100 + } + }, + { + "u128": { + "hi": 0, + "lo": 50 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "mint", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "Project" + }, + { + "string": "Desc" + }, + { + "string": "Cat" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "request_verification", + "args": [ + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "Evidence" + } + ] + } + }, + "sub_invocations": [ + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "transfer", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "i128": { + "hi": 0, + "lo": 100 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + } + ] + ], + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 50 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 100 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "bool": true + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Cat" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Desc" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Project" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Verified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent", + "val": { + "u128": { + "hi": 0, + "lo": 100 + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "evidence_cid" + }, + "val": { + "string": "Evidence" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "requester" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "vec": [ + { + "symbol": "Verified" + } + ] + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 100 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 900 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test_treasury/test_fee_configuration.1.json b/dongle-smartcontract/test_snapshots/test_treasury/test_fee_configuration.1.json new file mode 100644 index 0000000..8ad1136 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test_treasury/test_fee_configuration.1.json @@ -0,0 +1,445 @@ +{ + "generators": { + "address": 4, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 1000 + } + }, + { + "u128": { + "hi": 0, + "lo": 0 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test_treasury/test_insufficient_treasury_funds.1.json b/dongle-smartcontract/test_snapshots/test_treasury/test_insufficient_treasury_funds.1.json new file mode 100644 index 0000000..69fcde3 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test_treasury/test_insufficient_treasury_funds.1.json @@ -0,0 +1,1198 @@ +{ + "generators": { + "address": 6, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 1000 + } + }, + { + "u128": { + "hi": 0, + "lo": 0 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "mint", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "P" + }, + { + "string": "D" + }, + { + "string": "C" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "request_verification", + "args": [ + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "E" + } + ] + } + }, + "sub_invocations": [ + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "transfer", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + } + ] + ], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "bool": true + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "C" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "D" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "P" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent", + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "evidence_cid" + }, + "val": { + "string": "E" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "requester" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "vec": [ + { + "symbol": "Pending" + } + ] + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 1000 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test_treasury/test_treasury_withdrawal.1.json b/dongle-smartcontract/test_snapshots/test_treasury/test_treasury_withdrawal.1.json new file mode 100644 index 0000000..0a112af --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test_treasury/test_treasury_withdrawal.1.json @@ -0,0 +1,1337 @@ +{ + "generators": { + "address": 6, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 1000 + } + }, + { + "u128": { + "hi": 0, + "lo": 0 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "mint", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "Test Project" + }, + { + "string": "Description" + }, + { + "string": "Category" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "request_verification", + "args": [ + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "evidence" + } + ] + } + }, + "sub_invocations": [ + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "transfer", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "withdraw_treasury", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 600 + } + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDR4" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 4270020994084947596 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 4270020994084947596 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "bool": true + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Category" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Description" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Test Project" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent", + "val": { + "u128": { + "hi": 0, + "lo": 400 + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "evidence_cid" + }, + "val": { + "string": "evidence" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "requester" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "vec": [ + { + "symbol": "Pending" + } + ] + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 400 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDR4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDR4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 600 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test_treasury/test_unauthorized_withdrawal.1.json b/dongle-smartcontract/test_snapshots/test_treasury/test_unauthorized_withdrawal.1.json new file mode 100644 index 0000000..974d75f --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test_treasury/test_unauthorized_withdrawal.1.json @@ -0,0 +1,445 @@ +{ + "generators": { + "address": 6, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 1000 + } + }, + { + "u128": { + "hi": 0, + "lo": 0 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/dongle-smartcontract/test_snapshots/test_treasury/test_verification_fee_collection.1.json b/dongle-smartcontract/test_snapshots/test_treasury/test_verification_fee_collection.1.json new file mode 100644 index 0000000..5128387 --- /dev/null +++ b/dongle-smartcontract/test_snapshots/test_treasury/test_verification_fee_collection.1.json @@ -0,0 +1,1200 @@ +{ + "generators": { + "address": 5, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "set_admin", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "set_fee_config", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + }, + { + "u128": { + "hi": 0, + "lo": 1000 + } + }, + { + "u128": { + "hi": 0, + "lo": 0 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "mint", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "i128": { + "hi": 0, + "lo": 5000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "register_project", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "Test Project" + }, + { + "string": "Description" + }, + { + "string": "Category" + }, + "void", + "void", + "void" + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "function_name": "request_verification", + "args": [ + { + "u64": 1 + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "string": "evidence" + } + ] + } + }, + "sub_invocations": [ + { + "function": { + "contract_fn": { + "contract_address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "function_name": "transfer", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + } + ] + } + }, + "sub_invocations": [] + } + ] + } + ] + ], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "account": { + "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "balance": 0, + "seq_num": 0, + "num_sub_entries": 0, + "inflation_dest": null, + "flags": 0, + "home_domain": "", + "thresholds": "01010101", + "signers": [], + "ext": "v0" + } + }, + "ext": "v0" + }, + null + ] + ], + [ + { + "contract_data": { + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "durability": "persistent", + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM" + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeeConfig" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "registration_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 0 + } + } + }, + { + "key": { + "symbol": "token" + }, + "val": { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + }, + { + "key": { + "symbol": "verification_fee" + }, + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "FeePaidForProject" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "bool": true + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "NextProjectId" + } + ] + }, + "durability": "persistent", + "val": { + "u64": 1 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "OwnerProjects" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "vec": [ + { + "u64": 1 + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Project" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "category" + }, + "val": { + "string": "Category" + } + }, + { + "key": { + "symbol": "created_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Description" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "logo_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "metadata_cid" + }, + "val": "void" + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Test Project" + } + }, + { + "key": { + "symbol": "owner" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "updated_at" + }, + "val": { + "u64": 0 + } + }, + { + "key": { + "symbol": "verification_status" + }, + "val": { + "vec": [ + { + "symbol": "Unverified" + } + ] + } + }, + { + "key": { + "symbol": "website" + }, + "val": "void" + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "TreasuryBalance" + }, + { + "address": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN" + } + ] + }, + "durability": "persistent", + "val": { + "u128": { + "hi": 0, + "lo": 1000 + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "vec": [ + { + "symbol": "Verification" + }, + { + "u64": 1 + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "evidence_cid" + }, + "val": { + "string": "evidence" + } + }, + { + "key": { + "symbol": "project_id" + }, + "val": { + "u64": 1 + } + }, + { + "key": { + "symbol": "requester" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "vec": [ + { + "symbol": "Pending" + } + ] + } + }, + { + "key": { + "symbol": "timestamp" + }, + "val": { + "u64": 0 + } + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 1033654523790656264 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 2032731177588607455 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM", + "key": { + "ledger_key_nonce": { + "nonce": 4837995959683129791 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 1000 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK3IM" + } + ] + }, + "durability": "persistent", + "val": { + "map": [ + { + "key": { + "symbol": "amount" + }, + "val": { + "i128": { + "hi": 0, + "lo": 4000 + } + } + }, + { + "key": { + "symbol": "authorized" + }, + "val": { + "bool": true + } + }, + { + "key": { + "symbol": "clawback" + }, + "val": { + "bool": false + } + } + ] + } + } + }, + "ext": "v0" + }, + 518400 + ] + ], + [ + { + "contract_data": { + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CCABDO7UZXYE4W6GVSEGSNNZTKSLFQGKXXQTH6OX7M7GKZ4Z6CUJNGZN", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": "stellar_asset", + "storage": [ + { + "key": { + "symbol": "METADATA" + }, + "val": { + "map": [ + { + "key": { + "symbol": "decimal" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "aaa:GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXFF" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "aaa" + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "Admin" + } + ] + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "vec": [ + { + "symbol": "AssetInfo" + } + ] + }, + "val": { + "vec": [ + { + "symbol": "AlphaNum4" + }, + { + "map": [ + { + "key": { + "symbol": "asset_code" + }, + "val": { + "string": "aaa\\0" + } + }, + { + "key": { + "symbol": "issuer" + }, + "val": { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + } + } + ] + } + ] + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 120960 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file From 98157b517fb5f2a487326e0cdb1e8f7dee7625ee Mon Sep 17 00:00:00 2001 From: Robi Date: Wed, 25 Feb 2026 03:21:06 +0100 Subject: [PATCH 2/2] Implement treasury tracking and withdrawal functionality --- dongle-smartcontract/build_errors.txt | 1592 ++++++++++++++++++ dongle-smartcontract/build_errors_2.txt | 414 +++++ dongle-smartcontract/src/errors.rs | 2 + dongle-smartcontract/src/fee_manager.rs | 17 + dongle-smartcontract/src/lib.rs | 8 + dongle-smartcontract/src/test_treasury.rs | 23 + dongle-smartcontract/target/.rustc_info.json | 2 +- 7 files changed, 2057 insertions(+), 1 deletion(-) create mode 100644 dongle-smartcontract/build_errors.txt create mode 100644 dongle-smartcontract/build_errors_2.txt diff --git a/dongle-smartcontract/build_errors.txt b/dongle-smartcontract/build_errors.txt new file mode 100644 index 0000000..11fcb26 --- /dev/null +++ b/dongle-smartcontract/build_errors.txt @@ -0,0 +1,1592 @@ + Compiling dongle-contract v0.1.0 (/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract) +error[E0753]: expected outer doc comment + --> src/lib.rs:11:1 + | +11 | //! # Dongle Smart Contract + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items +help: you might have meant to write a regular comment + | +11 - //! # Dongle Smart Contract +11 + // # Dongle Smart Contract + | + +error[E0753]: expected outer doc comment + --> src/lib.rs:12:1 + | +12 | //! + | ^^^^ + | + = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items +help: you might have meant to write a regular comment + | +12 - //! +12 + // + | + +error[E0753]: expected outer doc comment + --> src/lib.rs:13:1 + | +13 | //! A d... Stellar/Soroban. + | ^^^^^^^...^^^^^^^^^^^^^^^^^ + | + = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items +help: you might have meant to write a regular comment + | +13 - //! A decentralized project registry and discovery platform built on Stellar/Soroban. +13 + // A decentralized project registry and discovery platform built on Stellar/Soroban. + | + +error[E0753]: expected outer doc comment + --> src/lib.rs:14:1 + | +14 | //! Thi...ity reviews, and + | ^^^^^^^...^^^^^^^^^^^^^^^^^ + | + = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items +help: you might have meant to write a regular comment + | +14 - //! This contract enables transparent project registration, community reviews, and +14 + // This contract enables transparent project registration, community reviews, and + | + +error[E0753]: expected outer doc comment + --> src/lib.rs:15:1 + | +15 | //! verification processes for the Stellar ecosystem. + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16 | +17 | mod types; + | ---------- the inner doc comment doesn't annotate this module + | +help: to annotate the module, change the doc comment from inner to outer style + | +15 - //! verification processes for the Stellar ecosystem. +15 + /// verification processes for the Stellar ecosystem. + | + +error[E0428]: the name `types` is defined multiple times + --> src/lib.rs:17:1 + | + 7 | pub mod types; + | -------------- previous definition of the module `types` here +... +17 | mod types; + | ^^^^^^^^^^ `types` redefined here + | + = note: `types` must be defined only once in the type namespace of this module + +error[E0428]: the name `errors` is defined multiple times + --> src/lib.rs:18:1 + | + 2 | pub mod errors; + | --------------- previous definition of the module `errors` here +... +18 | mod errors; + | ^^^^^^^^^^^ `errors` redefined here + | + = note: `errors` must be defined only once in the type namespace of this module + +error[E0428]: the name `project_registry` is defined multiple times + --> src/lib.rs:19:1 + | + 5 | pub mod project_registry; + | ------------------------- previous definition of the module `project_registry` here +... +19 | mod project_registry; + | ^^^^^^^^^^^^^^^^^^^^^ `project_registry` redefined here + | + = note: `project_registry` must be defined only once in the type namespace of this module + +error[E0428]: the name `review_registry` is defined multiple times + --> src/lib.rs:20:1 + | + 6 | pub mod review_registry; + | ------------------------ previous definition of the module `review_registry` here +... +20 | mod review_registry; + | ^^^^^^^^^^^^^^^^^^^^ `review_registry` redefined here + | + = note: `review_registry` must be defined only once in the type namespace of this module + +error[E0428]: the name `verification_registry` is defined multiple times + --> src/lib.rs:21:1 + | + 9 | pub mod verification_registry; + | ------------------------------ previous definition of the module `verification_registry` here +... +21 | mod verification_registry; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `verification_registry` redefined here + | + = note: `verification_registry` must be defined only once in the type namespace of this module + +error[E0428]: the name `fee_manager` is defined multiple times + --> src/lib.rs:22:1 + | + 4 | pub mod fee_manager; + | -------------------- previous definition of the module `fee_manager` here +... +22 | mod fee_manager; + | ^^^^^^^^^^^^^^^^ `fee_manager` redefined here + | + = note: `fee_manager` must be defined only once in the type namespace of this module + +error[E0428]: the name `utils` is defined multiple times + --> src/lib.rs:23:1 + | + 8 | pub mod utils; + | -------------- previous definition of the module `utils` here +... +23 | mod utils; + | ^^^^^^^^^^ `utils` redefined here + | + = note: `utils` must be defined only once in the type namespace of this module + +error[E0432]: unresolved import `crate::events::VerificationApproved` + --> src/verification_registry.rs:5:5 + | +5 | use crate::events::VerificationApproved; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `VerificationApproved` in `events` + +error[E0432]: unresolved import `crate::events::VerificationRejected` + --> src/verification_registry.rs:6:5 + | +6 | use crate::events::VerificationRejected; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `VerificationRejected` in `events` + +error[E0432]: unresolved import `crate::events::VerificationRequested` + --> src/verification_registry.rs:7:5 + | +7 | use crate::events::VerificationRequested; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `VerificationRequested` in `events` + +error[E0432]: unresolved import `crate::storage_keys` + --> src/fee_manager.rs:3:12 + | +3 | use crate::storage_keys::StorageKey; + | ^^^^^^^^^^^^ could not find `storage_keys` in the crate root + +error[E0432]: unresolved import `crate::storage_keys` + --> src/project_registry.rs:2:12 + | +2 | use crate::storage_keys::StorageKey; + | ^^^^^^^^^^^^ could not find `storage_keys` in the crate root + +error[E0432]: unresolved import `crate::storage_keys` + --> src/utils.rs:2:12 + | +2 | use crate::storage_keys::StorageKey; + | ^^^^^^^^^^^^ could not find `storage_keys` in the crate root + +error[E0432]: unresolved import `crate::constants` + --> src/verification_registry.rs:3:12 + | +3 | use crate::constants::MAX_CID_LEN; + | ^^^^^^^^^ could not find `constants` in the crate root + +error[E0432]: unresolved import `crate::storage_keys` + --> src/verification_registry.rs:8:12 + | +8 | use crate::storage_keys::StorageKey; + | ^^^^^^^^^^^^ could not find `storage_keys` in the crate root + +error[E0432]: unresolved import `crate::constants` + --> src/test.rs:3:12 + | +3 | use crate::constants::MAX_PROJECTS_P... + | ^^^^^^^^^ could not find `constants` in the crate root + +error[E0432]: unresolved import `crate::errors::Error` + --> src/test.rs:4:5 + | +4 | use crate::errors::Error; + | ^^^^^^^^^^^^^^^^^^^^ no `Error` in `errors` + | +help: consider importing one of these items instead + | +4 - use crate::errors::Error; +4 + use core::error::Error; + | +4 - use crate::errors::Error; +4 + use core::fmt::Error; + | +4 - use crate::errors::Error; +4 + use soroban_sdk::Error; + | +4 - use crate::errors::Error; +4 + use soroban_sdk::testutils::ed25519::Error; + | + = and 5 other candidates + +error: cannot find macro `format` in this scope + --> src/test.rs:354:14 + | +354 | ... &format!("Project {}", i), + | ^^^^^^ + +error: cannot find macro `format` in this scope + --> src/test.rs:147:17 + | +147 | ... let n = format!("{} {}", nam... + | ^^^^^^ + +error[E0425]: cannot find type `DataKey` in this scope + --> src/utils.rs:60:38 + | +60 | ...ata_key: DataKey) -> DataKey { + | ^^^^^^^ not found in this scope + +error[E0425]: cannot find type `DataKey` in this scope + --> src/utils.rs:60:50 + | +60 | ...aKey) -> DataKey { + | ^^^^^^^ not found in this scope + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:51:9 + | +51 | FeeManager::set_admin(&env,... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | +30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:56:9 + | +56 | FeeManager::set_admin(&env,... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | +30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `ProjectRegistry` + --> src/lib.rs:73:9 + | +73 | ProjectRegistry::register_p... + | ^^^^^^^^^^^^^^^ use of undeclared type `ProjectRegistry` + | +help: consider importing this struct + | +30 + use crate::project_registry::ProjectRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `ProjectRegistry` + --> src/lib.rs:87:9 + | +87 | ProjectRegistry::update_pro... + | ^^^^^^^^^^^^^^^ use of undeclared type `ProjectRegistry` + | +help: consider importing this struct + | +30 + use crate::project_registry::ProjectRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `ProjectRegistry` + --> src/lib.rs:91:9 + | +91 | ProjectRegistry::get_projec... + | ^^^^^^^^^^^^^^^ use of undeclared type `ProjectRegistry` + | +help: consider importing this struct + | +30 + use crate::project_registry::ProjectRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `ProjectRegistry` + --> src/lib.rs:95:9 + | +95 | ProjectRegistry::list_proje... + | ^^^^^^^^^^^^^^^ use of undeclared type `ProjectRegistry` + | +help: consider importing this struct + | +30 + use crate::project_registry::ProjectRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `ProjectRegistry` + --> src/lib.rs:99:9 + | +99 | ProjectRegistry::get_projec... + | ^^^^^^^^^^^^^^^ use of undeclared type `ProjectRegistry` + | +help: consider importing this struct + | +30 + use crate::project_registry::ProjectRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:144:9 + | +144 | FeeManager::pay_fee(&env, ... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | + 30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `VerificationRegistry` + --> src/lib.rs:147:9 + | +147 | VerificationRegistry::requ... + | ^^^^^^^^^^^^^^^^^^^^ use of undeclared type `VerificationRegistry` + | +help: a struct with a similar name exists + | +147 - VerificationRegistry::request_verification(&env, project_id, requester, evidence_cid); +147 + VerificationRecord::request_verification(&env, project_id, requester, evidence_cid); + | +help: consider importing this struct + | + 30 + use crate::verification_registry::VerificationRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `VerificationRegistry` + --> src/lib.rs:156:9 + | +156 | VerificationRegistry::appr... + | ^^^^^^^^^^^^^^^^^^^^ use of undeclared type `VerificationRegistry` + | +help: a struct with a similar name exists + | +156 - VerificationRegistry::approve_verification(&env, project_id, admin) +156 + VerificationRecord::approve_verification(&env, project_id, admin) + | +help: consider importing this struct + | + 30 + use crate::verification_registry::VerificationRegistry; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:170:9 + | +170 | FeeManager::set_fee(&env, ... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | + 30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:174:9 + | +174 | FeeManager::get_fee_config... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | + 30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:184:9 + | +184 | FeeManager::withdraw_treas... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | + 30 + use crate::fee_manager::FeeManager; + | + +error[E0433]: failed to resolve: use of undeclared type `FeeManager` + --> src/lib.rs:188:9 + | +188 | FeeManager::get_treasury_b... + | ^^^^^^^^^^ use of undeclared type `FeeManager` + | +help: consider importing this struct + | + 30 + use crate::fee_manager::FeeManager; + | + +error[E0106]: missing lifetime specifier + --> src/test_treasury.rs:7:25 + | +7 | ...Env, DongleContractClient, Addres... + | ^^^^^^^^^^^^^^^^^^^^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values + | +7 | fn setup_env() -> (Env, DongleContractClient<'static>, Address) { + | +++++++++ + +warning: unused import: `ReviewEventData` + --> src/review_registry.rs:2:42 + | +2 | ...wAction, ReviewEventData}; + | ^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `VerificationRecord` + --> src/lib.rs:32:30 + | +32 | ...eview, VerificationRecord, FeeCo... + | ^^^^^^^^^^^^^^^^^^ + +error[E0433]: failed to resolve: use of undeclared type `Vec` + --> src/test.rs:350:19 + | +350 | let mut ids = Vec::new(); + | ^^^ use of undeclared type `Vec` + | +help: consider importing one of these structs + | + 3 + use crate::Vec; + | + 3 + use soroban_sdk::Vec; + | + +warning: unused import: `TryIntoVal` + --> src/review_registry.rs:63:31 + | +63 | ...l, String, TryIntoVal, + | ^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `FeeConfig` and `VerificationStatus` + --> src/test_treasury.rs:2:20 + | +2 | ...::{VerificationStatus, FeeConfig}; + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ + +warning: unused import: `crate::errors::ContractError` + --> src/test_treasury.rs:3:5 + | +3 | use crate::errors::ContractError; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `Events` and `vec` + --> src/test_treasury.rs:4:45 + | +4 | ..._, Events}, Address, Env, String, vec}; + | ^^^^^^ ^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:72:31 + | +72 | ... = env.register_contract(None, R... + | ^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:106:31 + | +106 | ... = env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:127:31 + | +127 | ... = env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + +error[E0433]: failed to resolve: use of undeclared type `StorageKey` + --> src/lib.rs:48:44 + | +48 | ...t().has(&StorageKey::Admin) { + | ^^^^^^^^^^ use of undeclared type `StorageKey` + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:72:31 + | +72 | ... = env.register_contract(None, R... + | ^^^^^^^^^^^^^^^^^ + +warning: unused variable: `rating` + --> src/review_registry.rs:14:9 + | +14 | rating: u32, // Matches typ... + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_rating` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `rating` + --> src/review_registry.rs:34:9 + | +34 | rating: u32, + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_rating` + +warning: unused variable: `env` + --> src/review_registry.rs:54:23 + | +54 | ...get_review(env: Env, project_id:... + | ^^^ help: if this is intentional, prefix it with an underscore: `_env` + +warning: unused variable: `project_id` + --> src/review_registry.rs:54:33 + | +54 | ...nv: Env, project_id: u64, review... + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_project_id` + +warning: unused variable: `reviewer` + --> src/review_registry.rs:54:50 + | +54 | ...id: u64, reviewer: Address) -> O... + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reviewer` + +error[E0061]: this method takes 2 arguments but 1 argument was supplied + --> src/test.rs:16:12 + | +16 | client.set_admin(&admin); + | ^^^^^^^^^-------- argument #2 of type `&soroban_sdk::Address` is missing + | +note: method defined here + --> src/lib.rs:55:12 + | +55 | ...fn set_admin(env: Env, caller: Address, new_admin: Address) -... + | ^^^^^^^^^ ------------------ +help: provide the argument + | +16 | client.set_admin(&admin, /* &soroban_sdk::Address */); + | +++++++++++++++++++++++++++++ + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:27:22 + | + 27 | &"Project A".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-945062286019461585.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:28:26 + | + 28 | &"Description A".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-10536917802964033711.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:29:17 + | + 29 | &"DeFi".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-12739544092201990946.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `unwrap` found for struct `types::Project` in the current scope + --> src/test.rs:42:43 + | +42 | ...oject(&id).unwrap(); + | ^^^^^^ method not found in `types::Project` + | + ::: src/types.rs:41:1 + | +41 | pub struct Project { + | ------------------ method `unwrap` not found for this struct + | +help: some of the expressions' fields have a method of the same name + | +42 | let project = client.get_project(&id).logo_cid.unwrap(); + | +++++++++ +42 | let project = client.get_project(&id).metadata_cid.unwrap(); + | +++++++++++++ +42 | let project = client.get_project(&id).website.unwrap(); + | ++++++++ + +error[E0599]: no method named `get_owner_project_count` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:45:23 + | +45 | ...nt.get_owner_project_count(&owne... + | ^^^^^^^^^^^^^^^^^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | +37 | #[contract] + | ----------- method `get_owner_project_count` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:54:13 + | + 54 | &"".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-5694889425550258568.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:55:17 + | + 55 | &"Desc".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1892591751077806600.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:56:16 + | + 56 | &"Cat".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8220243401945174347.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:70:16 + | + 70 | &" ".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-5694889425550258568.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:71:17 + | + 71 | &"Desc".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1892591751077806600.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:72:16 + | + 72 | &"Cat".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8220243401945174347.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:86:17 + | + 86 | &"Name".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-5694889425550258568.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:87:13 + | + 87 | &"".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1892591751077806600.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:88:16 + | + 88 | &"Cat".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8220243401945174347.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:102:17 + | +102 | &"Name".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-5694889425550258568.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:103:17 + | +103 | &"Desc".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1892591751077806600.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:104:13 + | +104 | &"".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8220243401945174347.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `Option<...>: From<...>` is not satisfied + --> src/test.rs:121:18 + | +121 | &"Name2".into(), + | ^^^^ unsatisfied trait bound + | + = help: the trait `From<&str>` is not implemented for `Option` + = help: the following other types implement trait `From`: + `core::option::Option<&T>` implements `From<&Option>` + `core::option::Option<&mut T>` implements `From<&mut Option>` + `core::option::Option` implements `From` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `Option` implements `From` + `Option` implements `From` + = note: required for `&str` to implement `Into>` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-7572148112764300434.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `Option<...>: From<...>` is not satisfied + --> src/test.rs:122:18 + | +122 | &"Desc2".into(), + | ^^^^ unsatisfied trait bound + | + = help: the trait `From<&str>` is not implemented for `Option` + = help: the following other types implement trait `From`: + `core::option::Option<&T>` implements `From<&Option>` + `core::option::Option<&mut T>` implements `From<&mut Option>` + `core::option::Option` implements `From` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `Option` implements `From` + `Option` implements `From` + = note: required for `&str` to implement `Into>` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-7572148112764300434.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `Option<...>: From<...>` is not satisfied + --> src/test.rs:123:17 + | +123 | &"Cat2".into(), + | ^^^^ unsatisfied trait bound + | + = help: the trait `From<&str>` is not implemented for `Option` + = help: the following other types implement trait `From`: + `core::option::Option<&T>` implements `From<&Option>` + `core::option::Option<&mut T>` implements `From<&mut Option>` + `core::option::Option` implements `From` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `core::option::Option` implements `From>` + `Option` implements `From` + `Option` implements `From` + = note: required for `&str` to implement `Into>` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-7572148112764300434.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `to_string` found for reference `&'static str` in the current scope + --> src/test.rs:143:26 + | +143 | let name = "Project".to_string(); + | ^^^^^^^^^ method not found in `&'static str` + | + = help: items from traits can only be used if the trait is in scope +help: trait `ToString` which provides `to_string` is implemented but not in scope; perhaps you want to import it + | + 3 + use crate::__donglecontract_fn_set_registry::std::string::ToString; + | + +error[E0599]: no method named `to_string` found for reference `&'static str` in the current scope + --> src/test.rs:144:30 + | +144 | ...ription".to_string(); + | ^^^^^^^^^ method not found in `&'static str` + | + = help: items from traits can only be used if the trait is in scope +help: trait `ToString` which provides `to_string` is implemented but not in scope; perhaps you want to import it + | + 3 + use crate::__donglecontract_fn_set_registry::std::string::ToString; + | + +error[E0599]: no method named `to_string` found for reference `&'static str` in the current scope + --> src/test.rs:145:22 + | +145 | let cat = "DeFi".to_string(); + | ^^^^^^^^^ method not found in `&'static str` + | + = help: items from traits can only be used if the trait is in scope +help: trait `ToString` which provides `to_string` is implemented but not in scope; perhaps you want to import it + | + 3 + use crate::__donglecontract_fn_set_registry::std::string::ToString; + | + +error[E0599]: no method named `get_owner_project_count` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:159:23 + | +159 | ...nt.get_owner_project_count(&own... + | ^^^^^^^^^^^^^^^^^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `get_owner_project_count` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:162:21 + | +162 | &"One more".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-12166720740807376677.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:237:12 + | +237 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +237 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:238:79 + | +238 | ...dence_cid".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8989302440517245360.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:248:12 + | +248 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +248 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:249:12 + | +249 | client.pay_fee(&owner, &id, &N... + | ^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `pay_fee` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:251:79 + | +251 | ...dence_cid".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-3192716633976472211.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:261:12 + | +261 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +261 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:262:12 + | +262 | client.pay_fee(&owner, &id, &N... + | ^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `pay_fee` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:263:67 + | +263 | ...owner, &"".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-22903799512381696.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:273:12 + | +273 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +273 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:274:12 + | +274 | client.pay_fee(&owner, &id, &N... + | ^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `pay_fee` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:275:58 + | +275 | ..."evidence".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-22903799512381696.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:287:12 + | +287 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +287 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:288:12 + | +288 | client.pay_fee(&owner, &id, &N... + | ^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `pay_fee` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:289:58 + | +289 | ..."evidence".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-22903799512381696.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `get_verification` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:291:22 + | +291 | ...client.get_verification(&id).ex... + | ^^^^^^^^^^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `get_verification` not found for this struct + | +help: there is a method `request_verification` with a similar name, but with different arguments + --> src/lib.rs:41:1 + | + 41 | #[contractimpl] + | ^^^^^^^^^^^^^^^ + = note: this error originates in the attribute macro `soroban_sdk::contractclient` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:301:12 + | +301 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +301 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:302:12 + | +302 | client.pay_fee(&owner, &id, &N... + | ^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `pay_fee` not found for this struct + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:303:58 + | +303 | ..."evidence".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-22903799512381696.txt' + = note: consider using `--verbose` to print the full type name to the console + +warning: unused variable: `rating` + --> src/review_registry.rs:14:9 + | +14 | rating: u32, // Matches typ... + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_rating` + +error[E0599]: no method named `reject_verification` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:304:12 + | +304 | client.reject_verification(&id... + | ^^^^^^^^^^^^^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `reject_verification` not found for this struct + | +help: there is a method `request_verification` with a similar name, but with different arguments + --> src/lib.rs:41:1 + | + 41 | #[contractimpl] + | ^^^^^^^^^^^^^^^ + = note: this error originates in the attribute macro `soroban_sdk::contractclient` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0599]: no method named `get_verification` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:305:22 + | +305 | ...client.get_verification(&id).ex... + | ^^^^^^^^^^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `get_verification` not found for this struct + | +help: there is a method `request_verification` with a similar name, but with different arguments + --> src/lib.rs:41:1 + | + 41 | #[contractimpl] + | ^^^^^^^^^^^^^^^ + = note: this error originates in the attribute macro `soroban_sdk::contractclient` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0599]: no method named `try_set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:315:25 + | +315 | ... = client.try_set_fee(&non_admi... + | ^^^^^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `try_set_fee` not found for this struct + | +help: there is a method `try_set_fee_config` with a similar name + | +315 | let result = client.try_set_fee_config(&non_admin, &None, &100, &treasury); + | +++++++ + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:317:12 + | +317 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +317 | client.set_fee_config(&admin, &None, &100, &treasury); + | +++++++ + +Some errors have detailed explanations: E0425, E0428, E0432, E0433, E0753. +For more information about an error, try `rustc --explain E0425`. +error[E0599]: no method named `try_set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:325:25 + | +325 | ... = client.try_set_fee(&admin, &... + | ^^^^^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `try_set_fee` not found for this struct + | +help: there is a method `try_set_fee_config` with a similar name + | +325 | let result = client.try_set_fee_config(&admin, &None, &0, &treasury); + | +++++++ + +warning: `dongle-contract` (lib) generated 12 warnings (4 duplicates) +error: could not compile `dongle-contract` (lib) due to 37 previous errors; 12 warnings emitted +warning: build failed, waiting for other jobs to finish... +error[E0599]: no method named `try_pay_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:334:25 + | +334 | ...client.try_pay_fee(&owner, &id,... + | ^^^^^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `try_pay_fee` not found for this struct + +error[E0599]: no method named `is_none` found for struct `types::Project` in the current scope + --> src/test.rs:343:21 + | +343 | assert!(project.is_none()); + | ^^^^^^^ method not found in `types::Project` + | + ::: src/types.rs:41:1 + | + 41 | pub struct Project { + | ------------------ method `is_none` not found for this struct + | +help: some of the expressions' fields have a method of the same name + | +343 | assert!(project.logo_cid.is_none()); + | +++++++++ +343 | assert!(project.metadata_cid.is_none()); + | +++++++++++++ +343 | assert!(project.website.is_none()); + | ++++++++ + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:355:21 + | +355 | &"Desc".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-349677605968768742.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test.rs:356:20 + | +356 | &"Cat".into(), + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1192274155980166190.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `get_owner_project_count` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:364:23 + | +364 | ...nt.get_owner_project_count(&own... + | ^^^^^^^^^^^^^^^^^^^^^^^ method not found in `DongleContractClient<'_>` + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `get_owner_project_count` not found for this struct + +error[E0599]: no method named `set_fee` found for struct `DongleContractClient<'a>` in the current scope + --> src/test.rs:372:12 + | +372 | client.set_fee(&admin, &None, ... + | ^^^^^^^ + | + ::: src/lib.rs:37:1 + | + 37 | #[contract] + | ----------- method `set_fee` not found for this struct + | +help: there is a method `set_fee_config` with a similar name + | +372 | client.set_fee_config(&admin, &None, &500, &treasury); + | +++++++ + +error[E0609]: no field `amount` on type `types::FeeConfig` + --> src/test.rs:374:23 + | +374 | assert_eq!(config.amount, 500); + | ^^^^^^ unknown field + | + = note: available fields are: `token`, `verification_fee`, `registration_fee` + +error[E0609]: no field `treasury` on type `types::FeeConfig` + --> src/test.rs:375:23 + | +375 | ...fig.treasury, treasury); + | ^^^^^^^^ unknown field + | + = note: available fields are: `token`, `verification_fee`, `registration_fee` + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/test_treasury.rs:12:27 + | +12 | ... = env.register_contract(None, D... + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_stellar_asset_contract`: use [Env::register_stellar_asset_contract_v2] + --> src/test_treasury.rs:21:27 + | +21 | ...nv.register_stellar_asset_contract(ad... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: no method named `unwrap` found for struct `types::FeeConfig` in the current scope + --> src/test_treasury.rs:33:42 + | +33 | ...e_config().unwrap(); + | ^^^^^^ method not found in `types::FeeConfig` + | + ::: src/types.rs:68:1 + | +68 | pub struct FeeConfig { + | -------------------- method `unwrap` not found for this struct + | +help: one of the expressions' fields has a method of the same name + | +33 | let config = client.get_fee_config().token.unwrap(); + | ++++++ + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:48:11 + | +48 | token.mint(&user, &5000); + | ^^^^ method not found in `Client<'_>` + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:58:7 + | +50 | let project_id = client.regis... + | ______________________- +51 | | &user, +52 | | &String::from_str(&env, "... +53 | | &String::from_str(&env, "... +... | +57 | | &None, +58 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:77:11 + | +77 | token.mint(&user, &1000); + | ^^^^ method not found in `Client<'_>` + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:87:7 + | +79 | let project_id = client.regis... + | ______________________- +80 | | &user, +81 | | &String::from_str(&env, "... +82 | | &String::from_str(&env, "... +... | +86 | | &None, +87 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:108:11 + | +108 | token.mint(&user, &1000); + | ^^^^ method not found in `Client<'_>` + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:58 + | +110 | ...user, &"P".into(), &"D".into(),... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-11460011743124368085.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:71 + | +110 | ...to(), &"D".into(), &"C".into(),... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8989302440517245360.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:84 + | +110 | ...to(), &"C".into(), &None, &None... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8044604119293209651.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:110:113 + | +110 | ..., &None).unwrap(); + | ^^^^^^ method not found in `u64` + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:111:58 + | +111 | ...user, &"E".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-6890079729681520674.txt' + = note: consider using `--verbose` to print the full type name to the console + +Some errors have detailed explanations: E0061, E0106, E0277, E0425, E0428, E0432, E0433, E0599, E0609... +For more information about an error, try `rustc --explain E0061`. +warning: `dongle-contract` (lib test) generated 23 warnings (13 duplicates) +error: could not compile `dongle-contract` (lib test) due to 111 previous errors; 23 warnings emitted diff --git a/dongle-smartcontract/build_errors_2.txt b/dongle-smartcontract/build_errors_2.txt new file mode 100644 index 0000000..51e1017 --- /dev/null +++ b/dongle-smartcontract/build_errors_2.txt @@ -0,0 +1,414 @@ + Compiling dongle-contract v0.1.0 (/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract) +error[E0106]: missing lifetime specifier + --> src/test_treasury.rs:7:46 + | +7 | ...ractClient<'_>, Address) { + | ^^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values + | +7 - fn setup_env() -> (Env, DongleContractClient<'_>, Address) { +7 + fn setup_env() -> (Env, DongleContractClient<'static>, Address) { + | + +error[E0425]: cannot find type `String` in this scope + --> src/verification_registry.rs:17:23 + | +17 | evidence_cid: String, + | ^^^^^^ not found in this scope + | +help: consider importing one of these structs + | + 1 + use crate::String; + | + 1 + use soroban_sdk::String; + | + +warning: unused import: `ReviewEventData` + --> src/review_registry.rs:2:42 + | +2 | ...Action, ReviewEventData}; + | ^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `TryIntoVal` + --> src/review_registry.rs:63:31 + | +63 | ..., String, TryIntoVal, + | ^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `crate::storage_keys::StorageKey` + --> src/utils.rs:2:5 + | +2 | use crate::storage_keys::StorageKey; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `Project` and `VerificationStatus` + --> src/test.rs:2:20 + | +2 | ...::{Project, VerificationStatus}; + | ^^^^^^^ ^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::errors::ContractError` + --> src/test.rs:3:5 + | +3 | use crate::errors::ContractError; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `vec` + --> src/test.rs:4:66 + | +4 | ... Env, String, vec}; + | ^^^ + +warning: unused import: `VerificationRecord` + --> src/lib.rs:27:37 + | +27 | ...view, VerificationRecord, FeeCo... + | ^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `FeeConfig` and `VerificationStatus` + --> src/test_treasury.rs:2:20 + | +2 | ...::{VerificationStatus, FeeConfig}; + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ + +warning: unused import: `crate::errors::ContractError` + --> src/test_treasury.rs:3:5 + | +3 | use crate::errors::ContractError; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `Events` and `vec` + --> src/test_treasury.rs:4:45 + | +4 | ..._, Events}, Address, Env, String, vec}; + | ^^^^^^ ^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:72:31 + | +72 | ... = env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:106:31 + | +106 | ...= env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/review_registry.rs:127:31 + | +127 | ...= env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/test.rs:9:27 + | +9 | ... = env.register_contract(None, D... + | ^^^^^^^^^^^^^^^^^ + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test.rs:33:7 + | +25 | let id = client.register_pro... + | ______________- +26 | | &owner, +27 | | &name, +28 | | &desc, +... | +32 | | &None, +33 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `unwrap` found for struct `Project` in the current scope + --> src/test.rs:36:43 + | +36 | ...ect(&id).unwrap(); + | ^^^^^^ method not found in `Project` + | + ::: src/types.rs:41:1 + | +41 | pub struct Project { + | ------------------ method `unwrap` not found for this struct + | +help: some of the expressions' fields have a method of the same name + | +36 | let project = client.get_project(&id).logo_cid.unwrap(); + | +++++++++ +36 | let project = client.get_project(&id).metadata_cid.unwrap(); + | +++++++++++++ +36 | let project = client.get_project(&id).website.unwrap(); + | ++++++++ + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test.rs:55:7 + | +47 | let id = client.register_pro... + | ______________- +48 | | &owner, +49 | | &String::from_str(&env, ... +50 | | &String::from_str(&env, ... +... | +54 | | &None, +55 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `unwrap` found for struct `Project` in the current scope + --> src/test.rs:60:43 + | +60 | ...ect(&id).unwrap(); + | ^^^^^^ method not found in `Project` + | + ::: src/types.rs:41:1 + | +41 | pub struct Project { + | ------------------ method `unwrap` not found for this struct + | +help: some of the expressions' fields have a method of the same name + | +60 | let project = client.get_project(&id).logo_cid.unwrap(); + | +++++++++ +60 | let project = client.get_project(&id).metadata_cid.unwrap(); + | +++++++++++++ +60 | let project = client.get_project(&id).website.unwrap(); + | ++++++++ + +warning: unused variable: `rating` + --> src/review_registry.rs:14:9 + | +14 | rating: u32, // Matches ty... + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_rating` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `rating` + --> src/review_registry.rs:34:9 + | +34 | rating: u32, + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_rating` + +warning: unused variable: `env` + --> src/review_registry.rs:54:23 + | +54 | ...get_review(env: Env, project_id... + | ^^^ help: if this is intentional, prefix it with an underscore: `_env` + +warning: unused variable: `project_id` + --> src/review_registry.rs:54:33 + | +54 | ...nv: Env, project_id: u64, revie... + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_project_id` + +warning: unused variable: `reviewer` + --> src/review_registry.rs:54:50 + | +54 | ...id: u64, reviewer: Address) -> ... + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reviewer` + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test.rs:78:7 + | +70 | let id = client.register_pro... + | ______________- +71 | | &owner, +72 | | &String::from_str(&env, ... +73 | | &String::from_str(&env, ... +... | +77 | | &None, +78 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `unwrap` found for unit type `()` in the current scope + --> src/test.rs:81:50 + | +81 | ..., &None).unwrap(); + | ^^^^^^ method not found in `()` + +error[E0599]: no method named `unwrap` found for struct `Review` in the current scope + --> src/test.rs:83:52 + | +83 | ...eviewer).unwrap(); + | ^^^^^^ method not found in `Review` + | + ::: src/types.rs:5:1 + | + 5 | pub struct Review { + | ----------------- method `unwrap` not found for this struct + | +help: one of the expressions' fields has a method of the same name + | +83 | let review = client.get_review(&id, &reviewer).comment_cid.unwrap(); + | ++++++++++++ + +warning: use of deprecated method `soroban_sdk::Env::register_contract`: use `register` + --> src/test_treasury.rs:12:27 + | +12 | ... = env.register_contract(None, ... + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated method `soroban_sdk::Env::register_stellar_asset_contract`: use [Env::register_stellar_asset_contract_v2] + --> src/test_treasury.rs:21:27 + | +21 | ...nv.register_stellar_asset_contract(ad... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: no method named `unwrap` found for struct `FeeConfig` in the current scope + --> src/test_treasury.rs:33:42 + | +33 | ...config().unwrap(); + | ^^^^^^ method not found in `FeeConfig` + | + ::: src/types.rs:68:1 + | +68 | pub struct FeeConfig { + | -------------------- method `unwrap` not found for this struct + | +help: one of the expressions' fields has a method of the same name + | +33 | let config = client.get_fee_config().token.unwrap(); + | ++++++ + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:48:11 + | +48 | token.mint(&user, &5000); + | ^^^^ method not found in `Client<'_>` + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:58:7 + | +50 | let project_id = client.regi... + | ______________________- +51 | | &user, +52 | | &String::from_str(&env, ... +53 | | &String::from_str(&env, ... +... | +57 | | &None, +58 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:77:11 + | +77 | token.mint(&user, &1000); + | ^^^^ method not found in `Client<'_>` + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:87:7 + | +79 | let project_id = client.regi... + | ______________________- +80 | | &user, +81 | | &String::from_str(&env, ... +82 | | &String::from_str(&env, ... +... | +86 | | &None, +87 | | ).unwrap(); + | | -^^^^^^ method not found in `u64` + | |______| + | + +error[E0599]: no method named `mint` found for struct `Client<'a>` in the current scope + --> src/test_treasury.rs:108:11 + | +108 | token.mint(&user, &1000); + | ^^^^ method not found in `Client<'_>` + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:58 + | +110 | ...user, &"P".into(), &"D".into()... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-8348603813004109312.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:71 + | +110 | ...to(), &"D".into(), &"C".into()... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-7477822316841538193.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:110:84 + | +110 | ...to(), &"C".into(), &None, &Non... + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-17477094683969317530.txt' + = note: consider using `--verbose` to print the full type name to the console + +error[E0599]: no method named `unwrap` found for type `u64` in the current scope + --> src/test_treasury.rs:110:113 + | +110 | ..., &None).unwrap(); + | ^^^^^^ method not found in `u64` + +error[E0277]: the trait bound `String: From<&str>` is not satisfied + --> src/test_treasury.rs:111:58 + | +111 | ...user, &"E".into()); + | ^^^^ unsatisfied trait bound + | +help: the trait `From<&str>` is not implemented for `soroban_sdk::String` + but trait `From<&soroban_sdk::String>` is implemented for it + --> /home/robi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/soroban-sdk-22.0.10/src/string.rs:135:1 + | +135 | impl From<&String> for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `soroban_sdk::String`, found `str` + = note: required for `&str` to implement `Into` + = note: the full name for the type has been written to '/home/robi/Desktop/Dongle-Smartcontract/dongle-smartcontract/target/debug/deps/dongle_contract-4e30645807e05f46.long-type-1544933982581009207.txt' + = note: consider using `--verbose` to print the full type name to the console + +For more information about this error, try `rustc --explain E0425`. +warning: `dongle-contract` (lib) generated 8 warnings +error: could not compile `dongle-contract` (lib) due to 1 previous error; 8 warnings emitted +warning: build failed, waiting for other jobs to finish... +Some errors have detailed explanations: E0106, E0277, E0425, E0599. +For more information about an error, try `rustc --explain E0106`. +warning: `dongle-contract` (lib test) generated 20 warnings (7 duplicates) +error: could not compile `dongle-contract` (lib test) due to 20 previous errors; 20 warnings emitted diff --git a/dongle-smartcontract/src/errors.rs b/dongle-smartcontract/src/errors.rs index 4169988..ef526f9 100644 --- a/dongle-smartcontract/src/errors.rs +++ b/dongle-smartcontract/src/errors.rs @@ -49,4 +49,6 @@ pub enum ContractError { InvalidAmount = 21, /// Fee not configured for this token FeeNotConfigured = 22, + /// Treasury address not set + TreasuryAddressNotSet = 23, } \ No newline at end of file diff --git a/dongle-smartcontract/src/fee_manager.rs b/dongle-smartcontract/src/fee_manager.rs index 6d297ac..51c7c7e 100644 --- a/dongle-smartcontract/src/fee_manager.rs +++ b/dongle-smartcontract/src/fee_manager.rs @@ -132,4 +132,21 @@ impl FeeManager { pub fn is_fee_paid(env: &Env, project_id: u64) -> bool { env.storage().persistent().get(&StorageKey::FeePaidForProject(project_id)).unwrap_or(false) } + + pub fn set_treasury(env: &Env, admin: Address, treasury: Address) -> Result<(), ContractError> { + admin.require_auth(); + let stored_admin: Address = env.storage().persistent().get(&StorageKey::Admin).ok_or(ContractError::AdminOnly)?; + if admin != stored_admin { + return Err(ContractError::AdminOnly); + } + env.storage().persistent().set(&StorageKey::Treasury, &treasury); + Ok(()) + } + + pub fn get_treasury(env: &Env) -> Result { + env.storage() + .persistent() + .get(&StorageKey::Treasury) + .ok_or(ContractError::TreasuryAddressNotSet) + } } diff --git a/dongle-smartcontract/src/lib.rs b/dongle-smartcontract/src/lib.rs index e741bfa..f341aa5 100644 --- a/dongle-smartcontract/src/lib.rs +++ b/dongle-smartcontract/src/lib.rs @@ -203,4 +203,12 @@ impl DongleContract { pub fn get_treasury_balance(env: Env, token: Address) -> u128 { FeeManager::get_treasury_balance(&env, &token) } + + pub fn set_treasury(env: Env, admin: Address, treasury: Address) -> Result<(), ContractError> { + FeeManager::set_treasury(&env, admin, treasury) + } + + pub fn get_treasury(env: Env) -> Result { + FeeManager::get_treasury(&env) + } } diff --git a/dongle-smartcontract/src/test_treasury.rs b/dongle-smartcontract/src/test_treasury.rs index 38bf839..a73665a 100644 --- a/dongle-smartcontract/src/test_treasury.rs +++ b/dongle-smartcontract/src/test_treasury.rs @@ -145,3 +145,26 @@ fn test_unauthorized_withdrawal() { let result = client.try_withdraw_treasury(&non_admin, &token.address, &100, &treasury_dest); assert!(result.is_err()); } + +#[test] +fn test_set_treasury_address() { + let env = Env::default(); + let (_, client, admin) = setup_env(&env); + + let treasury = Address::generate(&env); + client.set_treasury(&admin, &treasury); + + assert_eq!(client.get_treasury(), treasury); +} + +#[test] +fn test_unauthorized_set_treasury() { + let env = Env::default(); + let (_, client, _) = setup_env(&env); + + let non_admin = Address::generate(&env); + let treasury = Address::generate(&env); + + let result = client.try_set_treasury(&non_admin, &treasury); + assert!(result.is_err()); +} diff --git a/dongle-smartcontract/target/.rustc_info.json b/dongle-smartcontract/target/.rustc_info.json index 8b15547..18e32ce 100644 --- a/dongle-smartcontract/target/.rustc_info.json +++ b/dongle-smartcontract/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":8223297098076279531,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\nlib___.a\n___.dll\nC:\\Users\\LENOVO\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\noff\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.93.1 (01f6ddf75 2026-02-11)\nbinary: rustc\ncommit-hash: 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf\ncommit-date: 2026-02-11\nhost: x86_64-pc-windows-gnu\nrelease: 1.93.1\nLLVM version: 21.1.8\n","stderr":""},"11652014622397750202":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\nC:\\Users\\LENOVO\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\noff\n___\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"wasm32\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"wasm\"\ntarget_feature=\"bulk-memory\"\ntarget_feature=\"multivalue\"\ntarget_feature=\"mutable-globals\"\ntarget_feature=\"nontrapping-fptoint\"\ntarget_feature=\"reference-types\"\ntarget_feature=\"sign-ext\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"unknown\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`\n\nwarning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`\n\nwarning: 2 warnings emitted\n\n"}},"successes":{}} \ No newline at end of file +{"rustc_fingerprint":5182176766396021987,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/robi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.93.1 (01f6ddf75 2026-02-11)\nbinary: rustc\ncommit-hash: 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf\ncommit-date: 2026-02-11\nhost: x86_64-unknown-linux-gnu\nrelease: 1.93.1\nLLVM version: 21.1.8\n","stderr":""}},"successes":{}} \ No newline at end of file