Skip to content

Dead field: OracleConfig::oracle_address is stored but never read by any contract logic #312

Description

@Jaydbrown

TwapOracle::OracleConfig (contracts/oracle/src/lib.rs) has a field pub oracle_address: Address, set by configure_oracle and stored in instance storage. Grepping the whole file, every occurrence of oracle_address outside the struct definition and its own doc comment is either a struct-literal assignment (in configure_oracle's caller or in tests) — no function (get_twap_price, calculate_fiat_stream_payout, submit_price, is_price_stale, price_age) ever reads config.oracle_address to do anything with it. It's write-only: stored, never consulted. Either it's meant to gate/reference an external price source and that wiring was never finished, or it's vestigial and should be removed from the struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions