MidasRWA: add new addresses#2568
Conversation
📝 WalkthroughWalkthroughEnabled and expanded on-chain oracle/contract configurations and defensive multicall handling: addresses.js adds many per-chain contract entries and activates previously commented oracles; fetchTokenData now catches per-chain multicall failures; index.js uses formatted chain names; utils.formatChain recognizes three new chain identifiers. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3309233 to
4423aef
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/adaptors/midas-rwa/addresses.js`:
- Around line 105-108: The mHyperBTC entry in
src/adaptors/midas-rwa/addresses.js is missing a denomination and will default
to 'USD'; update the mHyperBTC object (the entry named mHyperBTC with keys
address, dataFeed, url) to include the denomination 'BTC' (matching the
BTC-denominated product entries referenced elsewhere) so tokenHelpers.js won't
treat it as USD-quoted.
- Around line 162-165: The mEVUSD entry uses the token address (matches
ethereum.mMEV.address) as its dataFeed, so update the mEVUSD.dataFeed value to
the correct oracle/feed contract address (not the ERC20 token) using
getAddress('...') so fetchCurrentData -> getDataInBase18 receives the actual
oracle; verify the replaced address is the canonical Base oracle for mEVUSD and
that fetchCurrentData (with permitFailure: true) then returns valid data.
- Around line 14-18: fetchCurrentData is passing adaptor chain keys directly
into sdk.api.abi.multiCall causing unsupported chains (etherlink, katana,
xrplevm, monad, plasma, 0g, tac) to silently fail; add a canonical chain alias
mapping (e.g., map "etherlink" -> "etlk", and for chains with no SDK alias
explicitly skip or map to a supported fallback) and validate/translate the chain
key before calling sdk.api.abi.multiCall and any base-price resolution (e.g.,
the bsc.mXRP path); update the mapping lookup used in fetchCurrentData and in
the base-price resolver so unsupported chains are filtered or remapped and
multicalls are not invoked with invalid chain values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 80787d60-f008-4ebe-bf2a-2ae88365336b
📒 Files selected for processing (1)
src/adaptors/midas-rwa/addresses.js
|
hi @dmytro-horbatenko, thanks for the PR, are you able to check the codebase comments pls? thanks again! |
|
The midas-rwa adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/adaptors/midas-rwa/index.js`:
- Line 31: The call to utils.formatChain(chain) in the adaptor is missing an
explicit mapping for the "xrplevm" key so it falls back to generic
capitalization (Xrplevm) instead of the required "XRPL EVM"; update the
formatChain implementation to include a specific mapping entry for "xrplevm" ->
"XRPL EVM" (ensure the mapping lookup in formatChain covers lowercase keys and
returns the exact "XRPL EVM" string), then verify the adaptor code that calls
formatChain (in the module referencing formatChain) will now produce the
expected value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 34b6d784-b0ff-40a5-8114-0eb491be4d60
📒 Files selected for processing (4)
src/adaptors/midas-rwa/addresses.jssrc/adaptors/midas-rwa/fetchTokenData.jssrc/adaptors/midas-rwa/index.jssrc/adaptors/utils.js
✅ Files skipped from review due to trivial changes (1)
- src/adaptors/utils.js
🚧 Files skipped from review as they are similar to previous changes (1)
- src/adaptors/midas-rwa/addresses.js
|
@0xkr3p hello, should be fine now |
0xkr3p
left a comment
There was a problem hiding this comment.
thanks @dmytro-horbatenko, approved
* MidasRWA: add new addresses * MidasRWA: xrplevm support; ETH denomination
Summary by CodeRabbit
New Features
Bug Fixes