How originprotocol/origin-dollar works
Project type & purpose
• This is a DeFi smart-contract monorepo for Origin Dollar (OUSD) and Origin Ether (OETH). It hosts on-chain business logic (vaults, tokens, strategies), multi-network deployment configs, on-chain verification (Certora, Slither), and off-chain automation (Hardhat tasks, Brownie scripts).
File-structure analysis
• Top-level:
• contracts/ – Solidity code, Hardhat config, deployments, docs, tests, tasks
• brownie/ – Python/Brownie scripts, ABI imports, allocations, world-state abstractions, tests
• certora/ – formal-verification specs & run scripts
• CI/CD (.github/workflows)
• Patterns:
• “contracts/contracts” by area: vault, strategies, governance, oracles, mocks
• “deployments” per network: mainnet, base, plume, sonic, holesky
• Hardhat tasks for daily ops, defender-actions, governance proposals
• Storage-layout snapshots for upgrade safety
a. Main components
1) On-chain core modules: VaultCore, VaultAdmin, Token contracts (OUSD/OETH/WOETH), Strategy modules, OracleRouter, Harvester, Dripper, Buyback, BridgeHelper, Zapper
2) Deployment & upgrade system: Hardhat + network configs + migrations vs Brownie scripts + Python world abstractions
3) Off-chain automation:
– Hardhat tasks & Defender-actions (JS/TS)
– Brownie harvest/allocation scripts (Python)
– Certora engine for invariant checks
– Slither static analyzer
4) External blockchains & services: Ethereum mainnet fork (Infura/Alchemy), Uniswap/Curve/Sushi on-chain protocols, Chainlink oracles, Aave/Morpho, CCIP
5) CI/CD pipelines (.github/workflows)
b. Relationships & interactions
– Off-chain tasks & scripts invoke Hardhat RPC (forked node) to call/deploy contracts
– Contracts call oracles & other DeFi protocols on-chain
– CI/CD triggers tests, lint, verification, and deployment on merge
– Certora & Slither scan contracts pre-merge
c. Architectural patterns
– Proxy/upgradable pattern (many “Proxy” contracts)
– Modular strategy plugins (4626-style)
– Governance timelocks & safe-modules for permissioned operations
– Forked development node for stateful integration tests
d. Key tech
– Solidity, Hardhat, Brownie (Python), PlantUML, Certora Specs, Slither, GitHub Actions