This guide covers everything needed to build, test, and run TaskBounty locally.
- Prerequisites
- Repository Setup
- Smart Contract Development
- Frontend Development
- Testing
- Deploying to Testnet
- IDE Configuration
- Troubleshooting
| Tool | Version | Install |
|---|---|---|
| Rust | stable (≥ 1.74) | rustup.rs |
| wasm32 target | — | rustup target add wasm32-unknown-unknown |
| Stellar CLI | ≥ 21.0 | cargo install --locked stellar-cli --features opt |
| Node.js | ≥ 18 | nodejs.org |
| pnpm | ≥ 8 | npm install -g pnpm |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Add WebAssembly compile target
rustup target add wasm32-unknown-unknowncargo install --locked stellar-cli --features opt
# Verify
stellar --versiongit clone https://github.com/<org>/Task-Bounty.git
cd Task-BountyThe contract lives in contract/contracts/hello-world/src/.
cd contract
stellar contract buildOutput: target/wasm32-unknown-unknown/release/hello_world.wasm
stellar contract optimize \
--wasm target/wasm32-unknown-unknown/release/hello_world.wasmcontract/contracts/hello-world/src/
├── lib.rs # Public contract API & entry points
├── types.rs # Task, Submission, Dispute, Error enums/structs
├── storage.rs # Storage key helpers (get/set wrappers)
├── task.rs # create_task, cancel_task logic
├── submission.rs # submit_work, approve_submission, reject_submission
├── dispute.rs # raise_dispute logic
├── events.rs # Event emission helpers
└── test.rs # Integration tests
The frontend is a Next.js app in frontend/.
cd frontend
pnpm install
pnpm devOpen http://localhost:3000.
Copy the example env file:
cp "Documents/Task Bounty/.env.example" frontend/.env.localKey variables:
NEXT_PUBLIC_CONTRACT_ID= # Deployed contract address
NEXT_PUBLIC_NETWORK=testnet # testnet or mainnet
NEXT_PUBLIC_RPC_URL=https://soroban-testnet.stellar.orgpnpm buildcd contract
cargo test # Run all tests
cargo test -- --nocapture # With stdout output
cargo test test_create_task # Single test by name
cargo test -- --test-threads=1 # Serial (for debugging)Tests are in contract/contracts/hello-world/src/test.rs and use the Soroban test environment (soroban_sdk::testutils).
cd frontend
pnpm lintstellar keys generate dev-account --network testnetstellar keys fund dev-account --network testnet
# Or: curl https://friendbot.stellar.org?addr=<PUBLIC_KEY>cd contract
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/hello_world.wasm \
--source dev-account \
--network testnetSave the returned contract ID.
stellar contract invoke \
--id <CONTRACT_ID> \
--source dev-account \
--network testnet \
-- \
initialize \
--dispute_resolver <DISPUTE_RESOLVER_ADDRESS> \
--admin <ADMIN_ADDRESS># Create a task
stellar contract invoke \
--id <CONTRACT_ID> \
--source dev-account \
--network testnet \
-- \
create_task \
--poster <POSTER_ADDRESS> \
--title "Build something" \
--description "Full description here" \
--token <TOKEN_ADDRESS> \
--reward 1000000000 \
--deadline 1780000000 \
--max_submissions 3
# Read a task
stellar contract invoke \
--id <CONTRACT_ID> \
--source dev-account \
--network testnet \
-- \
get_task \
--task_id 1stellar contract bindings typescript \
--contract-id <CONTRACT_ID> \
--network testnet \
--output-dir frontend/src/lib/contract-bindingsRecommended extensions:
rust-lang.rust-analyzervadimcn.vscode-lldbbungcip.better-toml
The project already has .vscode/settings.json. If you need to add Rust analyzer settings:
{
"rust-analyzer.cargo.target": "wasm32-unknown-unknown",
"rust-analyzer.checkOnSave.allTargets": false
}Stellar CLI is not in PATH after cargo install.
export PATH="$HOME/.cargo/bin:$PATH"
# Add to ~/.bashrc or ~/.zshrc to persistWebAssembly target is missing.
rustup target add wasm32-unknown-unknownYou're compiling for WASM without the no_std attribute, or the target wasn't added.
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --releasecd contract
cargo clean
stellar contract buildYour test account needs XLM.
stellar keys fund dev-account --network testnetRun with --nocapture to see the panic message:
cargo test -- --nocapture 2>&1 | head -50Ensure you're using Node.js 18+ and pnpm 8+:
node --version # should be >= 18
pnpm --version # should be >= 8# Contract
stellar contract build # Build
cargo test # Test
cargo clippy -- -D warnings # Lint
cargo fmt # Format
stellar contract inspect --wasm <WASM_FILE> # Inspect ABI
# Network
stellar keys generate <name> --network testnet
stellar keys fund <name> --network testnet
stellar contract deploy --wasm <FILE> --source <KEY> --network testnet
stellar contract invoke --id <ID> --source <KEY> --network testnet -- <FN> <ARGS>
# Frontend
pnpm dev # Dev server
pnpm build # Production build
pnpm lint # Lint