How superfluid-org/protocol-monorepo works
Project Type and Purpose
• This is a protocol-monorepo for the Superfluid real-time finance framework, combining:
• EVM smart contracts (packages/ethereum-contracts, automation-contracts, scheduler)
• TypeScript SDKs (packages/sdk-core, packages/sdk-redux, packages/js-sdk deprecated)
• Metadata (package/metadata), testing harnesses (packages/hot-fuzz), examples, Haskell specs, and CI/CD
File-Structure Analysis
• Top-level “packages/” directory holds each logical component as its own package.
• Smart-contract packages include contracts/, tests/, dev scripts, deploy scripts, Hardhat and Foundry configs.
• sdk-redux builds on sdk-core exposing Redux slices via RTK Query for frontend consumption.
• metadata provides static JSON/CJS/TS modules with network addresses.
• hot-fuzz wraps Echidna for contract fuzz testing.
• examples directories show Next.js and React front-ends consuming sdk-redux.
• spec-haskell and solidity-semantic-money are reference implementations & formal specs.
README Insights
• Confirms monorepo nature, lists each published package and its role.
a. Main Components
• Ethereum Networks (Mainnet/Testnets) hosting Superfluid core contracts (Host, CFA, IDA, GDA, governance, tokens).
• SDK-Redux layer building on SDK-Core to provide React-friendly RTK Query endpoints and transaction tracking.
• Front-end Example Apps (Next.js, React) connecting via SDK-Redux.
• Testing Tools: hot-fuzz (Echidna wrapper), Foundry/Hardhat test runners.
b. Relationships & Data Flows
• Front-end → Redux slice (SDK-Redux) → SDK-Core → Ethereum JSON-RPC (read/write)
• Smart contracts emit events → Graph Node ingest → GraphQL schema
• Metadata feeds both SDK-Core and front-ends with correct addresses/URLs
c. Architectural Patterns
• Monorepo with independent packages → clear separation of concerns
• Event-driven indexing via TheGraph
d. Key Technologies
• Solidity, Hardhat, Foundry for contracts
• TypeScript, Node.js for SDKs and scripts
• Redux Toolkit Query for client state management
• Echidna for fuzz testing in hot-fuzz wrapper
• GitHub Actions for CI/CD