Skip to content

Contracts Architecture

Smart contract architecture for Sage Protocol, aligned with current deployed flows.

Core Modules

SubDAOFactory (SubDAOFactoryOptimized.sol)

Entry point for DAO creation and governance wiring.

  • Deploys governor + timelock relationships
  • Applies governance profile/playbook configuration
  • Registers DAO metadata and roles

SubDAO (SubDAO.sol)

DAO contract representing a governance domain.

  • References governor/timelock
  • Connects treasury + policy modules
  • Anchors DAO-level configuration

LibraryRegistry (LibraryRegistry.sol)

Canonical library pointer store (manifest-only model).

  • Stores DAO -> libraryIdHash -> LibraryInfo(manifestCID, version, nonce)
  • Updates are timelock-governed for DAO-controlled streams

Governance Layer

  • Governor proposal lifecycle
  • Timelock delayed execution
  • ERC20Votes-based voting power

Incentive and Commerce Layer

  • PersonalMarketplace for personal premium listings
  • PersonalLicenseReceipt for ERC-1155 license ownership
  • TipRouter for tipping flows
  • SimpleBountySystem for bounty lifecycle and payouts
  • GovernanceBoostManager for merkle-based boost weighting

Voting Power and Multipliers

Layer Mechanism Description
Base ERC20Votes (SXXX) Proposal thresholds, quorum, and votes
Multiplier VotingMultiplierNFT DAO-scoped voting boosts
Governance boost GovernanceBoostManager Merkle-verified per-proposal additive weighting

Governance Flow

  1. Proposal creation
  2. Voting period
  3. Queue into timelock
  4. Execute after delay
  5. Registry and policy state transitions become canonical

Storage and Discovery Interaction

Component Role
Contracts Canonical governance and pointers
Subgraph Event indexing
Worker Materialized read and discovery APIs
CLI/SDK/Web Client surfaces consuming worker data

Legacy Contract Note

Some historical contracts exist in the repository but should not be used for new flows.

See Deployed vs Legacy Contracts.