Skip to content
Open
Show file tree
Hide file tree
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
Empty file added cargo_search.txt
Empty file.
6 changes: 6 additions & 0 deletions contracts/batch_claim/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use soroban_sdk::contracterror;
/// | 5 | AlreadySettled | Claim has already been collected |
/// | 6 | InvalidAmount | Claim amount must be positive |
/// | 7 | Overflow | Arithmetic overflow in pending-amount accumulation|
/// | 8 | ClaimIdAlreadyUsed | The claim identifier has already been consumed |
/// | 9 | ClaimIdMismatch | Provided claim_id does not match stored record |
#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
Expand All @@ -29,4 +31,8 @@ pub enum BatchClaimError {
InvalidAmount = 6,
/// Arithmetic overflow in pending-amount accumulation (code 7).
Overflow = 7,
/// The claim identifier has already been consumed; replay rejected (code 8).
ClaimIdAlreadyUsed = 8,
/// The provided claim_id does not match the stored record (code 9).
ClaimIdMismatch = 9,
}
9 changes: 9 additions & 0 deletions contracts/batch_claim/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ pub fn event_claims_settled(env: &Env) -> Symbol {
pub fn event_claim_cancelled(env: &Env) -> Symbol {
Symbol::new(env, "claim_cancelled")
}

/// Returns the Symbol for the `"claim_consumed"` event topic.
///
/// Emitted when a claim identifier is permanently consumed (marked spent) by
/// [`crate::CalloraBatchClaim::batch_claim`]. Off-chain indexers can use this
/// event to track which identifiers are no longer replayable.
pub fn event_claim_consumed(env: &Env) -> Symbol {
Symbol::new(env, "claim_consumed")
}
Loading