Skip to content

[AUDIT-M02] [medium] StaleDiaPrice path never exercised by tests #7

Description

@Siddharth2207

Description

StaleDiaPrice is never exercised. All getPriceNoOlderThan / LibOpDiaPrice.run tests use staleAfter=3600 on a fork where feeds are still fresh. The revert path for stale prices has zero coverage.

Location

src/lib/dia/LibDia.sol L80–83; tests under test/src/lib/dia/LibDiaGetPriceTest.t.sol

Proposed fix

Add an external wrapper and a test that warps past rawTimestamp + staleAfter and expects:

vm.expectRevert(abi.encodeWithSelector(StaleDiaPrice.selector, uint128(rawTimestamp), staleAfterUint));

Audit

Whole-repo audit of 2026-05-16-update-dia-oracle @ 2cdd111 via rainlanguage/claude-audit-skills v0.12.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit findingmediumMedium severitypass2Audit pass 2 test coverage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions