Contract 70136467ec2a84c642f6b84447b3b7601117e0e3cbe3e81157b417aee8a0f660

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.87.0

Instances

  • CAPWMQPORH3MQNVMTBBYQUERP2TQNRUCEH5G5HMX2BTGZ7DH5FMA5EFU
  • CBMRTRDKZEY3XNIG52VLEVC7FGNC2C6AW2AD6IXF6PA76TRZ6CIMCFRQ
  • CCBPTHDYOGMXHXZ3WCODH3672FYJBTEX4QTR3WIZOPTPZAWV4B7YJUYN

Interface

Extends the time-to-live (TTL) of the contract instance and its data

fn extend_ttl(env: soroban_sdk::Env)

Initializes a new campaign with the provided data

Arguments

  • e - The environment
  • sender - The address of the sender who must be authorized
  • campaign_data - The campaign configuration data

Panics

  • If the campaign is already initialized
  • If the start date is in the past
fn init(
    env: soroban_sdk::Env,
    sender: soroban_sdk::Address,
    campaign_data: CampaignData,
)

Claims a reward for completing a task

Arguments

  • e - The environment
  • influencer - The address of the influencer claiming the reward
  • task_id - The ID of the completed task
  • reward - The amount of reward to claim

Panics

  • If the campaign hasn't started
  • If the task ID is invalid
  • If the total reward would exceed campaign limit
  • If the reward amount is invalid
fn claim_reward(
    env: soroban_sdk::Env,
    influencer: soroban_sdk::Address,
    task_id: u32,
    reward: i128,
)

Gets the reward claimed for a specific task

fn get_task_reward(env: soroban_sdk::Env, task_id: u32) -> i128

Gets the remaining reward that can still be claimed

fn get_remaining_reward(env: soroban_sdk::Env) -> i128

Gets the campaign data

fn campaign_data(env: soroban_sdk::Env) -> CampaignData

Imports

WebAssembly Text (WAT) ▶