Emergency stop: block release_to_winner and post_task. Admin-only.
Refunds remain available so posters can always exit. Intended for a
suspected verdict-key compromise while the key is rotated.
fn pause(env: soroban_sdk::Env)
Refund the reward to the poster.
deadline + settle_grace this is a
poster-authorized cancel; after it, permissionless.deadline + settle_grace
so the platform can settle to a winner without being front-run; after
the window it is permissionless.fn refund(env: soroban_sdk::Env, task_id: u64) -> Result<(), soroban_sdk::Error>
Lift the emergency stop. Admin-only.
fn unpause(env: soroban_sdk::Env)
Mark a task Active (admin records the first agent submission).
fn activate(env: soroban_sdk::Env, task_id: u64) -> Result<(), soroban_sdk::Error>
fn get_task(env: soroban_sdk::Env, task_id: u64) -> Option
Lock a task's USDC reward in escrow. Pulls reward from the poster's
account into the contract via the USDC SAC. Requires the poster's auth.
fn post_task(
env: soroban_sdk::Env,
poster: soroban_sdk::Address,
task_id: u64,
reward: i128,
deadline: u64,
) -> Result<(), soroban_sdk::Error>
fn get_config(env: soroban_sdk::Env) -> Config
One-time constructor: wires the USDC SAC, the verdict-authority public key, the pass threshold, and the post-deadline settlement grace window.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
usdc_sac: soroban_sdk::Address,
verdict_pubkey: soroban_sdk::BytesN<32>,
pass_threshold: u32,
settle_grace: u64,
)
Flag a completed task as disputed (state stub; full Agent Court resolution is a later deliverable). Admin-authorized.
fn flag_disputed(env: soroban_sdk::Env, task_id: u64) -> Result<(), soroban_sdk::Error>
Release the reward to the winning agent on a verified judge verdict.
Anyone may submit the transaction, but only a signature from the verdict
authority over the canonical (task_id, winner, score, nonce) message
— with score >= pass_threshold — moves the funds.
fn release_to_winner(
env: soroban_sdk::Env,
task_id: u64,
winner: soroban_sdk::Address,
score: u32,
nonce: u64,
signature: soroban_sdk::BytesN<64>,
) -> Result<(), soroban_sdk::Error>
Rotate the verdict-authority public key (e.g. after a key compromise) without redeploying. Admin-only. Existing signatures over the old key stop verifying immediately.
fn set_verdict_pubkey(env: soroban_sdk::Env, new_pubkey: soroban_sdk::BytesN<32>)