RIDE smart contracts for the DCC Lending Protocol on DecentralChain.
src/
ride/ → RIDE smart contract source files
math/ → TypeScript math specs mirroring on-chain logic
types/ → Shared type definitions for contract state
tests/
unit/ → Unit tests for math and helpers
integration/ → Contract deployment + interaction tests
scenarios/ → Multi-step scenario tests (liquidation, lifecycle)
scripts/ → Deployment scripts for testnet/mainnet
docs/ → Contract-specific documentation
Main contract handling deposits, borrows, repayments, withdrawals, liquidations, and market admin.
Oracle state is read directly from a separate oracle contract. The lending pool validates staleness and price validity before any operation.
See state-schema.md for complete key documentation.
pnpm test # all tests
pnpm test:unit # math/helper unit tests
pnpm test:integration # contract interaction tests
pnpm test:scenarios # full lifecycle scenario testspnpm deploy:testnet # deploy to testnet
pnpm deploy:mainnet # deploy to mainnet (requires confirmation)- Every callable validates all inputs with strict bounds checking
- Paused state is checked before every user-facing action
- Oracle staleness is enforced at the contract level
- Integer math only — no floating point anywhere
- All rounding directions are explicitly documented
- Invariants are checked and documented inline