Process refund for a cancelled task Can only be called by the task creator when no contributor is assigned
fn refund(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Upgrade the contract to new WASM bytecode Can only be called by admin
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Get contract version
fn version(env: soroban_sdk::Env) -> u64
Get the current admin address
fn get_admin(env: soroban_sdk::Env) -> Result
Transfer admin privileges to a new address Can only be called by current admin
fn set_admin(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Get escrow information for a specific task
fn get_escrow(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
) -> Result
Initialize the contract with admin and USDC token addresses This function can only be called once during contract deployment
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
usdc_token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Set the emergency pause state Can only be called by admin
fn set_paused(env: soroban_sdk::Env, paused: bool) -> Result<(), soroban_sdk::Error>
Initiate a dispute for a task Can be called by either the task creator or assigned contributor
fn dispute_task(
env: soroban_sdk::Env,
disputing_party: soroban_sdk::Address,
task_id: soroban_sdk::String,
reason: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Create a new escrow for a task with locked USDC funds Transfers USDC from creator to contract and creates escrow record
fn create_escrow(
env: soroban_sdk::Env,
creator: soroban_sdk::Address,
task_id: soroban_sdk::String,
issue_url: soroban_sdk::String,
bounty_amount: i128,
) -> Result<(), soroban_sdk::Error>
Get the USDC token contract address
fn get_usdc_token(
env: soroban_sdk::Env,
) -> Result
Decrease the bounty amount for an existing task
fn decrease_bounty(
env: soroban_sdk::Env,
creator: soroban_sdk::Address,
task_id: soroban_sdk::String,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Increase the bounty amount for an existing task
fn increase_bounty(
env: soroban_sdk::Env,
creator: soroban_sdk::Address,
task_id: soroban_sdk::String,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Resolve a dispute with admin authority Can only be called by admin when task is in Disputed status
fn resolve_dispute(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
resolution: DisputeResolution,
) -> Result<(), soroban_sdk::Error>
Get dispute information for a specific task Returns comprehensive dispute details for admin and parties
fn get_dispute_info(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
) -> Result
Get the balance of USDC tokens for a specific address Returns the balance in stroops (7 decimal places for USDC)
fn get_usdc_balance(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
) -> Result
Update the USDC token contract address Can only be called by admin (useful for token contract upgrades or migrations)
fn update_usdc_token(
env: soroban_sdk::Env,
new_usdc_token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Approve task completion and release funds to contributor Can only be called by the task creator when task is in InProgress status
fn approve_completion(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Assign a contributor to a task Can only be called by the task creator when task is in Open status
fn assign_contributor(
env: soroban_sdk::Env,
task_id: soroban_sdk::String,
contributor: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Get detailed USDC token information for debugging and validation Returns token contract address and basic validation status
fn get_usdc_token_info(
env: soroban_sdk::Env,
) -> Result<(soroban_sdk::Address, bool), soroban_sdk::Error>
Get the contract's current USDC balance Useful for monitoring and validation purposes
fn get_contract_usdc_balance(env: soroban_sdk::Env) -> Result
Check if an address has sufficient USDC balance for a specific amount Returns true if balance >= required_amount, false otherwise
fn has_sufficient_usdc_balance(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
required_amount: i128,
) -> Result
Validate that the USDC token contract is properly set and accessible Performs a basic validation by attempting to create a client
fn validate_usdc_token_contract(
env: soroban_sdk::Env,
) -> Result