#[repr(C)]pub struct SocialClaimData {
pub post_url: [u8; 256],
pub oracle_signature: [u8; 64],
pub post_timestamp: [u8; 8],
pub engagement_score: [u8; 4],
pub _padding: [u8; 4],
}
Expand description
Social claim data for social media engagement rewards.
This struct contains the data required for claiming social marketing rewards. Social rewards require payment activity in the same epoch and are verified through oracle signatures to prevent gaming.
§Data Structure
struct SocialClaimData {
post_url: String, // Social media post URL
oracle_signature: [u8; 64], // Oracle verification signature
engagement_score: u32, // Future: engagement-based rewards
post_timestamp: i64, // When post was made
_padding: [u8; 4], // For future extensibility
}
§Oracle Signature Message Format
The oracle must sign a message with this format:
epoch:user_pubkey:post_url:engagement_score:post_timestamp
Example: "100:ABC123...:https://twitter.com/user/123:500:1640995200"
This format prevents replay attacks by including epoch and user context.
§Verification Requirements
- Payment activity required in same epoch
- Oracle signature verification
- Daily limits enforcement
- Content requirements (#MiracleRewards, @MiracleProtocol)
§Anti-Gaming Measures
- Daily limits per user (max 3 posts per day)
- Payment requirement ensures real users
- Oracle verification prevents fake posts
- Content requirements ensure quality engagement
- Epoch-specific signatures prevent replay attacks
Fields§
§post_url: [u8; 256]
Social media post URL for verification. Must contain required hashtags and mentions.
oracle_signature: [u8; 64]
Oracle signature for post verification. This signature validates that the post meets requirements.
post_timestamp: [u8; 8]
Timestamp when the post was made. Used for daily limit calculations and verification.
engagement_score: [u8; 4]
Engagement score for future tiered rewards. Currently unused, reserved for future engagement-based rewards.
_padding: [u8; 4]
Padding for future extensibility. Reserved for additional social claim features.
Implementations§
Source§impl SocialClaimData
impl SocialClaimData
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, &'static str>
pub fn from_bytes(data: &[u8]) -> Result<Self, &'static str>
Deserialize from bytes manually
Trait Implementations§
Source§impl Clone for SocialClaimData
impl Clone for SocialClaimData
Source§fn clone(&self) -> SocialClaimData
fn clone(&self) -> SocialClaimData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SocialClaimData
impl Debug for SocialClaimData
impl Copy for SocialClaimData
impl Pod for SocialClaimData
Auto Trait Implementations§
impl Freeze for SocialClaimData
impl RefUnwindSafe for SocialClaimData
impl Send for SocialClaimData
impl Sync for SocialClaimData
impl Unpin for SocialClaimData
impl UnwindSafe for SocialClaimData
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