Skip to content

fix(sdk): load DTFs with legacy bytes32 token metadata (mvRWA) - #56

Merged
JuampiRombola merged 1 commit into
mainfrom
fix/mvrwa-loading
Nov 12, 2026
Merged

JuampiRombola merged 1 commit into
mainfrom
fix/mvrwa-loading

Conversation

@reserve-hermes

Copy link
Copy Markdown
Contributor

Summary

  • Fix mvRWA overview failing to initialize because basket asset MKR returns name() and symbol() as bytes32, not dynamic strings.
  • Retry only failed metadata fields, requiring exactly 32 raw return bytes and valid UTF-8 after trailing NUL padding; keep ordinary metadata unchanged and continue rejecting invalid decimals, metadata reverts/empty data, malformed dynamic-string responses, invalid UTF-8, and RPC failures.
  • Apply the fix in the shared SDK token reader so basket and reward-token callers benefit; no per-DTF or MKR address special case.
  • Include a patch changeset and regression coverage through real viem ABI decoding of explicitly synthetic raw RPC fixtures.

Reproduction

Production route: https://app.reserve.org/ethereum/index-dtf/0xa5cdea03b11042fc10b52af9eca48bb17a2107d2/overview/

Published SDK 0.8.1 createDtfSdk().index.get({address: '0xa5cdea03b11042fc10b52af9eca48bb17a2107d2', chainId: 1, brand: true}) rejects at MKR name() with ContractFunctionExecutionError / IntegerOutOfRangeError. Raw live RPC returns 0x4d616b6572000000000000000000000000000000000000000000000000000000 for MKR name and a bytes32 MKR symbol. The core DTF atom never populates, so the UI remains in loading placeholders despite successful API and subgraph responses.

Verification

  • Observed the new regression fail before the production change; 18 focused metadata tests now pass.
  • Full SDK suite: 536 passed, 59 skipped (fork/live suites are opt-in).
  • SDK typecheck, build, package entry checks, scoped lint, formatting, and git diff --check pass.
  • The built patched SDK successfully loads the real mvRWA and its six basket assets from live API/RPC data.
  • Real browser check against current Register source with a local alias to the built patched SDK: desktop 1440x1000 and mobile 390x844 both transition from the reproduced missing name/price to loaded RWA Index, mvRWA, price, market cap, basket, and chart. Desktop sell widget renders. No transaction submitted.
  • Local browser alias is verification-only; no Register dependency or production deployment is changed by this PR.

Rollout

Merge and publish the SDK patch, then update Register's SDK dependency and deploy. mvRWA is currently marked inactive/sell-only by the existing catalog; this fix intentionally does not change that status.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15b8fbcf-286d-418c-bff7-b65977d62cd7
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@JuampiRombola
JuampiRombola marked this pull request as ready for review November 12, 2026 19:25
@JuampiRombola
JuampiRombola merged commit 2b47590 into main Nov 12, 2026
3 checks passed
@JuampiRombola
JuampiRombola deleted the fix/mvrwa-loading branch November 12, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants