#[repr(C)]pub struct RewardClaimedEvent {
pub customer_wallet: Pubkey,
pub epoch: u64,
pub reward_amount: u64,
pub customer_reward_pool: u64,
pub activity_count: u32,
pub total_customer_activity: u32,
pub merkle_root: [u8; 32],
pub timestamp: i64,
pub participant_type: u8,
pub _padding: [u8; 7],
}Expand description
Event emitted when a customer claims rewards.
This event provides complete transparency for reward calculations, allowing off-chain systems to verify that the on-chain calculation matches the expected transparent formula.
§Formula Verification
The event includes all data needed to verify the calculation: reward = (activity_count * customer_reward_pool) / total_customer_activity
§Usage
- Verify reward calculations match off-chain estimates
- Track reward distribution patterns
- Monitor claim activity and frequency
- Build reward transparency dashboards
- Audit reward distribution fairness
§Memory Layout
80 bytes total for complete transparency data.
Fields§
§customer_wallet: PubkeyCustomer wallet that claimed the reward.
epoch: u64Epoch number for the claim.
reward_amount: u64Final reward amount claimed in smallest token units. This is calculated on-chain using the transparent formula.
customer_reward_pool: u64Customer reward pool for this epoch. Used in the calculation: reward = (activity_count * customer_reward_pool) / total_customer_activity
activity_count: u32Number of activities performed by the customer. This is extracted from the Merkle proof and used in reward calculation.
total_customer_activity: u32Total customer activity for this epoch. Used in the calculation: reward = (activity_count * customer_reward_pool) / total_customer_activity
merkle_root: [u8; 32]Merkle root used for proof verification.
timestamp: i64Event timestamp (Unix timestamp).
participant_type: u8Participant type: 0 for customer, 1 for merchant. Used to distinguish between customer and merchant claims.
_padding: [u8; 7]Padding to ensure proper alignment (7 bytes to maintain 88-byte total size)
Implementations§
Source§impl RewardClaimedEvent
impl RewardClaimedEvent
pub fn from_bytes(data: &[u8]) -> &Self
Trait Implementations§
Source§impl Clone for RewardClaimedEvent
impl Clone for RewardClaimedEvent
Source§fn clone(&self) -> RewardClaimedEvent
fn clone(&self) -> RewardClaimedEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RewardClaimedEvent
impl Debug for RewardClaimedEvent
Source§impl Loggable for RewardClaimedEvent
impl Loggable for RewardClaimedEvent
Source§impl PartialEq for RewardClaimedEvent
impl PartialEq for RewardClaimedEvent
impl Copy for RewardClaimedEvent
impl Pod for RewardClaimedEvent
impl StructuralPartialEq for RewardClaimedEvent
Auto Trait Implementations§
impl Freeze for RewardClaimedEvent
impl RefUnwindSafe for RewardClaimedEvent
impl Send for RewardClaimedEvent
impl Sync for RewardClaimedEvent
impl Unpin for RewardClaimedEvent
impl UnwindSafe for RewardClaimedEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more