Skip to main content

Smart Contracts

DobProtocol deploys smart contracts across two blockchain ecosystems: Stellar Soroban for distribution pools and marketplace functionality, and EVM Solidity for asset validation and the zero-slippage DEX. All contracts are open-source.

Contract Ecosystems

Stellar Soroban

Stellar Soroban contracts handle the core distribution and marketplace functionality of DobProtocol:

ContractPurposeVersion
Splitter V2Lazy pull-based distribution poolsCurrent
Splitter V1Push-based distribution (legacy)Legacy

EVM Solidity

EVM contracts power the DobValidator attestation system and DobDex zero-slippage exchange:

ContractPurposeCategory
DOBValidator.solOn-chain TRUFA scoring and certificate attestationValidator
DobPegHook.solUniswap V4 Custom Accounting Hook for zero-slippage swapsDEX
DobRwaVault.solRWA token escrow during swaps and liquidationsDEX
DobValidatorRegistry.solOn-chain oracle for RWA asset pricesDEX
DobLPRegistry.solLiquidity node management and FIFO matchingDEX
DobDirectSwap.solLightweight swap router for non-V4 chainsDEX
DobSwapRouter.solUser-facing router for V4 pool interactionsDEX
DobTokenFactory.solFactory for creating dRWA (wrapped RWA) tokensDEX
PoolMaster.solEVM distribution pool factoryDistribution
PoolMasterConfig.solConfiguration for EVM pool creationDistribution
TokenSaleMarket.solEVM share marketplaceMarketplace

Deployment Networks

Stellar

NetworkIDRPC EndpointHorizon
Testnet9https://soroban-testnet.stellar.orghttps://horizon-testnet.stellar.org
Mainnet10https://soroban.stellar.orghttps://horizon.stellar.org

EVM

NetworkChain IDDB Network IDStatus
Ethereum Sepolia11155111-Active (Validator)
Polygon Amoy80002-Active (Validator)
Base Sepolia845326Active (Validator, DEX)
Base Mainnet84538Active (Validator, Distribution)
Arbitrum One42161-Active (Distribution)
Arbitrum Sepolia421614421614Active (DEX, Distribution)
Lisk1135-Active (Distribution)
Robinhood Chain (Testnet)4663046630Active (DEX)

SEP-55 Verified Builds

Stellar contracts use SEP-55 (Stellar Ecosystem Proposal 55) for reproducible, verifiable builds. This ensures that the deployed WASM bytecode matches the published source code.

How It Works

  1. A GitHub Actions workflow builds the contract from source in a deterministic environment
  2. The resulting WASM binary is attached to a GitHub release
  3. GitHub's artifact attestation signs the build output
  4. Anyone can verify that the deployed contract matches the release:
# Verify attestation
gh attestation verify soro_splitter_v2.wasm \
--repo Dobprotocol/stellar-distribution-contracts

Release Tagging Convention

Tag PatternContract Built
v1.*Splitter V1 (soro_splitter.wasm)
v2.*Splitter V2 (soro_splitter_v2.wasm)

Contract Architecture Principles

Stellar Contracts

  • Pull-based distribution (V2) -- Distribution rounds are created in O(1) time; each user claims in O(1). Scales to 10,000+ shareholders.
  • SAC participation tokens -- Shares are represented as Stellar Asset Contract tokens, making them DEX-compatible.
  • Configurable pool types -- Reward, Payroll, Treasury, and Crowdfunding pools have different behaviors.

EVM Contracts

  • Role-based access -- DOBValidator uses OpenZeppelin AccessControl with VALIDATOR_ROLE for permissioned operations.
  • Hook architecture -- DobPegHook uses Uniswap V4's hook system to intercept and modify swap behavior.
  • Oracle-based pricing -- DobValidatorRegistry provides on-chain price feeds for RWA assets.
  • Modular design -- DEX functionality is split across specialized contracts (vault, registry, router) for upgradability.

Test Coverage

Contract SuiteTestsFramework
Splitter V265 testscargo test
Splitter V1Full coveragecargo test
DobDex (all contracts)77 testsFoundry / Hardhat
DOBValidatorCoveredHardhat

Further Reading