Contract bed32b8746d854ac565596a6e3a68ba0ea67f8e476254696e89e7ac5d1d259f9

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CC5FPB2GRKLYAHA77NMZML7CQKKZYFDCSTQAPSBD7IRWT3BKL7BW3M5F

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) ▶