Skip to content

thlpkee20-wq/Credence-Contracts

 
 

Repository files navigation

Credence Contracts

Soroban smart contracts for the Credence economic trust protocol. This workspace holds the identity bond contract (lock USDC, track duration, slashing hooks).

About

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.

Prerequisites

  • Rust 1.84+ (with wasm32-unknown-unknown: rustup target add wasm32-unknown-unknown)
  • Soroban CLI (cargo install soroban-cli)

Setup

From the repo root:

cd credence-contracts
cargo build

For Soroban (WASM) build:

cargo build --target wasm32-unknown-unknown --release -p credence_bond

Tests

cargo test -p credence_bond

Project layout

  • contracts/credence_bond/ — Identity bond contract
    • create_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 checks
  • add_attestation() / revoke_attestation()
  • Per-identity storage (e.g. by Address key) instead of a single bond

Deploy (Soroban CLI)

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.

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%