A trustless, decentralized platform for posting tasks, submitting work, and managing bounty payments on the Stellar blockchain using Soroban smart contracts.
π― Problem Traditional bounty systems require trust in centralized platforms or intermediaries. Contributors risk not getting paid, and task posters have no guarantee of quality work. There's no transparent, trustless way to manage task-based payments.
β¨ Solution TaskBounty provides a Soroban smart contract system that:
Escrows funds when tasks are posted (using Stellar native assets or tokens) Enables transparent submission of work with IPFS/Arweave links Automates payouts upon approval Handles disputes through a decentralized arbitrator mechanism Aligns with Drips for direct contributor funding Low fees thanks to Stellar's efficient network Fast finality with 3-5 second confirmation times π Why Stellar? Low Transaction Costs: Fractions of a cent per transaction Fast Finality: 3-5 second confirmation times Built-in DEX: Native token support and atomic swaps Soroban: Modern Rust-based smart contracts with WebAssembly Scalability: Thousands of transactions per second Developer Friendly: Excellent tooling and documentation ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β Task Board β Create Task β Submit Work β Wallet Connect β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ
β Stellar Wallets Kit (RPC calls)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stellar Network (Soroban RPC) β
ββββββββββββ¬βββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββββββ βββββββββββββββββββββββββ
β TaskBounty β calls β DisputeResolver β
β Contract β ββββββββΊ β Contract β
β β β β
β β’ create_task β β β’ raise_dispute β
β β’ submit_work β β β’ resolve_dispute β
β β’ approve_submissionβ β β’ manage_arbitrators β
β β’ reject_submission β βββββββββββββββββββββββββ
β β’ cancel_task β
β β’ get_task β
β β’ get_submission β
ββββββββββββββββββββββββ
β
β token transfers via SAC interface
βΌ
ββββββββββββββββββββββββ
β Token Contract β
β (XLM / SAC token) β
β Escrowed rewards β
ββββββββββββββββββββββββ
βββββββββββ
β OPEN β βββ create_task() β reward escrowed
ββββββ¬βββββ
β submit_work()
βΌ
ββββββββββββββ
β IN PROGRESSβ
βββββββ¬βββββββ
βββββββββββββββ€
β β
βΌ βΌ
ββββββββββββ ββββββββββββ
β APPROVED β β REJECTED β
β (payout) β β (re-open)β
ββββββββββββ ββββββββββββ
β
β raise_dispute()
βΌ
ββββββββββββ
β DISPUTED β βββΊ DisputeResolver βββΊ COMPLETED or refund
ββββββββββββ
poster cancels anytime before approval
β
βΌ
ββββββββββββ
βCANCELLED β (reward refunded to poster)
ββββββββββββ
Poster Contract Token (SAC)
β β β
βββ create_task() βββββββΊβ β
β βββ transfer_from() βββΊβ escrow reward
ββββ task_id βββββββββββββ β
β β β
Contributor β β
βββ submit_work() βββββββΊβ β
ββββ submission_id βββββββ β
β β β
Poster β β
βββ approve_submission()βΊβ β
β βββ transfer() ββββββββΊβ pay contributor
β β emit Approved β
ββββ tx confirmed ββββββββ β
Contributor TaskBounty DisputeResolver Arbitrator
β β β β
βββ raise_dispute() βΊβ β β
β βββ forward dispute βββΊβ β
β β ββββ resolve() ββββββ
β β β (true/false) β
β ββββ resolution βββββββββ β
β β β β
β β if true: pay contrib β β
β β if false: refund poster β
Task-Bounty/
βββ contract/
β βββ contracts/
β βββ hello-world/ # Soroban contract
β βββ src/
β βββ lib.rs # Contract entry points & public API
β βββ types.rs # Task, Submission, Dispute, Error types
β βββ storage.rs # Storage key helpers
β βββ task.rs # Task creation & cancellation
β βββ submission.rs # Submit, approve, reject
β βββ dispute.rs # Dispute handling
β βββ events.rs # Event emission helpers
βββ frontend/ # Next.js frontend
β βββ src/
β βββ app/ # Next.js app router pages
β βββ components/ # Shared UI components
β βββ hooks/ # Stellar wallet integration
β βββ lib/ # Stellar RPC utilities
βββ CONTRIBUTING.md
βββ SETUP.md
βββ CONTRACT_API.md
βββ README.md
Key Features Task Posting: Create tasks with escrowed rewards (XLM or any Stellar token) Work Submission: Contributors submit IPFS/Arweave links to their work Approval System: Task posters review and approve/reject Auto Payout: Approved work triggers instant payment via Stellar Dispute Resolution: Decentralized arbitration for conflicts Multi-submission Support: Multiple contributors can compete Deadline Management: Time-based task expiration Token Flexibility: Support for XLM and any Stellar Asset Contract (SAC) token π Quick Start Prerequisites
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install --locked stellar-cli --features opt Installation
git clone cd task-bounty
stellar contract build Build
stellar contract build
stellar contract optimize --wasm target/wasm32-unknown-unknown/release/task_bounty.wasm Test
cargo test
cargo test -- --nocapture
cargo test test_create_task Deploy
stellar contract deploy
--wasm target/wasm32-unknown-unknown/release/task_bounty.wasm
--source <YOUR_SECRET_KEY>
--network testnet
stellar contract deploy
--wasm target/wasm32-unknown-unknown/release/task_bounty.wasm
--source <YOUR_SECRET_KEY>
--network mainnet
π Usage
Creating a Task
// Initialize contract
let contract_id = Address::from_string(&String::from_str(&env, "CONTRACT_ID"));
let client = TaskBountyClient::new(&env, &contract_id);
// Create task with 100 XLM reward client.create_task( &poster, &String::from_str(&env, "Build a DEX interface"), &String::from_str(&env, "Create a React frontend for Stellar DEX"), &token_address, // XLM or token address &1_000_000_000, // 100 XLM (7 decimals) &(env.ledger().timestamp() + 2_592_000), // 30 days &3 // max submissions ); Submitting Work // Submit work with IPFS link client.submit_work( &task_id, &contributor, &String::from_str(&env, "ipfs://QmXxxx..."), &String::from_str(&env, "Completed DEX interface with all features") ); Approving Submissions // Approve and automatically pay contributor client.approve_submission(&task_id, &submission_id, &poster); Handling Disputes // Raise a dispute client.raise_dispute( &task_id, &submission_id, &contributor, &String::from_str(&env, "Work meets all requirements") );
// Resolve dispute (arbitrator) dispute_client.resolve_dispute(&dispute_id, &arbitrator, &true); // true = favor contributor π§ How to Extend Add Reputation System // Track contributor reputation pub fn update_reputation(env: &Env, contributor: Address, positive: bool) { let mut rep = get_reputation(env, &contributor); if positive { rep += 1; } else if rep > 0 { rep -= 1; } set_reputation(env, &contributor, rep); } Add Milestone-Based Tasks #[contracttype] pub struct Milestone { pub description: String, pub reward: i128, pub completed: bool, }
pub fn create_milestone_task( env: Env, milestones: Vec ) -> u64 { // Implementation } Add Multi-Token Support Already built-in! TaskBounty supports:
XLM (Stellar's native token) Any Stellar Asset Contract (SAC) token Custom tokens deployed on Stellar Integration with Drips Protocol // Stream rewards over time pub fn stream_reward( env: &Env, contributor: Address, amount: i128, duration: u64 ) { // Configure streaming payment via Drips // Integration with Drips protocol on Stellar } π§ͺ Testing Tests cover:
β Task creation and escrow β Work submission β Approval and rejection flows β Automatic payouts β Dispute creation and resolution β Edge cases (expired tasks, double submissions, etc.) β Access control β Token transfers Run tests:
cargo test cargo test -- --nocapture # With output π Security Considerations Authorization: Uses Soroban's built-in require_auth() for access control Fund Safety: Escrow pattern with contract-held funds Deadline Enforcement: Timestamp-based validations Input Validation: Comprehensive checks on all parameters Atomic Operations: Stellar's transaction atomicity guarantees No Reentrancy: Soroban's execution model prevents reentrancy attacks π Gas Optimization (Fee Efficiency) Stellar advantages:
Fixed low fees: ~0.00001 XLM per operation Predictable costs: No gas price auctions Efficient execution: WebAssembly-based contracts Optimized storage: Compact data structures Typical costs:
Create Task: ~0.0001 XLM Submit Work: ~0.00005 XLM Approve Submission: ~0.0001 XLM Total workflow: < $0.001 USD Compare to Ethereum:
Ethereum: $5-50 per transaction Stellar: $0.0001 per transaction 50,000x cheaper! π£οΈ Roadmap Core task management Work submission and approval Dispute resolution Multi-token support Reputation system Milestone-based tasks Frontend dApp Drips Protocol integration Mobile app DAO governance π Network Information Testnet Network Passphrase: Test SDF Network ; September 2015 Horizon URL: https://horizon-testnet.stellar.org Friendbot: https://friendbot.stellar.org (get test XLM) Mainnet Network Passphrase: Public Global Stellar Network ; September 2015 Horizon URL: https://horizon.stellar.org π Resources Stellar Documentation Soroban Documentation Stellar CLI Rust Book π License MIT
π€ Contributing Contributions welcome! Please read CONTRIBUTING.md first.
π Contact GitHub: [Your GitHub] Discord: Stellar Discord Twitter: [Your Twitter] Built with β€οΈ on Stellar