Contract 8c55c430ea3f2bdec5192d0d3b1f5f23571e4a7e1e10f7abfee3eb65129a2911

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.7#211569aa49c8d896877dfca1f2eb4fe9071121c8
rsver 1.81.0

Instances

  • CDOJXPCOVHGP7SVP7DR3ZADXKQ7D3KSW3ISRXCROPXJ3MOAAG7HFTJ7T

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