💰Reward
The data structure representing a request is defined as follows:
#[account]
pub struct Reward {
pub authority: Pubkey,
pub marketplace: Pubkey,
pub reward_vaults: Vec<Pubkey>,
pub bumps: RewardBumps,
}
The Request
struct contains the following components:
authority
: The public key of the account having authority over the reward PDA.marketplace
: The public key of the associated marketplace, used to derive the reward PDA in the context.reward_vaults
: Safely holds reward tokens until promotions conclude, enabling user withdrawals. Users can establish up to five vaults with different mints. An initial vault is created in init_reward instruction, while changes in user reward mints require their approval via init_bounty. Note: To send rewards, marketplace.reward_mint has to be equal to product.payment_mint.
Seller Configuration
The SellerConfig
struct contains configurations defined by the seller for the product:
pub struct RewardBumps {
pub bump: u8,
pub vault_bumps: Vec<u8>,
}
Last updated