Enterprise-grade decentralized task management protocol with escrow, governance, and reputation system on the Stellar Network.
LatterFix (TaskManager Pro) is a decentralized platform designed to redefine how organizations and independent builders collaborate. By replacing trust-based arrangements with automated, secure, and verifiable smart contract workflows, LatterFix ensures that contributors get paid for their verified contributions while creators get the quality deliverables they expect.
- Decentralized Escrows & Milestones: Funds are locked in a secure smart contract when tasks are created. Payments can be released incrementally through predefined milestones or fully upon total task verification.
- On-Chain Reputation System: Every contributor has a dynamically adjusted reputation score. Reputation grows with successful task completions and milestone approvals, and drops with cancellations or lost disputes.
- Decentralized Governance: Platform parameters and configurations are governed by the community. Proposal weight is tied directly to users' on-chain reputation scores, encouraging positive participation.
- Built-in Dispute Resolution: If disputes arise during the delivery cycle, platform administrators or delegated moderators can mediate and split the escrowed funds fairly based on the evidence provided.
This repository contains the Soroban smart contract powering the LatterFix TaskManager Pro platform. The contract implements a complete decentralized escrow workflow — locking task rewards on-chain, routing platform fees, milestone-based payments, dispute resolution, governance, and a comprehensive reputation system.
| Module | File | Description |
|---|---|---|
| Core | lib.rs |
Main contract with task lifecycle, escrow integration, and entry points |
| Access Control | access_control.rs |
Role-based access control (RBAC) system |
| Escrow | escrow.rs |
Milestone-based payment escrow management |
| Events | events.rs |
Standardized event emission for off-chain indexing |
| Governance | governance.rs |
Proposal and voting system for protocol decisions |
| Pausable | pausable.rs |
Emergency pause functionality per action type |
| Reputation | reputation.rs |
User reputation and tier system |
| Storage | storage.rs |
Storage optimization and TTL management utilities |
| User Profile | user_profile.rs |
User profiles with reputation tracking |
- Create tasks with escrowed rewards
- Milestone-based task breakdown
- Task assignment and submission workflow
- Verification and completion process
- Cancellation with automatic refunds
- Dispute resolution by admin
- Lock tokens on task creation
- Milestone-based payments
- Partial releases per approved milestone
- Statistics tracking (locked, released, refunded)
- Points-based reputation (starting: 100)
- Tier levels: Newcomer → Contributor → Expert → Master → Legend
- Points awarded for completed tasks, verified work, milestones
- Penalties for cancellations and lost disputes
- Global leaderboard
- Create proposals (requires minimum reputation)
- Vote on proposals (weight based on reputation)
- Quorum and threshold requirements
- Execute passed proposals
- Role-based permissions (Admin, Manager, Moderator, Verifier)
- Grant/revoke roles
- Permission-gated operations
- Pause/unpause specific actions
- Emergency circuit breaker
- Admin-only control
fn initialize(
env: Env,
admin: Address,
platform_fee_bps: u32, // Platform fee in basis points (max 10%)
token_contract: Address, // Stellar token contract address
fee_recipient: Address, // Address to receive platform fees
)| Method | Description |
|---|---|
create_task(creator, title, description, reward, tags) |
Create a new task with escrowed reward |
create_task_with_milestones(creator, title, description, milestones, tags) |
Create task with milestone breakdown |
assign_task(assignee, task_id) |
Claim an open task |
submit_work(assignee, task_id, delivery_url) |
Submit completed work |
complete_task(caller, task_id) |
Approve and release payment |
cancel_task(creator, task_id) |
Cancel and refund |
dispute_task(caller, task_id) |
Raise a dispute |
resolve_dispute(admin, task_id, creator_refund, assignee_payout) |
Admin resolves dispute |
get_task(task_id) |
Get task details |
| Method | Description |
|---|---|
submit_milestone(assignee, task_id, milestone_id, submission_url) |
Submit milestone work |
approve_milestone(caller, task_id, milestone_id, feedback) |
Approve and release milestone payment |
reject_milestone(caller, task_id, milestone_id, feedback) |
Reject milestone |
get_milestones(task_id) |
Get all milestones for a task |
| Method | Description |
|---|---|
create_profile(user, username, bio) |
Create user profile |
update_bio(user, new_bio) |
Update biography |
get_profile(user) |
Get profile data |
| Method | Description |
|---|---|
get_user_reputation(user) |
Get reputation points |
get_user_tier(user) |
Get current tier |
get_leaderboard() |
Get top users by reputation |
| Method | Description |
|---|---|
create_proposal(proposer, title, description) |
Create a new proposal |
cast_vote(voter, proposal_id, vote_type) |
Vote on a proposal |
execute_proposal(caller, proposal_id) |
Execute a passed proposal |
get_proposal(proposal_id) |
Get proposal details |
get_active_proposals() |
Get all active proposals |
| Method | Description |
|---|---|
grant_role(admin, user, role) |
Grant a role to user |
revoke_role(admin, user) |
Revoke user's role |
has_role(user, role) |
Check if user has role |
| Method | Description |
|---|---|
pause(admin, action) |
Pause specific action |
unpause(admin, action) |
Unpause specific action |
pause_all(admin) |
Pause all actions |
unpause_all(admin) |
Unpause all actions |
pub struct Task {
pub id: u32,
pub title: String,
pub description: String,
pub reward: i128,
pub assignee: Option<Address>,
pub status: TaskStatus,
pub created_by: Address,
pub tags: Vec<String>,
pub category_id: Option<u32>,
pub deadline: Option<u64>,
pub created_at: u64,
pub updated_at: u64,
}Open → InProgress → Completed → Verified
│ │ │
└─────────┴────────────┴──────── Cancelled / Disputed → Resolved
pub struct Milestone {
pub id: u32,
pub task_id: u32,
pub title: String,
pub amount: i128,
pub status: MilestoneStatus,
pub due_date: Option<u64>,
pub submission_url: Option<String>,
pub feedback: Option<String>,
}pub struct UserProfile {
pub address: Address,
pub username: String,
pub reputation: u32,
pub completed_tasks: u32,
pub joined_at: u64,
pub bio: String,
}| Tier | Points Range |
|---|---|
| Newcomer | 0 - 99 |
| Contributor | 100 - 499 |
| Expert | 500 - 999 |
| Master | 1000 - 2499 |
| Legend | 2500+ |
The contract emits standardized events for off-chain indexing:
task_created- New task createdtask_assigned- Task claimed by assigneetask_submitted- Work submittedtask_completed- Task verified and paidtask_cancelled- Task cancelledtask_disputed- Dispute raisedmilestone_*- Milestone lifecycle eventsprop_created- Governance proposal createdvote_cast- Vote recordedrole_grant/role_revoke- Role changespaused/unpaused- Pause state changes
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Add WebAssembly target
rustup target add wasm32-unknown-unknown
# Install Stellar CLI
cargo install --locked stellar-clicargo testcargo build --target wasm32-unknown-unknown --releasestellar contract build# Configure testnet
stellar network add testnet \
--rpc-url https://soroban-testnet.stellar.org:443 \
--network-passphrase "Test SDF Network ; September 2015"
# Deploy
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/task_manager_pro.wasm \
--network testnet \
--source <your-account>The repository includes an automated background bot (tooling/ttl_bot.py) to track contract storage TTL and send bump transactions before expiration.
1. Install Dependencies
pip install stellar-sdk>=9.0.0 requests2. Run the Bot
python3 tooling/ttl_bot.py \
--secret-key "<YOUR_SECRET_KEY>" \
--contract-ids "<CONTRACT_ID_1>,<CONTRACT_ID_2>" \
--interval 3600Bot Options:
--dry-run: Run without actually sending transactions.--threshold: TTL threshold in ledgers to trigger renewal (default:10000).--extend-to: Number of ledgers to extend the TTL to (default:50000).--min-balance: Minimum XLM balance for the bot wallet before alerting (default:10.0).--interval: Run continuously every N seconds (default:0, which means run once and exit).
- Re-entrancy: All state changes happen before external calls
- Access Control: Admin-only functions are protected by
require_auth - Overflow Protection: All arithmetic uses checked operations
- Pause Mechanism: Emergency stop capability for critical vulnerabilities
- Fee Limits: Platform fee capped at 10% (1000 basis points)
- Storage keys use minimal byte representation
- TTL management prevents storage churn
- Instance storage for frequently accessed data
- Persistent storage for user profiles and historical data
MIT License - See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Run tests:
cargo test - Submit a pull request
- Issues: GitHub Issues
- Discord: LatterFix Community
Built with ❤️ on Stellar/Soroban
