Section 9 of 18

Build
+15 Lynx

Comptroller: Market Management

Key takeaway: Compound V2's Comptroller is the cross-market accounting layer. It maintains a markets mapping of supported cTokens with their collateralFactor (max LTV), listed flag, and per-account membership records, all governed by admin via _supportMarket and _setCollateralFactor. Without an entry in the markets mapping a cToken is invisible to the protocol's solvency math. Every fork modifies these admin paths and they are among the most common places auditors find privilege-escalation bugs.

What You Are Building

You are building the Comptroller's market management layer. This is where the protocol tracks which markets exist, which users have opted into which markets, and the risk parameters for each market. Think of it as the risk engine's configuration layer.

Misconfigured collateral factors and missing access controls on market management are common vulnerabilities in Compound forks. Every parameter you set here directly determines how much risk the protocol takes on.

Your Code

Solution.sol
Solidity
Loading editor...

Requirements

Write your implementation, then click Run Tests. Tests execute on the server.

Sign up free — keep reading + earn 15 Lynx

Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.

Sign up free to continue

Already have an account? Log in