Contract fb5eaa7baa29810c21731200d501e22a6f308d413214f4e131860d0ca290946f

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.91.1

Instances

  • CDWMA24IREKTSX25VT27HZFUAQE5PZNDY2EGW56JH6M2GID4UZNWHHJU

Interface

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>

Release the full bounty to contributor, authorized by the escrow creator. The contributor does not need to be pre-assigned: the payout target is supplied here and recorded on settlement.

fn release(
    env: soroban_sdk::Env,
    task_id: soroban_sdk::String,
    contributor: soroban_sdk::Address,
) -> 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

Set the emergency pause state Can only be called by admin

fn set_paused(env: soroban_sdk::Env, paused: bool) -> Result<(), soroban_sdk::Error>

Refund the full bounty to the escrow creator with admin authority. Unlike refund(), this is allowed even after a contributor was assigned (the admin is the arbiter); funds always go back to the creator. No pause check: refunds must remain possible during an emergency pause.

fn admin_refund(
    env: soroban_sdk::Env,
    task_id: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>

Split-settle an escrow with admin authority: pay contributor_amount to contributor and refund the remainder (if any) to the creator, then mark the task Completed. Works from Open or InProgress — the admin is the platform arbiter, mirroring admin_release/admin_refund (which cover the full-pay and full-refund outcomes; this adds the partial split). No pause check: admin operations bypass pause, matching resolve_dispute.

fn admin_settle(
    env: soroban_sdk::Env,
    task_id: soroban_sdk::String,
    contributor: soroban_sdk::Address,
    contributor_amount: i128,
) -> 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>

Deploy-time constructor: sets admin + USDC token atomically with the deploy itself.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    usdc_token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Release the full bounty to contributor with admin authority. No pause check: admin operations bypass pause, matching resolve_dispute.

fn admin_release(
    env: soroban_sdk::Env,
    task_id: soroban_sdk::String,
    contributor: soroban_sdk::Address,
) -> 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

Imports

WebAssembly Text (WAT) ▶