Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions contracts/globe-wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use soroban_sdk::{
Vec,
};

/// Maximum assets per wallet — prevents unbounded O(n) scans.
const MAX_ASSETS: u32 = 50;

// ── Storage Keys ──────────────────────────────────────────────────────────────

Expand Down Expand Up @@ -787,7 +785,7 @@ impl GlobeWallet {

// ── Asset Registry ────────────────────────────────────────────────────────

/// Maximum assets a single user can whitelist.
/// Maximum assets a single user can whitelist — prevents unbounded O(n) scans.
/// Chosen to stay well within Soroban per-contract storage (∼100 KB):
/// each entry is ∼200 bytes → ∼50 entries ≈ 10 KB, far below the ∼100 KB ceiling.
pub const MAX_ASSETS: u32 = 50;
Expand Down Expand Up @@ -1132,7 +1130,7 @@ mod tests {
}

fn fill_to_max(env: &Env, client: &GlobeWalletClient, user: &Address) {
for i in 0..MAX_ASSETS {
for i in 0..GlobeWallet::MAX_ASSETS {
let code = make_code(env, i);
let asset = AssetInfo { code, issuer: Some(Address::generate(env)) };
client.add_asset(user, &asset);
Expand Down