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
3 changes: 3 additions & 0 deletions src/base/errors.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,8 @@ pub mod Errors {

// Throw Error when Fee percent exceeds 100%
pub const PROTOCOL_FEE_PERCENTAGE_EXCEED: felt252 = 'Error: Fee percent exceeds 100%';

// Throw Error when Total amount must be > 0
pub const TOTAL_DONATION_AMOUNT: felt252 = 'Error: Total amount must be > 0';
}

18 changes: 18 additions & 0 deletions src/base/types.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ pub struct DistributionHistory {
pub timestamp: u64,
}

#[derive(Drop, Serde, Clone)]
pub struct DonationResult {
pub campaign_id: u256,
pub amount: u256,
pub success: bool,
pub donation_id: u256,
}

#[derive(Drop, starknet::Event)]
pub struct BatchDonationProcessed {
#[key]
pub donor: ContractAddress,
pub total_campaigns: u32,
pub successful_donations: u32,
pub total_amount: u256,
pub results: Array<DonationResult>,
}

#[derive(Copy, Drop, Serde, starknet::Store)]
pub struct StreamMetrics {
pub last_activity: u64,
Expand Down
Loading
Loading