diff --git a/src/access_control.rs b/src/access_control.rs index 5f9a7f7..608df57 100644 --- a/src/access_control.rs +++ b/src/access_control.rs @@ -73,7 +73,6 @@ //! 3. Leave `propose_role_change` as a stub or integrate with DAO's public interface. use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec}; -use soroban_sdk::storage::Instance; use crate::error_standard::{ErrorDescriptor, ErrorKind, StandardContractError}; // ═══════════════════════════════════════════════════════════════════════════════ @@ -785,11 +784,11 @@ pub fn init_roles(env: &Env, admin: Address) -> Result<(), AccessControlError> { /// # Returns /// - Always `Err(NotImplemented)` until DAO integration is implemented. pub fn propose_role_change( - env: &Env, + _env: &Env, proposer: Address, - role: Symbol, - grantee: Address, - action_type: Symbol, + _role: Symbol, + _grantee: Address, + _action_type: Symbol, ) -> Result { // Stub: revert immediately proposer.require_auth(); @@ -944,13 +943,11 @@ pub fn approve_proposal( ) -> Result<(), AccessControlError> { approver.require_auth(); - let config: MultiSigConfig = env + let _config: MultiSigConfig = env .storage() .persistent() .get(&AccessControlKey::MultiSigConfig) .ok_or(AccessControlError::MultiSigNotConfigured)?; - - // Verify approver is a signer let signers: Vec
= env .storage() .persistent() diff --git a/src/achievement_engine.rs b/src/achievement_engine.rs index bc60e02..cff880d 100644 --- a/src/achievement_engine.rs +++ b/src/achievement_engine.rs @@ -1,6 +1,6 @@ //! Achievement eligibility evaluation and badge issuance. //! -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, String, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, String, Vec}; use crate::health_monitor; use crate::player_profile::{get_profile_by_owner, mark_achievement_unlocked}; diff --git a/src/bounty_board.rs b/src/bounty_board.rs index c8c4859..e789d05 100644 --- a/src/bounty_board.rs +++ b/src/bounty_board.rs @@ -1,7 +1,7 @@ //! Bounty publication, claiming, and settlement. //! use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, BytesN, Env, Vec, Map, String, + contracterror, contracttype, symbol_short, Address, BytesN, Env, String, }; /// Default bounty expiry duration: 14 days in seconds. diff --git a/src/cache_ttl_manager.rs b/src/cache_ttl_manager.rs index cd062b4..c79c77d 100644 --- a/src/cache_ttl_manager.rs +++ b/src/cache_ttl_manager.rs @@ -249,7 +249,7 @@ pub fn invalidate_namespace( /// Automatic cleanup of expired entries (called periodically). pub fn clear_stale_entries(env: &Env, namespace: Symbol) -> u32 { - let mut cleared = 0u32; + let cleared = 0u32; // In a real implementation, iterate through all entries in the namespace // and remove those where age > ttl_seconds. For this example, we track diff --git a/src/composability_examples.rs b/src/composability_examples.rs index 6f046fd..43bd7b6 100644 --- a/src/composability_examples.rs +++ b/src/composability_examples.rs @@ -48,7 +48,7 @@ pub struct ComposableResponse { } impl ComposableResponse { - pub fn new(env: &Env, success: bool, data: Bytes, gas_used: u64) -> Self { + pub fn new(_env: &Env, success: bool, data: Bytes, gas_used: u64) -> Self { Self { success, data, @@ -296,7 +296,7 @@ pub struct CompositionBuilder { } impl CompositionBuilder { - pub fn new(env: &Env) -> Self { + pub fn new(_env: &Env) -> Self { Self { target: None, method: None, diff --git a/src/content_tools.rs b/src/content_tools.rs index 3e1b074..a572e36 100644 --- a/src/content_tools.rs +++ b/src/content_tools.rs @@ -1,7 +1,7 @@ //! Administrative tools for managed game content. //! use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, Bytes, Env, Map, String, Symbol, Vec, + contracterror, contracttype, symbol_short, Address, Bytes, Env, String, Symbol, Vec, }; use crate::input_validation; @@ -345,7 +345,7 @@ pub fn delete_content( // Remove from creator's list let creator_key = ContentDataKey::CreatorContent(creator.clone()); - let mut creator_contents: Vec = env + let creator_contents: Vec = env .storage() .persistent() .get(&creator_key) diff --git a/src/contract_versioning.rs b/src/contract_versioning.rs index 5afb8b4..4bc252a 100644 --- a/src/contract_versioning.rs +++ b/src/contract_versioning.rs @@ -1,7 +1,7 @@ //! Contract version metadata and compatibility checks. //! use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, Bytes, Env, Vec, Map, + contracterror, contracttype, symbol_short, Address, Bytes, Env, Vec, }; /// Current contract version (starts at 1 at deployment). diff --git a/src/difficulty_curve.rs b/src/difficulty_curve.rs index 8a8dd8f..4928fc1 100644 --- a/src/difficulty_curve.rs +++ b/src/difficulty_curve.rs @@ -1,6 +1,6 @@ //! Reusable progression and difficulty curves. //! -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol}; use crate::health_monitor; use crate::nebula_explorer::NebulaLayout; diff --git a/src/economics/monitor.rs b/src/economics/monitor.rs index a650d4a..005df73 100644 --- a/src/economics/monitor.rs +++ b/src/economics/monitor.rs @@ -135,7 +135,7 @@ pub fn get_resource_metrics(env: &Env, resource_type: Symbol) -> ResourceMetrics } /// Calculate inflation rate based on supply growth -pub fn calculate_inflation_rate(env: &Env, old_supply: i128, new_supply: i128) -> u32 { +pub fn calculate_inflation_rate(_env: &Env, old_supply: i128, new_supply: i128) -> u32 { if old_supply == 0 { return 0; } diff --git a/src/energy_manager.rs b/src/energy_manager.rs index 0bac205..f5d3bef 100644 --- a/src/energy_manager.rs +++ b/src/energy_manager.rs @@ -162,7 +162,7 @@ pub fn get_energy_balance(env: &Env, ship_id: u64) -> Result Self { + pub fn new(_env: &Env, admin: &Address) -> Self { Self { min_share_size: MIN_SHARE_SIZE, max_fractions_per_tx: MAX_FRACTIONS_PER_TX, @@ -188,7 +188,7 @@ pub fn fractionalize_resource( // Create fractional shares let mut share_ids = Vec::new(env); - for i in 0..shares { + for _i in 0..shares { let share_id = next_share_id(env); let share = FractionalShare { share_id, @@ -294,7 +294,7 @@ pub fn merge_fractions( // Update original resource let resource_type = expected_type.unwrap(); - let original_id = expected_original_id.unwrap(); + let _original_id = expected_original_id.unwrap(); let mut original: OriginalResource = env .storage() diff --git a/src/gas_optimized_compute.rs b/src/gas_optimized_compute.rs index 01d9a59..1c68c23 100644 --- a/src/gas_optimized_compute.rs +++ b/src/gas_optimized_compute.rs @@ -1,9 +1,9 @@ /// Gas-optimized computation utilities /// Provides efficient algorithms and patterns for common computations -use soroban_sdk::{Env, Vec, BytesN}; +use soroban_sdk::{Env, Vec}; /// Fast hash for small inputs (optimized for gas) -pub fn fast_hash_u64(env: &Env, input: u64) -> u64 { +pub fn fast_hash_u64(_env: &Env, input: u64) -> u64 { // Simple but fast hash for u64 let mut hash = input; hash ^= hash >> 33; diff --git a/src/gas_optimized_storage.rs b/src/gas_optimized_storage.rs index 094ff0d..70e3644 100644 --- a/src/gas_optimized_storage.rs +++ b/src/gas_optimized_storage.rs @@ -1,6 +1,6 @@ /// Gas-optimized storage utilities /// Provides efficient storage patterns for common operations -use soroban_sdk::{Env, Address, Symbol, Vec, Map}; +use soroban_sdk::{Env, Symbol, Vec}; /// Recommended TTL values for different data types pub const TTL_TEMPORARY: u32 = 17_280; // 1 day diff --git a/src/gas_recovery.rs b/src/gas_recovery.rs index 8eac73d..ebde00d 100644 --- a/src/gas_recovery.rs +++ b/src/gas_recovery.rs @@ -1,5 +1,5 @@ use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, BytesN, Env, Vec, Map, + contracterror, contracttype, symbol_short, Address, BytesN, Env, Vec, }; /// Default refund percentage in basis points (100 = 1%). diff --git a/src/governance.rs b/src/governance.rs index 7bfc14d..999f491 100644 --- a/src/governance.rs +++ b/src/governance.rs @@ -1,7 +1,7 @@ -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Bytes, BytesN, Env, String, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, BytesN, Env, String, Symbol}; #[contracterror] -#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[repr(u32)] pub enum GovError { VotingClosed = 1, @@ -51,7 +51,7 @@ enum GovernanceDataKey { pub fn create_proposal(env: Env, creator: Address, description: String, param_change: BytesN<128>) -> Result { creator.require_auth(); - let mut proposal_id = env.storage().instance().get::<_, u64>(&symbol_short!("next_gid")).unwrap_or(0); + let proposal_id = env.storage().instance().get::<_, u64>(&symbol_short!("next_gid")).unwrap_or(0); let proposal = Proposal { id: proposal_id, diff --git a/src/indexer_callbacks.rs b/src/indexer_callbacks.rs index ef6627e..e9bcd1d 100644 --- a/src/indexer_callbacks.rs +++ b/src/indexer_callbacks.rs @@ -1,4 +1,4 @@ -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, BytesN, Env, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, BytesN, Env, Symbol}; #[contracterror] #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] diff --git a/src/leaderboards.rs b/src/leaderboards.rs index 571db27..4c5922d 100644 --- a/src/leaderboards.rs +++ b/src/leaderboards.rs @@ -764,7 +764,7 @@ fn validate_region(env: &Env, region: &Symbol) -> Result<(), LeaderboardError> { // ── Sorting Helpers ───────────────────────────────────────────────────────── -fn sort_entries_descending(env: &Env, entries: &mut Vec) { +fn sort_entries_descending(_env: &Env, entries: &mut Vec) { let n = entries.len(); for i in 0..n { for j in (i + 1)..n { @@ -780,7 +780,7 @@ fn sort_entries_descending(env: &Env, entries: &mut Vec) { } } -fn sort_guild_entries_descending(env: &Env, entries: &mut Vec) { +fn sort_guild_entries_descending(_env: &Env, entries: &mut Vec) { let n = entries.len(); for i in 0..n { for j in (i + 1)..n { @@ -796,7 +796,7 @@ fn sort_guild_entries_descending(env: &Env, entries: &mut Vec) { } } -fn sort_regional_entries_descending(env: &Env, entries: &mut Vec) { +fn sort_regional_entries_descending(_env: &Env, entries: &mut Vec) { let n = entries.len(); for i in 0..n { for j in (i + 1)..n { @@ -812,7 +812,7 @@ fn sort_regional_entries_descending(env: &Env, entries: &mut Vec) } } -fn sort_achievement_entries_descending(env: &Env, entries: &mut Vec) { +fn sort_achievement_entries_descending(_env: &Env, entries: &mut Vec) { let n = entries.len(); for i in 0..n { for j in (i + 1)..n { diff --git a/src/lib.rs b/src/lib.rs index aaf7ea2..404440c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1868,7 +1868,7 @@ impl NebulaNomadContract { shared_lib::validate_address(&env, auth) } - pub fn calculate_yield(env: Env, base: i128, multiplier: u32) -> Result { + pub fn calculate_yield(_env: Env, base: i128, multiplier: u32) -> Result { shared_lib::calculate_yield(base, multiplier) } @@ -2350,7 +2350,7 @@ impl NebulaNomadContract { } /// Calculate travel cost between two nebulae. - pub fn calculate_travel_cost(env: Env, origin_nebula: u64, destination: u64) -> u32 { + pub fn calculate_travel_cost(_env: Env, origin_nebula: u64, destination: u64) -> u32 { wormhole_traveler::calculate_travel_cost(origin_nebula, destination) } diff --git a/src/metadata_resolver.rs b/src/metadata_resolver.rs index be1e86e..b930b1f 100644 --- a/src/metadata_resolver.rs +++ b/src/metadata_resolver.rs @@ -94,7 +94,7 @@ fn validate_api_token(token: &Bytes) -> bool { /// On Soroban, the actual HTTP POST is performed off-chain via the /// authorization callback mechanism. This function prepares the payload /// that the off-chain pinning client consumes. -fn build_pin_request(cid: &Bytes, token_id: u64, replication_factor: u32) -> Bytes { +fn build_pin_request(cid: &Bytes, _token_id: u64, _replication_factor: u32) -> Bytes { // In Soroban contracts, we store the CID for off-chain pinning. // The actual HTTP request is made by an external service watching // the `meta.pinned` event. This function validates and tags the CID. diff --git a/src/migration_framework.rs b/src/migration_framework.rs index faca4d7..ff3796e 100644 --- a/src/migration_framework.rs +++ b/src/migration_framework.rs @@ -1,5 +1,5 @@ use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, Bytes, Env, Vec, Symbol, + contracterror, contracttype, symbol_short, Address, Bytes, BytesN, Env, Vec, Symbol, }; // ─── Migration Framework for Soroban Contract Upgrades ────────────────────── @@ -350,7 +350,7 @@ pub fn record_migration_completion( to_version: u32, record_count: u32, ) { - let record = MigrationRecord { + let _record = MigrationRecord { id: migration_id, from_version, to_version, @@ -373,4 +373,4 @@ pub fn record_migration_completion( ); } -use soroban_sdk::BytesN; + diff --git a/src/notifications/alerts.rs b/src/notifications/alerts.rs index 139d94c..3ebd904 100644 --- a/src/notifications/alerts.rs +++ b/src/notifications/alerts.rs @@ -1,4 +1,4 @@ -use soroban_sdk::{symbol_short, Address, Env, Symbol}; +use soroban_sdk::{symbol_short, Address, Env}; use crate::notifications::push_service::emit_notification; pub fn check_low_resources(env: &Env, player: Address, balance: u32, threshold: u32) { diff --git a/src/notifications/push_service.rs b/src/notifications/push_service.rs index ac9ea0a..84b7d76 100644 --- a/src/notifications/push_service.rs +++ b/src/notifications/push_service.rs @@ -9,7 +9,7 @@ pub struct Notification { } pub fn emit_notification(env: &Env, player: Address, message: Symbol) { - let notification = Notification { + let _notification = Notification { user: player.clone(), message: message.clone(), timestamp: env.ledger().timestamp(), diff --git a/src/pvp_combat.rs b/src/pvp_combat.rs index 5972dd1..a984626 100644 --- a/src/pvp_combat.rs +++ b/src/pvp_combat.rs @@ -1,5 +1,5 @@ use soroban_sdk::{ - contracterror, contracttype, symbol_short, Address, BytesN, Env, Map, String, Symbol, Vec, + contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec, }; // ── Error ───────────────────────────────────────────────────────────────────── @@ -877,12 +877,11 @@ pub fn leave_matchmaking(env: &Env, player: &Address) -> Result<(), PvPError> { player.require_auth(); let key = PvPDataKey::MatchmakingQueue; - let mut queue: Vec = env + let queue: Vec = env .storage() .persistent() .get(&key) .unwrap_or_else(|| Vec::new(env)); - let mut found = false; let mut new_queue = Vec::new(env); for i in 0..queue.len() { @@ -911,7 +910,7 @@ pub fn leave_matchmaking(env: &Env, player: &Address) -> Result<(), PvPError> { pub fn process_matchmaking(env: &Env) -> Result, PvPError> { let key = PvPDataKey::MatchmakingQueue; - let mut queue: Vec = env + let queue: Vec = env .storage() .persistent() .get(&key) diff --git a/src/recycling_crafter.rs b/src/recycling_crafter.rs index 46c6185..f72f48a 100644 --- a/src/recycling_crafter.rs +++ b/src/recycling_crafter.rs @@ -1,5 +1,5 @@ use soroban_sdk::{ - contracterror, contracttype, symbol_short, vec, Address, Env, Vec, Map, Symbol, + contracterror, contracttype, symbol_short, Address, Env, Vec, Symbol, }; /// Maximum batch size for recycle/craft operations. @@ -197,7 +197,7 @@ pub fn craft_new_item( let output_quantities = recipe.output_quantities; for i in 0..recipe.outputs.len() { let base_qty = output_quantities.get(i).unwrap(); - let boosted_qty = (base_qty as f32 * efficiency_multiplier) as u32; + let _boosted_qty = (base_qty as f32 * efficiency_multiplier) as u32; final_outputs.push_back(recipe.outputs.get(i).unwrap().clone()); } diff --git a/src/resource_minter.rs b/src/resource_minter.rs index 08ba8bf..e033a93 100644 --- a/src/resource_minter.rs +++ b/src/resource_minter.rs @@ -8,9 +8,8 @@ // at the top of mint_resource() before any state mutation. // • RateLimitHit events are emitted inside check_rate_limit. -#![no_std] use soroban_sdk::{ - contract, contracterror, contractimpl, contracttype, log, symbol_short, Address, Env, String, + contract, contracterror, contractimpl, contracttype, symbol_short, Address, Env, Symbol, }; @@ -63,7 +62,7 @@ pub enum MinterKey { // ── Error ───────────────────────────────────────────────────── #[contracterror] -#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[repr(u32)] pub enum MinterError { /// Amount must be > 0. diff --git a/src/rewards.rs b/src/rewards.rs index 98b1414..a6edce6 100644 --- a/src/rewards.rs +++ b/src/rewards.rs @@ -405,7 +405,7 @@ pub fn get_tier_reward(tier: u32) -> i128 { } // ─── Internal Helpers ────────────────────────────────────────────────────────── -fn generate_code_from_address(env: &Env, address: &Address) -> BytesN<8> { +fn generate_code_from_address(env: &Env, _address: &Address) -> BytesN<8> { // Simple code generation from address bytes let mut code = [0u8; 8]; // Use first 8 bytes of address representation @@ -442,7 +442,7 @@ fn update_leaderboard( referrer: &Address, active_referrals: u32, tier: u32, - total_rewards: i128, + _total_rewards: i128, ) { // Simplified leaderboard update - just emit event env.events().publish( diff --git a/src/state_snapshot.rs b/src/state_snapshot.rs index 10871bc..f5d0ef3 100644 --- a/src/state_snapshot.rs +++ b/src/state_snapshot.rs @@ -539,7 +539,7 @@ pub fn export_state( caller.require_auth(); // Verify backup exists - let backup: AutomatedBackup = env + let _backup: AutomatedBackup = env .storage() .persistent() .get(&SnapshotKey::AutomatedBackup(backup_id)) @@ -593,7 +593,7 @@ pub fn restore_from_backup( .ok_or(SnapshotError::SnapshotNotFound)?; // Verify backup exists - let backup: AutomatedBackup = env + let _backup: AutomatedBackup = env .storage() .persistent() .get(&SnapshotKey::AutomatedBackup(metadata.backup_id)) diff --git a/src/sustainability_metrics.rs b/src/sustainability_metrics.rs index 81b1050..9deb38f 100644 --- a/src/sustainability_metrics.rs +++ b/src/sustainability_metrics.rs @@ -1,4 +1,4 @@ -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Vec, BytesN}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env}; const WEEKLY_GAS_THRESHOLD: u64 = 10_000; const CO2_PER_GAS: u64 = 42; // 42 gCO2 per gas unit approximated diff --git a/src/theme_customizer.rs b/src/theme_customizer.rs index 1361b63..824019d 100644 --- a/src/theme_customizer.rs +++ b/src/theme_customizer.rs @@ -1,4 +1,4 @@ -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, String, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec}; #[contracterror] #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] diff --git a/src/trading.rs b/src/trading.rs index 8a404dc..d5d07d5 100644 --- a/src/trading.rs +++ b/src/trading.rs @@ -5,7 +5,7 @@ //! Stop-loss orders are modelled as sell-side limit orders and executed //! by an off-chain keeper that calls `cancel_limit_order` + market sell. -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Map, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec}; use crate::reentrancy_guard::{with_guard, ReentrancyError}; @@ -170,7 +170,7 @@ pub fn cancel_limit_order(env: &Env, trader: &Address, order_id: u64) -> Result< .remove(&TradingKey::Order(order_id)); // Remove from trader's order list - let mut ids: Vec = env + let ids: Vec = env .storage() .persistent() .get(&TradingKey::TraderOrders(trader.clone())) diff --git a/src/yield_forecast.rs b/src/yield_forecast.rs index 965d9e2..c2e278a 100644 --- a/src/yield_forecast.rs +++ b/src/yield_forecast.rs @@ -1,4 +1,4 @@ -use soroban_sdk::{contracterror, contracttype, symbol_short, Address, BytesN, Env, Symbol, Vec}; +use soroban_sdk::{contracterror, contracttype, symbol_short, Address, Env, Symbol, Vec}; // ─── Configuration ───────────────────────────────────────────────────────── @@ -345,7 +345,7 @@ fn get_recent_data( } /// Calculate simple moving average. -fn calculate_moving_average(env: &Env, data: &Vec) -> i128 { +fn calculate_moving_average(_env: &Env, data: &Vec) -> i128 { if data.is_empty() { return 0; } @@ -361,7 +361,7 @@ fn calculate_moving_average(env: &Env, data: &Vec) -> i128 { } /// Calculate trend (average daily change). -fn calculate_trend(env: &Env, data: &Vec) -> i128 { +fn calculate_trend(_env: &Env, data: &Vec) -> i128 { if data.len() < 2 { return 0; } @@ -395,7 +395,7 @@ fn calculate_trend(env: &Env, data: &Vec) -> i128 { } /// Calculate volatility (standard deviation approximation). -fn calculate_volatility(env: &Env, data: &Vec) -> i128 { +fn calculate_volatility(_env: &Env, data: &Vec) -> i128 { if data.len() < 2 { return 0; }