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¶
PersonalMarketplacefor personal premium listingsPersonalLicenseReceiptfor ERC-1155 license ownershipTipRouterfor tipping flowsSimpleBountySystemfor bounty lifecycle and payoutsGovernanceBoostManagerfor 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¶
- Proposal creation
- Voting period
- Queue into timelock
- Execute after delay
- 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.