Skip to content

[scanner] default_selectors() includes setDirectPrice and setUnderlyingPrice absent from Venus ResilientOracle #230

@obchain

Description

@obchain

Refs #46

PR: feat/21-mempool-monitor
File: crates/charon-scanner/src/mempool.rs
Function: default_selectors()

Problem

default_selectors() registers four selectors:

  • updatePrice(address) — present on ResilientOracle
  • updateAssetPrice(address) — present on ResilientOracle
  • setDirectPrice(address,uint256) — legacy SimplePriceOracle only, not present on ResilientOracle
  • setUnderlyingPrice(address,uint256) — legacy VenusChainlinkOracle only, not present on ResilientOracle

MempoolMonitor receives the oracle address discovered at runtime via VenusAdapter, which calls Comptroller.oracle() on the deployed Venus Comptroller (0xfd36e2c2a6789db23113685031d7f16329158384 on BSC mainnet). That Comptroller currently returns the Venus ResilientOracle, which does NOT expose setDirectPrice or setUnderlyingPrice as callable write functions.

As a result, two of the four default selectors will never match any pending transaction targeting the production oracle address. The PR description claims "4 Venus oracle-write selectors recognized" but the effective selector set for the production deployment is 2, not 4.

Required fix

Remove setDirectPrice and setUnderlyingPrice from default_selectors(). Move them to a separate legacy_selectors() function or document them as optional additions for operators running legacy oracle deployments. Add a code comment on each selector citing the specific Venus contract and BSC address where that function is or was exposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)priority:p1-coreCore MVP scope

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions