Soroban smart contracts for the Credence economic trust protocol. This workspace holds the identity bond contract (lock USDC, track duration, slashing hooks).
Part of Credence. Contracts run on the Stellar network via Soroban. The bond contract is the source of truth for staked amounts and is consumed by the backend reputation engine.
- Rust 1.84+ (with
wasm32-unknown-unknown:rustup target add wasm32-unknown-unknown) - Soroban CLI (
cargo install soroban-cli)
From the repo root:
cd credence-contracts
cargo buildFor Soroban (WASM) build:
cargo build --target wasm32-unknown-unknown --release -p credence_bondcargo test -p credence_bondcontracts/credence_bond/— Identity bond contractcreate_bond()— lock USDC (stub: stores amount and duration)get_identity_state()— return current bond for this instance
A full implementation would add:
- Token transfer (USDC) on
create_bond/increase_bond/withdraw_bond slash_bond()with governance checksadd_attestation()/revoke_attestation()- Per-identity storage (e.g. by
Addresskey) instead of a single bond
Configure network and deploy:
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/credence_bond.wasm \
--source <SECRET_KEY> \
--network <NETWORK>See Stellar Soroban docs for auth and network setup.