Skip to content
Merged
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
9 changes: 9 additions & 0 deletions contracts/chainsetttle/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ pub const DEFAULT_EMERGENCY_FREEZE_SUPERMAJORITY_BPS: u32 = 8_000;
/// dispute bond (#391) when the admin has not set a stricter cap via
/// `set_max_dispute_bond_bps`. 2000 = 20% of shipment value.
pub const DEFAULT_MAX_DISPUTE_BOND_BPS: u32 = 2_000;

/// Default supplier onboarding stake amount (can be configured by admin).
pub const DEFAULT_SUPPLIER_STAKE: i128 = 1_000_000;

/// Number of dispute losses before supplier stake is slashed (default 3).
pub const DEFAULT_DISPUTE_LOSS_THRESHOLD: u32 = 3;

/// Percentage of stake slashed per dispute loss (default 33.33% = 3333 bps).
pub const DEFAULT_SLASH_PERCENTAGE_BPS: u32 = 3_333;
19 changes: 19 additions & 0 deletions contracts/chainsetttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ pub struct Shipment {
/// Empty = not set (`None`). One entry = the reason.
/// (`Option<CancellationReason>` is not supported by Soroban `#[contracttype]`.)
pub cancellation_reason: Vec<CancellationReason>,

// ── New features ───────────────────────────────────────────
/// Configurable grace period (in ledgers) before late-delivery penalty accrual starts.
/// When set > 0, penalties only start counting from (deadline + grace_period_ledgers).
pub grace_period_ledgers: u32,
}

/// Cancellation policy stored separately (keeps Shipment within the contracttype field limit).
Expand Down Expand Up @@ -401,6 +406,10 @@ pub struct ShipmentOptions {
/// Optional jurisdiction/regulatory category (e.g. "US", "EU_MIFID") for
/// off-chain compliance filtering. Immutable after creation. None = untagged.
pub jurisdiction: Option<Symbol>,

// ── New features ───────────────────────────────────────────
/// Configurable grace period (in ledgers) before late-delivery penalty accrual starts.
pub grace_period_ledgers: u32,
}

/// Configuration for time-decayed dispute bonds.
Expand Down Expand Up @@ -1165,6 +1174,16 @@ pub enum DataKeyExt2 {
/// Active fee waiver granted to a partner address: (waiver_bps, expires_at
/// unix timestamp; 0 = no expiry).
FeeWaiver(Address),

// ── New Features ──────────────────────────────────────────────────────
/// KYC attestation hash for buyer addresses (32-byte hash).
BuyerKycHash(Address),
/// KYC attestation hash for supplier addresses (32-byte hash).
SupplierKycHash(Address),
/// Supplier onboarding stake amount locked (slashed on repeated disputes).
SupplierStake(Address),
/// Dispute loss count for slashing calculation (reset on successful periods).
SupplierDisputeLossCount(Address),
}

/// Partial joint-confirmation progress for a high-value shipment's milestone (#367).
Expand Down
Loading