Skip to content

fix(sdk): support Folio v6 basket proposals - #38

Draft
tbrent wants to merge 3 commits into
mainfrom
fix/folio-v6-main-sync
Draft

fix(sdk): support Folio v6 basket proposals#38
tbrent wants to merge 3 commits into
mainfrom
fix/folio-v6-main-sync

Conversation

@tbrent

@tbrent tbrent commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • sync the generated Folio v6 ABI to reserve-protocol/reserve-index-dtf@18706fb455b8e6b91250deba795eb791243f6827 (origin/main)
  • encode v6 basket proposals with rebalanceNonce, the existing token/limit/window arguments, and an explicit execution deadline
  • read getRebalanceNonce() and encode the expected next nonce
  • use @reserve-protocol/dtf-rebalance-lib 3.3.1 / FolioVersion.V6
  • enforce the protocol's two-token rebalance minimum
  • require both mutable and immutable tables for raw v6 fee-recipient calls; reject high-level v6 revenue changes until the immutable table can be preserved
  • remove the duplicate generated v6 ABI copy by re-exporting the Folio artifact
  • refresh committed Index subgraph types after the live-schema CI check exposed deployed schema drift

Confirmation

@reserve-protocol/sdk 0.5.0 did advertise v6 writes, but the reported gap was real: the generated v6 ABI and basket proposal builder still used the v5 four-argument startRebalance path. Current protocol main uses:

startRebalance(
  uint256 rebalanceNonce,
  TokenRebalanceParams[] tokens,
  RebalanceLimits limits,
  uint256 auctionLauncherWindow,
  uint256 ttl,
  uint256 deadline
)

The committed ABI was compared directly with the compiled upstream Folio artifact: exact match, 166 ABI items.

Verification

  • full repository gate: forced builds, SDK bundle boundary, typechecks, lint, format, forced tests, docs links, and catalog checks
  • SDK: 321 passed, 17 live-smoke skipped
  • React SDK: 82 passed
  • focused v5/v6 calldata, deadline, nonce, two-token minimum, and fee-recipient tests
  • docs build and 93 link checks
  • live GraphQL codegen freshness check green
  • wiki lint green

Review

Independent correctness/security/product review found two blockers; both were fixed:

  1. v6 immutable fee recipients could be omitted
  2. one-token rebalance proposals would encode but always revert onchain

Human review is still required because this changes public calldata builders and protocol ABI handling.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6140b478-cbe3-4a99-be09-0d9603cb924d


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

Comment @coderabbitai help to get the list of available commands.

@tbrent
tbrent marked this pull request as draft August 25, 2026 20:38
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.

1 participant