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
e - The environmentsender - The address of the sender who must be authorizedcampaign_data - The campaign configuration datafn init(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
campaign_data: CampaignData,
) -> ()
Claims a reward for completing a task
e - The environmentinfluencer - The address of the influencer claiming the rewardtask_id - The ID of the completed taskreward - The amount of reward to claimfn claim_reward(
env: soroban_sdk::Env,
influencer: soroban_sdk::Address,
task_id: soroban_sdk::String,
reward: i128,
) -> ()
Gets the reward claimed for a specific task
fn get_task_reward(env: soroban_sdk::Env, task_id: soroban_sdk::String) -> 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
Transfers remaining funds from the contract to the admin after campaign ends or immediately if the campaign is frozen
e - The environmentadmin - The admin address who must be authorizedfn transfer_remaining_funds(env: soroban_sdk::Env, admin: soroban_sdk::Address) -> ()
Extends the campaign duration (admin only)
e - The environmentadmin - The admin address who must be authorizedadditional_duration - Additional duration in seconds to addfn extend_duration(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
additional_duration: u64,
) -> ()
Toggles the campaign frozen state (admin only)
e - The environmentadmin - The admin address who must be authorizedfrozen - The desired frozen state (true to freeze, false to unfreeze)fn toggle_freeze(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
frozen: bool,
) -> ()
Claims collected fees (admin only)
e - The environmentadmin - The admin address who must be authorizedfn claim_fees(env: soroban_sdk::Env, admin: soroban_sdk::Address) -> ()
Sets the fee percentage (admin only)
e - The environmentadmin - The admin address who must be authorizedfee_percentage - The fee percentage in basis points (e.g., 100 = 1%)fn set_fee_percentage(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
fee_percentage: u32,
) -> ()
Gets the total collected fees
fn get_collected_fees_public(env: soroban_sdk::Env) -> i128
Adds more rewards to an existing campaign (admin only)
e - The environmentadmin - The admin address who must be authorizedadditional_reward - The amount of additional reward to addfn add_rewards(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
additional_reward: i128,
) -> ()