fix(config): swap dead BTCB Chainlink address for live AggregatorV3 (closes #109)#337
Merged
Conversation
…loses #109) The address shipped in #109's "fix" — 0x264990fbd0…1f0 — has no bytecode on BSC mainnet. `cast code` returns 0x against both dRPC and bsc-dataseed.binance.org, so every `decimals()` / `latestRoundData()` call against it abi-decodes garbage and BTCB-collateral positions have been silently unpriceable since #35 landed. Discovered the live address by walking the on-chain Venus oracle path: ResilientOracle (0x6592b5DE…) → ChainlinkOracle facet (0x1B210344…) → tokenConfigs(BTCB) → 0x8ECF7dE377F788A813F5215668E282556b35f300 Verified live against bsc.drpc.org: cast code → 19,145 bytes of bytecode decimals() → 18 (Venus uses 18-decimal Chainlink wrappers, not the standard 8-decimal feeds) description() → "BTC / USD" latestRoundData → answer ≈ 78,090e18 (= $78,090), fresh round Confirmed Chainlink-ops-owned: feed `owner()` is 0xcb6754D5…, the same multisig that owns the BNB/USD canonical feed. PriceCache (`crates/charon-scanner/src/oracle.rs:33,59`) reads `decimals()` per feed at startup and `CachedPrice::scaled_to` rescales to a target — the 8→18 decimal difference is invisible to consumers, no Rust changes required. Same swap applied to `config/fork.toml` since the fork profile pins mainnet block forks and would have hit the same garbage decode. Comment block above [chainlink.bnb] in default.toml records the Venus-oracle discovery path so future reviewers don't have to walk it again. Adjacent finding (separate issue recommended): the other four [chainlink.bnb] entries (BNB, ETH, USDT, USDC) were sourced the same way from docs.chain.link. Given one of five was bytecodeless, the remaining four warrant the same cast-code/decimals/description sanity check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0x264990fbd0…1f0(no bytecode on BSC mainnet) for the live AggregatorV30x8ECF7dE377F788A813F5215668E282556b35f300discovered via the Venus oracle path.config/fork.toml(forks mainnet block, hits same dead address).[chainlink.bnb]documenting the discovery path.Closes #109 (re-fixed — the previous fix shipped a still-wrong address).
Why
cast code 0x264990fbd0A4796A3E3d8E37022BdAf1A5a4C1f0 --rpc-url https://bsc.drpc.org→0x. EOA, no contract. Every BTCB price call has been silently failing withABI decoding failed: buffer overrun while deserializingsince PR #35.Live charon log against the dead address:
Verification
Decimal difference (no Rust change needed)
The new aggregator is 18-decimal, not 8 like the other feeds.
PriceCachereadsdecimals()per feed at startup (crates/charon-scanner/src/oracle.rs:59) andCachedPrice::scaled_torescales to any target — the difference is invisible to consumers.Reviewer findings (blockchain-code-reviewer)
All applied:
config/fork.tomlcarries the same dead address — patched.grep -rn 264990fbreturned only the two TOML hits).[chainlink.bnb]entries deserve the samecast codesanity check.Test plan
cast codeconfirms bytecode on the new address (both dRPC and bsc-dataseed.binance.org)decimals(),description(),latestRoundData()all succeedowner()matches BNB/USD canonical feed ownerPriceCacheis decimal-agnostic