Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

dcc-lend-core

RIDE smart contracts for the DCC Lending Protocol on DecentralChain.

Contents

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

Contracts

Lending Pool (lending-pool.ride)

Main contract handling deposits, borrows, repayments, withdrawals, liquidations, and market admin.

Oracle Consumer

Oracle state is read directly from a separate oracle contract. The lending pool validates staleness and price validity before any operation.

State Schema

See state-schema.md for complete key documentation.

Testing

pnpm test           # all tests
pnpm test:unit      # math/helper unit tests
pnpm test:integration  # contract interaction tests
pnpm test:scenarios    # full lifecycle scenario tests

Deployment

pnpm deploy:testnet   # deploy to testnet
pnpm deploy:mainnet   # deploy to mainnet (requires confirmation)

Security Notes

  • 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