oracle-redundancy

Solid

Detect oracle fallback and redundancy failure modes (distinct from price manipulation) — single point of failure, missing staleness/heartbeat/deviation checks, an "all oracles down" path that reverts or silently returns stale/zero, missing L2 sequencer-uptime feed, and absent circuit breakers. Activate whenever code reads a price/rate feed, especially Chainlink latestRoundData, with fallbacks or on an L2.

AI & Automation 38 stars 5 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Oracle redundancy detection ## When this applies Trigger on any of: - `latestRoundData()` / `latestAnswer()` reads from Chainlink or any push feed - Custom oracle aggregators with primary + fallback sources - L2 deployments reading any price feed (Arbitrum, Optimism, Base, etc.) - Rate/price reads that gate borrowing, liquidation, minting, or redemption - Any "if primary fails, use secondary" branching ## Detection patterns ### Missing staleness / heartbeat check (HIGH) ```solidity (, int256 price,,,) = feed.latestRoundData(); // ignores updatedAt & answeredInRound require(price > 0); return uint256(price); ``` **Signal:** no `updatedAt` freshness gate. A frozen feed (feed deprecated, node outage, or a market-wide halt) returns the last value forever; protocol prices off stale data. Require `block.timestamp - updatedAt <= heartbeat` and `answeredInRound >= roundId`. ### Single point of failure (HIGH) One feed, no fallback, no degradation plan. If that feed is deprecated or returns garbage, the protocol is bricked or mispriced. **Signal:** a hard dependency on exactly one external address with no alternative path. ### Fallback that silently returns 0 or last price (HIGH) ```solidity try feed.latestRoundData() returns (...) { ... } catch { return lastGoodPrice; } // ← stale, or worse: catch { return 0; } // ← 0 collateral value = mass liquidation, or free mint ``` **Signal:** the catch path masks failure. Returning `0` can make collateral worthless (m...

Details

Author
iktok90-design
Repository
iktok90-design/ai-smart-contract-auditor
Created
1 weeks ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category