Label: complexity: high
Points: 200
Description
creation_fee goes straight to treasury and is never returned, but there's no refundable deposit mechanism that gets slashed only on bad behavior (e.g. creating an invoice that's cancelled within minutes). This issue adds an optional refundable anti-spam deposit.
Technical Context
Involves lib.rs — set_spam_deposit(env, admin, amount: i128, min_age_secs: u64); create_invoice() charges the deposit into contract custody; cancel_invoice() returns it only if now - created_at >= min_age_secs, otherwise it's slashed to treasury.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
creation_feegoes straight to treasury and is never returned, but there's no refundable deposit mechanism that gets slashed only on bad behavior (e.g. creating an invoice that's cancelled within minutes). This issue adds an optional refundable anti-spam deposit.Technical Context
Involves
lib.rs—set_spam_deposit(env, admin, amount: i128, min_age_secs: u64);create_invoice()charges the deposit into contract custody;cancel_invoice()returns it only ifnow - created_at >= min_age_secs, otherwise it's slashed to treasury.Acceptance Criteria
creation_fee, held by the contract (not treasury) until resolvedmin_age_secsreturns the full deposit to the creatormin_age_secssends the deposit to treasury instead0(default) disables the feature entirelycargo clippypasses with zero warnings