BlackHartBlackHart

Quick Start

Start reading protocol risk scores in under 5 minutes. No API key required.

1

Point to the Registry

The BRORegistry is the stable consumer address. It routes reads to the active oracle implementation. Protocols are identified by human-readable string slugs (e.g. "aave-v3").

solidity
import {IBROOracle} from "./IBROOracle.sol";

// The registry address is stable — never changes
IBROOracle registry = IBROOracle(REGISTRY_ADDRESS);

// Common slugs: "aave-v3", "morpho-blue", "uniswap-v4", "lido", "compound-v3"
2

Read the Score

Call getScore() for the composite BRI + staleness, or getFullScore() for the full struct including all 12 dimensions and evidence hash.

solidity
// Simple read — composite + staleness
(uint16 bri, uint8 forgeScale, uint64 updatedAt, bool stale)
    = registry.getScore("uniswap-v4");
// bri → 912, forgeScale → 6 (MITHRIL), stale → false

// Full read — all 12 dimensions + evidence
IBROOracle.ProtocolScore memory score = registry.getFullScore("uniswap-v4");
// score.dimensions[0] → D1 Access Control (0-100)
// score.evidenceHash  → 0xabc... (IPFS CID)

// Single dimension — e.g. D3 Oracle Integrity (index 2)
uint16 oracleScore = registry.getDimension("uniswap-v4", 2);
3

Check Freshness

Always check staleness before making decisions based on a score. The oracle updates every 6 hours, but if updates are delayed, you should handle that gracefully.

solidity
// getScore() includes staleness — check it inline
(uint16 bri,,, bool stale) = registry.getScore("aave-v3");
require(!stale, "Score too old");
require(bri >= 650, "Below risk threshold");

// Or use the standalone staleness check
require(!registry.isStale("aave-v3"), "Score too old");

Forge Scale Quick Reference

ADAMANTINE950-1000
MITHRIL850-949
DAMASCUS750-849
TEMPERED650-749
FORGED550-649
CAST450-549
RAW300-449