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:
| Contract | Purpose | Version |
|---|---|---|
| Splitter V2 | Lazy pull-based distribution pools | Current |
| Splitter V1 | Push-based distribution (legacy) | Legacy |
- Repository: github.com/Dobprotocol/stellar-distribution-contracts
- Language: Rust (compiled to WASM)
- Build verification: SEP-55 verified builds via GitHub Actions attestation
- Networks: Stellar Testnet (network_id=9), Stellar Mainnet (network_id=10)
EVM Solidity
EVM contracts power the DobValidator attestation system and DobDex zero-slippage exchange:
| Contract | Purpose | Category |
|---|---|---|
| DOBValidator.sol | On-chain TRUFA scoring and certificate attestation | Validator |
| DobPegHook.sol | Uniswap V4 Custom Accounting Hook for zero-slippage swaps | DEX |
| DobRwaVault.sol | RWA token escrow during swaps and liquidations | DEX |
| DobValidatorRegistry.sol | On-chain oracle for RWA asset prices | DEX |
| DobLPRegistry.sol | Liquidity node management and FIFO matching | DEX |
| DobDirectSwap.sol | Lightweight swap router for non-V4 chains | DEX |
| DobSwapRouter.sol | User-facing router for V4 pool interactions | DEX |
| DobTokenFactory.sol | Factory for creating dRWA (wrapped RWA) tokens | DEX |
| PoolMaster.sol | EVM distribution pool factory | Distribution |
| PoolMasterConfig.sol | Configuration for EVM pool creation | Distribution |
| TokenSaleMarket.sol | EVM share marketplace | Marketplace |
Deployment Networks
Stellar
| Network | ID | RPC Endpoint | Horizon |
|---|---|---|---|
| Testnet | 9 | https://soroban-testnet.stellar.org | https://horizon-testnet.stellar.org |
| Mainnet | 10 | https://soroban.stellar.org | https://horizon.stellar.org |
EVM
| Network | Chain ID | DB Network ID | Status |
|---|---|---|---|
| Ethereum Sepolia | 11155111 | - | Active (Validator) |
| Polygon Amoy | 80002 | - | Active (Validator) |
| Base Sepolia | 84532 | 6 | Active (Validator, DEX) |
| Base Mainnet | 8453 | 8 | Active (Validator, Distribution) |
| Arbitrum One | 42161 | - | Active (Distribution) |
| Arbitrum Sepolia | 421614 | 421614 | Active (DEX, Distribution) |
| Lisk | 1135 | - | Active (Distribution) |
| Robinhood Chain (Testnet) | 46630 | 46630 | Active (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
- A GitHub Actions workflow builds the contract from source in a deterministic environment
- The resulting WASM binary is attached to a GitHub release
- GitHub's artifact attestation signs the build output
- 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 Pattern | Contract 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
AccessControlwithVALIDATOR_ROLEfor 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 Suite | Tests | Framework |
|---|---|---|
| Splitter V2 | 65 tests | cargo test |
| Splitter V1 | Full coverage | cargo test |
| DobDex (all contracts) | 77 tests | Foundry / Hardhat |
| DOBValidator | Covered | Hardhat |
Further Reading
- Splitter V2 Contract -- Lazy pull-based distribution for Stellar
- EVM Validator Contract -- On-chain TRUFA attestation
- DEX Hook Contracts -- Uniswap V4 Custom Accounting Hook architecture