Repository navigation
Version Packages - #50
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
JuampiRombola
approved these changes
Oct 20, 2026
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@reserve-protocol/dtf-catalog@0.2.0
Minor Changes
require("@reserve-protocol/sdk").dtfCatalog: the CommonJS entry re-exported the catalog's module namespace ({ default, indexDtfs, ... }) instead of the chain-keyed catalog, because the bundler's interop for a re-exported default hands outmodule.exports. The catalog now also exports the combined catalog by name (dtfCatalog, same object as the default export), and the SDK re-exports that.check:packagenow compares every export's value between the ESM and CommonJS entries, not just its kind.@reserve-protocol/react-sdk@0.7.0
Minor Changes
8f12b39: Index DTF: deploy event extraction only trusts the deployer.
extractIndexDtfDeployedAddress(logs, target)takes the deploy target ({ chainId, version, deployer? }, the same object the deploy builders take) and only readsFolioDeployed/GovernedFolioDeployedemitted by that version's deployer. Before, any emitter was accepted, so a basket token could emit a lookalike event duringtransferFromand the SDK returned the attacker's address.extractIndexDtfDeployedStakingTokenAddress(logs, { chainId })only readsDeployedGovernedStakingTokenfrom the chain'sINDEX_DTF_GOVERNANCE_DEPLOYER_ADDRESS.RECORD_NOT_FOUNDwithout the deployer's event andINVALID_RESPONSEwhen the deployer's events name more than one address.d26bccf: Index DTF: Folio 6.0 ABIs re-synced to the deployed 6.0.0 (
reserve-index-dtf@7d97c80, identical to the explorer-verified implementation on mainnet, Base and BSC).prepareIndexDtfEndRebalance/ref.prepareEndRebalancerequirerebalanceNonceand encodeendRebalance(uint256); the previous nonce-less call reverted on every real 6.0.0 Folio. 5.0.0 still encodesendRebalance(). NewPrepareIndexDtfEndRebalanceParamstype.folioV6Abi/folioArtifactAbinow carryendRebalance(uint256 rebalanceNonce). A unit test compares the generated Folio and FolioDeployer ABIs item for item with the Base Blockscout verified ABIs, so drift from the deployed contracts fails CI.041b6fb: Index DTF 6.0.0 deploy: create the governance vault and reject parameters the contracts would revert on.
prepareIndexDtfDeployStakingVaultbuildsdeployWithNewStakingVaulton the governance deployer 1.1.0 (INDEX_DTF_OPTIMISTIC_GOVERNOR_DEPLOYER_ADDRESS), creating an optimistic staking vault (vlX) with its own governor and timelock.extractIndexDtfDeployedStakingVaultreads the vault and its DAO from that deployer'sReserveOptimisticGovernorSystemDeployedevent only.stTokenon governed deploys, and vault reward half-life outside 1 day–2 weeks, unstaking delay over 4 weeks or more than 20 reward tokens. Zero basket amounts are rejected for 5.0.0 too.5f53142: Index DTF: Folio 6.0 state reads and the version registry.
getIndexDtfSelfFee,getIndexDtfImmutableFeeRecipients(the full tablesetFeeRecipientsmust receive back),getIndexDtfTradeAllowlist({ enabled, tokens }) andgetIndexDtfIsTokenAllowlistedread the v6 contract from RPC at one pinned block; on a v5 proxy they throw (the immutable-table read probesfolioFeeForSelffirst instead of reporting an empty table). Exposed assdk.index.get*, on the DTF ref, and asuseIndexDtf*hooks.getIndexDtfLatestVersionandgetIndexDtfVersionDeploymentreadFolioVersionRegistry(INDEX_DTF_VERSION_REGISTRY_ADDRESSper chain, overridable withregistry);getIndexDtfVersionHashmirrors the registry'skeccak256(abi.encodePacked(version)). Hooks sit at the static cache tier.30f2e02: Index DTF: Folio 6.0 fields from the subgraph.
IndexDtfgainsversion,rebalance.maxAuctionLength,rebalance.tradeAllowlist,fees.immutableRecipients,fees.selfFeeandfinancials.selfRevenue(absent, empty or zero before 6.0 and for grafted DTFs whose fields are null;tradeAllowlistis left out unless both the flag and the token list are indexed).financials.totalRevenueis protocol + governance + external + self; revenue fields are raw 18-decimal share amounts. The React SDK's flatIndexDtfDatagainsselfRevenue.getIndexDtfRevenuefolds the immutable table and the holders' share intoeffectiveDistribution(holders.percentage) in the order Folio pays: the DAO fee first, the self fee keeps its share of the rest for holders, and the mutable and immutable tables split what is left (DAO 50%, self fee 25%, tables 60/40 → mutable 22.5%, immutable 15%, holders 12.5%). With both tables empty the DAO gets the recipients' pool, asdistributeFeesdoes.getIndexDtfEffectiveRevenueDistribution(fees, platformFee)takes{ recipients, immutableRecipients, selfFee }instead of the recipients array.FeesrequiresimmutableRecipientsandselfFee,FinancialsrequiresselfRevenue, andIndexDtfRevenueDistributionrequiresholders.Rollout blocker:
GetIndexDTFnow needs the index subgraph 1.11.1 schema. Against a 1.10.2 endpoint every Index DTF query fails, so this release must not be published (or Register pointed at it) before all threeprodendpoints (mainnet, Base, BSC) serve 1.11.1.release:cienforces it:graphql:codegen:checkkeeps checking Baseprodby default (INDEX_DTF_SUBGRAPH_SCHEMA=<.../dtf-index-base/1.11.1-test/gn>checks the candidate), and the newcheck:subgraph-endpointsvalidates the shipped documents against every configured endpoint.619142f: Index DTF: every Folio write builder takes
version.prepareIndexDtfBid,prepareIndexDtfCloseAuction,prepareIndexDtfEndRebalance,prepareIndexDtfOpenAuctionUnrestricted,prepareIndexDtfDistributeFees,prepareIndexDtfMint(and its plan) andprepareIndexDtfRedeemnow requireversion("5.0.0"|"6.0.0") and reject anything else withSdkError(INVALID_INPUT). Their calldata is byte-identical across both versions; the ABI attached to the call follows the version.dtf.prepareEndRebalance()anddtf.prepareDistributeFees()now take{ version }. Read it withsdk.index.getVersion/useIndexDtfVersion.IndexDtfCall(contract.abiisAbi,contract.functionNameisstring,contract.argsisreadonly unknown[]); call sites that relied on the narrower inferred type must widen.getIndexDtfRebalanceNonce(sdk.index.getRebalanceNonce,ref.getRebalanceNonce,useIndexDtfRebalanceNonce) reads Folio 6.0'sgetRebalanceNonce().9baa37a: Index DTF rebalance: explicit version contract and protocol-accurate auction state.
prepareIndexDtfOpenAuctionArgs,prepareIndexDtfOpenAuctionandbuildIndexDtfStartRebalanceArgsnow requireversion("5.0.0"|"6.0.0") and reject anything else withSdkError(INVALID_INPUT); there is no silent v5 default.buildIndexDtfStartRebalancereads the proxy version when none is passed and applies the same check.auctionLengthand carries it into the args;prepareIndexDtfOpenAuctionuses it when no explicit length is passed.getLatestAuction/getActiveAuctionresolve one block first and pin every read to it, reportcurrentRebalanceNonceandblockNumber, and treat an auction as active only whilestartTime <= now <= endTime(inclusive, as Folio checks) and its nonce matches the current rebalance.Patch Changes
reserve-index-dtfartifacts, and encode v6 basket proposals with the expected rebalance nonce and required execution deadline. V6 fee-recipient calls now require both mutable and immutable recipient tables; higher-level revenue proposals reject v6 until they can preserve the immutable table.@reserve-protocol/sdk@0.7.0
Minor Changes
8f12b39: Index DTF: deploy event extraction only trusts the deployer.
extractIndexDtfDeployedAddress(logs, target)takes the deploy target ({ chainId, version, deployer? }, the same object the deploy builders take) and only readsFolioDeployed/GovernedFolioDeployedemitted by that version's deployer. Before, any emitter was accepted, so a basket token could emit a lookalike event duringtransferFromand the SDK returned the attacker's address.extractIndexDtfDeployedStakingTokenAddress(logs, { chainId })only readsDeployedGovernedStakingTokenfrom the chain'sINDEX_DTF_GOVERNANCE_DEPLOYER_ADDRESS.RECORD_NOT_FOUNDwithout the deployer's event andINVALID_RESPONSEwhen the deployer's events name more than one address.5f53142: Index DTF: Folio 6.0 deployments.
prepareIndexDtfDeploy,prepareIndexDtfDeployGovernedand their plans takeversion."5.0.0"keeps the registered per-chain deployer and the existing shapes."6.0.0"deploys throughINDEX_DTF_V6_DEPLOYER_ADDRESSand takes v6 additional details (maxAuctionLength,feeRecipients,immutableFeeRecipients,tvlFee,mintFee,selfFee,mandate) and, for governed deploys, one optimisticgovernancetable instead of owner/trading pairs.getIndexDtfDeployerAddressresolves the target for{ chainId, version, deployer? }. Both deploy builders now returnIndexDtfCall, socall.contractis typed against the genericAbi.d26bccf: Index DTF: Folio 6.0 ABIs re-synced to the deployed 6.0.0 (
reserve-index-dtf@7d97c80, identical to the explorer-verified implementation on mainnet, Base and BSC).prepareIndexDtfEndRebalance/ref.prepareEndRebalancerequirerebalanceNonceand encodeendRebalance(uint256); the previous nonce-less call reverted on every real 6.0.0 Folio. 5.0.0 still encodesendRebalance(). NewPrepareIndexDtfEndRebalanceParamstype.folioV6Abi/folioArtifactAbinow carryendRebalance(uint256 rebalanceNonce). A unit test compares the generated Folio and FolioDeployer ABIs item for item with the Base Blockscout verified ABIs, so drift from the deployed contracts fails CI.041b6fb: Index DTF 6.0.0 deploy: create the governance vault and reject parameters the contracts would revert on.
prepareIndexDtfDeployStakingVaultbuildsdeployWithNewStakingVaulton the governance deployer 1.1.0 (INDEX_DTF_OPTIMISTIC_GOVERNOR_DEPLOYER_ADDRESS), creating an optimistic staking vault (vlX) with its own governor and timelock.extractIndexDtfDeployedStakingVaultreads the vault and its DAO from that deployer'sReserveOptimisticGovernorSystemDeployedevent only.stTokenon governed deploys, and vault reward half-life outside 1 day–2 weeks, unstaking delay over 4 weeks or more than 20 reward tokens. Zero basket amounts are rejected for 5.0.0 too.46ddfcf: Index DTF: Folio 6.0 deploys target the real 6.0.0
FolioDeployer.INDEX_DTF_V6_DEPLOYER_ADDRESSper chain (mainnet0x2B1C…7392, Base0x4c89…cF67, BSC0x9837…1963)."6.0.0"deploys go there by default, whether or not the chain'sFolioVersionRegistryhas registered 6.0.0 yet;deployeris an optional override for fork and sandbox deployers.prepareIndexDtfDeployAssetApproval(s)requireversionand default the spender to that version's deployer, so a 6.0.0 deploy never approves the 5.0.0 deployer by default.deployerstill overrides the spender.5f53142: Index DTF: Folio 6.0 settings and revenue proposals.
buildIndexDtfSettingsProposalacceptsselfFee(percent kept for holders),tradeAllowlist: { enabled?, add?, remove? }and, for revenue changes on 6.0.0,immutableFeeRecipients. When the table is omitted the client-bound builder reads it from RPC. The mutable shares are scaled into whatever the immutable table leaves; v5 DTFs reject the v6-only fields by name.prepareIndexDtfSetFeeRecipientson 6.0.0 sorts both tables by address and rejects tables that do not total 100%, mirroring FolioLib so a bad table fails at build time. Folio 6.0 deploys apply the same check.sortIndexDtfFeeRecipients,scaleIndexDtfFeeRecipients,assertIndexDtfFeeRecipientTableshelpers.5f53142: Index DTF: Folio 6.0 state reads and the version registry.
getIndexDtfSelfFee,getIndexDtfImmutableFeeRecipients(the full tablesetFeeRecipientsmust receive back),getIndexDtfTradeAllowlist({ enabled, tokens }) andgetIndexDtfIsTokenAllowlistedread the v6 contract from RPC at one pinned block; on a v5 proxy they throw (the immutable-table read probesfolioFeeForSelffirst instead of reporting an empty table). Exposed assdk.index.get*, on the DTF ref, and asuseIndexDtf*hooks.getIndexDtfLatestVersionandgetIndexDtfVersionDeploymentreadFolioVersionRegistry(INDEX_DTF_VERSION_REGISTRY_ADDRESSper chain, overridable withregistry);getIndexDtfVersionHashmirrors the registry'skeccak256(abi.encodePacked(version)). Hooks sit at the static cache tier.30f2e02: Index DTF: Folio 6.0 fields from the subgraph.
IndexDtfgainsversion,rebalance.maxAuctionLength,rebalance.tradeAllowlist,fees.immutableRecipients,fees.selfFeeandfinancials.selfRevenue(absent, empty or zero before 6.0 and for grafted DTFs whose fields are null;tradeAllowlistis left out unless both the flag and the token list are indexed).financials.totalRevenueis protocol + governance + external + self; revenue fields are raw 18-decimal share amounts. The React SDK's flatIndexDtfDatagainsselfRevenue.getIndexDtfRevenuefolds the immutable table and the holders' share intoeffectiveDistribution(holders.percentage) in the order Folio pays: the DAO fee first, the self fee keeps its share of the rest for holders, and the mutable and immutable tables split what is left (DAO 50%, self fee 25%, tables 60/40 → mutable 22.5%, immutable 15%, holders 12.5%). With both tables empty the DAO gets the recipients' pool, asdistributeFeesdoes.getIndexDtfEffectiveRevenueDistribution(fees, platformFee)takes{ recipients, immutableRecipients, selfFee }instead of the recipients array.FeesrequiresimmutableRecipientsandselfFee,FinancialsrequiresselfRevenue, andIndexDtfRevenueDistributionrequiresholders.Rollout blocker:
GetIndexDTFnow needs the index subgraph 1.11.1 schema. Against a 1.10.2 endpoint every Index DTF query fails, so this release must not be published (or Register pointed at it) before all threeprodendpoints (mainnet, Base, BSC) serve 1.11.1.release:cienforces it:graphql:codegen:checkkeeps checking Baseprodby default (INDEX_DTF_SUBGRAPH_SCHEMA=<.../dtf-index-base/1.11.1-test/gn>checks the candidate), and the newcheck:subgraph-endpointsvalidates the shipped documents against every configured endpoint.5f53142: Index DTF: 5.0.0 → 6.0.0 upgrade proposals.
buildIndexDtfUpgradeToV6Proposal(sdk.index.buildUpgradeToV6Proposal,ref.buildUpgradeToV6Proposal) builds the spell migration against the DTF's admin governance: selector-registry swap ofstartRebalancefor optimistic governors,transferOwnership(spell)on the proxy admin, thencast.buildIndexDtfUpgradeToV6Callsis the pure form (selectorRegistrypresent means optimistic); the description defaults to "Upgrade to Folio 6.0.0" and the DTF can be injected withdtf;INDEX_DTF_START_REBALANCE_SELECTORandupgradeSpell600Abiare exported.619142f: Index DTF: every Folio write builder takes
version.prepareIndexDtfBid,prepareIndexDtfCloseAuction,prepareIndexDtfEndRebalance,prepareIndexDtfOpenAuctionUnrestricted,prepareIndexDtfDistributeFees,prepareIndexDtfMint(and its plan) andprepareIndexDtfRedeemnow requireversion("5.0.0"|"6.0.0") and reject anything else withSdkError(INVALID_INPUT). Their calldata is byte-identical across both versions; the ABI attached to the call follows the version.dtf.prepareEndRebalance()anddtf.prepareDistributeFees()now take{ version }. Read it withsdk.index.getVersion/useIndexDtfVersion.IndexDtfCall(contract.abiisAbi,contract.functionNameisstring,contract.argsisreadonly unknown[]); call sites that relied on the narrower inferred type must widen.getIndexDtfRebalanceNonce(sdk.index.getRebalanceNonce,ref.getRebalanceNonce,useIndexDtfRebalanceNonce) reads Folio 6.0'sgetRebalanceNonce().9baa37a: Index DTF rebalance: explicit version contract and protocol-accurate auction state.
prepareIndexDtfOpenAuctionArgs,prepareIndexDtfOpenAuctionandbuildIndexDtfStartRebalanceArgsnow requireversion("5.0.0"|"6.0.0") and reject anything else withSdkError(INVALID_INPUT); there is no silent v5 default.buildIndexDtfStartRebalancereads the proxy version when none is passed and applies the same check.auctionLengthand carries it into the args;prepareIndexDtfOpenAuctionuses it when no explicit length is passed.getLatestAuction/getActiveAuctionresolve one block first and pin every read to it, reportcurrentRebalanceNonceandblockNumber, and treat an auction as active only whilestartTime <= now <= endTime(inclusive, as Folio checks) and its nonce matches the current rebalance.Patch Changes
require("@reserve-protocol/sdk")exported{ default: abi }instead of the ABI array forfolioV6Abi,folioArtifactAbi,folioDeployerV6Abi,folioVersionRegistryAbi,dtfIndexAbi,dtfIndexAbiV1,dtfIndexAbiV2,dtfIndexAbiV4,dtfIndexGovernanceAbi,dtfIndexStakingVaultAbiandtimelockAbi, so encoding with them failed (abi.filter is not a function). ESM was unaffected. The ABI modules no longer carry a default export, andcheck:packagenow packs the tarball and loads it through bothimportandrequirein CI and the release gate.require("@reserve-protocol/sdk").dtfCatalog: the CommonJS entry re-exported the catalog's module namespace ({ default, indexDtfs, ... }) instead of the chain-keyed catalog, because the bundler's interop for a re-exported default hands outmodule.exports. The catalog now also exports the combined catalog by name (dtfCatalog, same object as the default export), and the SDK re-exports that.check:packagenow compares every export's value between the ESM and CommonJS entries, not just its kind.reserve-index-dtfartifacts, and encode v6 basket proposals with the expected rebalance nonce and required execution deadline. V6 fee-recipient calls now require both mutable and immutable recipient tables; higher-level revenue proposals reject v6 until they can preserve the immutable table.INVALID_INPUT(metatokens) when enforcement is on and a rebalance token is missing from it, instead of building a proposal whosestartRebalancerevertsFolio__TokenNotAllowlistedon execution.openAuctioncalls with the required trailing auction length while preserving the existing Folio 5.0 call shape.