How superfluid-finance/protocol-monorepo works
And Map the Main Components
• Ethereum Contracts: Represented in the “packages/ethereum-contracts” directory. These are the Solidity smart contracts implementing the core protocol logic and upgradeability. Include supporting folders like “contracts”, “test”, “audits”, and “deploy” scripts.
• SDK and Frameworks:
– SDK-Core (“packages/sdk-core”): A modern JavaScript/TypeScript interface for applications to interact with the protocol without direct Solidity knowledge.
– SDK-Redux (“packages/sdk-redux”): Tailored for React/Redux based front-end applications, incorporating RTK Query slices and state-management integrations.
– JS-SDK (“packages/js-sdk”): The older JavaScript SDK (now deprecated) that provides similar functionality.
• Testing and Fuzzing Tools: (“packages/hot-fuzz”) which harnesses tools like Echidna for fuzz testing smart contracts.
• Supporting/Utility Components: Other packages (for example spec-haskell, starknet-contracts, examples, tasks) that support additional testing/specification, deployment scripts, CI/CD configuration (GitHub workflows under .github), and helper tasks.
• How the Ethereum blockchain hosts the deployed contracts from the ethereum-contracts package.
• Deployment and development tooling (e.g., GitHub Actions workflows, Foundry/Hardhat configurations) as external flows that support continuous integration/deployment and testing.
Architectural Patterns & Design Principles
• Modularity and Separation of Concerns: Each package serves a distinct role in the ecosystem (contracts, indexing, SDKs, metadata, testing).
• Monorepo Structure: All these components are maintained within one repository to ensure synchronized versioning, shared infrastructure (like CI/CD in .github), and cross-package integration testing.
Technologies, Frameworks, and Libraries
• Smart Contracts & Development: Solidity, Foundry, Hardhat.
• SDKs and Front-End Integrations: JavaScript/TypeScript, React, Redux (RTK Query in sdk-redux).
• CI/CD and Testing: GitHub Actions (with multiple workflows), Echidna (via hot-fuzz), and various test suites/linting configurations.
• Project configuration/packaging tools: Yarn, npm, Lerna, and Nix for reproducible environments.