Feat/v1.1.0 core upgrade variable names - #156
Merged
kamescg merged 11 commits intoAug 24, 2026
Merged
Conversation
recordDeposit/recordRedeem receive the minted/burned share count from MultiVault, so the DynamicFeeFlatPriceCurve params netStake/withdrawnStake are renamed to shares (matching IBaseCurve and the mock), with the 1:1 share==stake coupling stated at each hook entry. The internal band walk keeps the ledger's stake vocabulary, minus the meaningless 'net' qualifier. The quote hooks' informative impl names are promoted into the interface (assets -> baseAssets / grossAssets), and MultiVaultLib's dispatch helpers adopt the hook's own role names (receiver -> account, sharesForReceiver -> shares). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Bare 'tier' params adopt their role: sourceTier (_payDepositFee, _payFulcrumTiers, _walkDepositBands), fromTier (_nearestEligiblePriorTier), currentTier (recordRedeem), rateTier (quoteRedeemFee, previewRedeemFor); _walkDepositBands walks a bandTier cursor instead of mutating its param. - Edge/width functions take 'tier', not the spec's loop symbol 'k'. - 'share' meaning a portion of a fee pool becomes 'slice' (code + natspec), reserving 'share' for the vault unit; _creditByWeight local renamed. - recordRedeem's 'denom' becomes cohortStake (the residual cohort's stake), _weighPriorTiers' 'targetTier' becomes recipientTier to match its stake. - Mapping keys say 'account' like every function param; the public 'earned' mapping becomes internal settledEarnings, leaving bankedEarnings() as the one read for the settled balance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
growthGBps -> tierWidthGrowthBps: the only bps field whose subject was a single letter, and easily misread as a typo next to depositGrowthBps / withdrawalGrowthBps. fulcrumAlphaBps: it is denominated in bps [0, BPS] like every other rate field, and was the only one missing the suffix. Struct is calldata ABI on initialize/setConfig, renamed before the fresh deploy freezes it; tests, deploy script and call-flow docs updated in lockstep. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The curve's fee pair was deposit/withdrawal while the hook surface it implements is Deposit/Redeem and MultiVault's operation is redeem; in ERC-4626 terms 'withdraw' names the asset-denominated exit, which is precisely what recordRedeem is not. One vocabulary now: redeemBaseBps, redeemGrowthBps, redeemCapBps, redeemToFulcrumTiersBps, TierFeeOverride.redeemFeeBps, MAX_REDEEM_CAP_BPS, redeemFeeBps(), _redeemFeeBps(), RedeemFeeRerouted. MultiVault's own exit fee keeps its 'exit' name (vault-level) as before. Natspec, tests, deploy script and call-flow docs follow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- FeeProxy_ZeroValue -> FeeProxy_ZeroAssets: it guards asset amounts, never
msg.value ('value' is reserved for msg.value, as in InsufficientValue).
- The affiliate fee amount is 'affiliateFee' everywhere: DepositedVia.fee,
the batch events' totalFee (which implied a per-leg sum — the fee is one
bps cut plus one fixed fee on the aggregate; natspec now says so),
AffiliateFeePaid.amount, _payAffiliate's param, and the preview returns
(fee, forwarded) -> (affiliateFee, forwardedAssets).
- Batch/creation 'assets' params -> grossAssets, matching depositVia and
keeping the proxy's pre-fee arrays distinct from MultiVault's post-fee
'assets' slot; _setupRoutingFlow and _allocate follow, and _allocate's
totalForwarded/totalGross regain their Assets suffix.
- updateFeeRecipient(recipient) -> feeRecipient (the struct/event name),
leaving bare 'recipient' to mean refund destination only.
- _assertFeeGuard(configuredFixed, guard) -> (configuredFixedFee, feeGuard);
fixedCap -> fixedFeeCap; _setupRoutingFlow's useCreationFees ->
isCreation to match _recordAffiliateStats; RegistrationFeeMismatch.sent
-> supplied (its sibling's name); RegistrationFeeForwarded.amount ->
registrationFee; FeeExceedsGross.gross -> grossAssets.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hook plumbing: _processRedeem and _recordCurveDeposit/_recordCurveRedeem adopt 'account' (the address whose shares are minted/burned), matching their callees and the IBaseCurve hook contract; the external redeem(receiver, ...) keeps its ABI name with corrected natspec saying the shares are burned from it under its REDEMPTION approval. Dataflow: one spelling per quantity — assetsBeforeFees (was rawAssetsBeforeFees / bare 'assets' on the redeem leg), assetsAfterFees at the update-vault writes, and feeBaseAssets for the base every rate fee is computed on (was assetsAfterFixedFees on the create path and assetsAfterMinSharesCost on the deposit path), including the accumulate helpers and the preview returns, whose natspec wrongly claimed the figure is credited to the vault. Rate vs amount: _feeOnRaw(amount, feeBps) -> (assets, feeRate) — the denominator is configurable storage, not fixed bps — and fee-amount locals take the ...FeeAmount suffix the external getters already use. Events (ABI-JSON only; topic hashes unchanged — indexers decoding by name must follow): Deposited.totalShares -> receiverSharesAfter and Redeemed.totalShares -> accountSharesAfter (both held the personal balance, while totalShares means vault supply everywhere else); Redeemed.assets/fees -> assetsAfterFees/totalFees (the curve-level redeem fee is included); fee events' amount -> feeAmount; Deposited.sender's create-path meaning (creator) documented. Roles and ids: maxRedeem(sender) -> account; _mint/_burn/burn amount -> shares; utilization deltas -> int256 assets on both legs (was totalValue / amountToRemove); pro-rata amount -> assets; _createTriples payment; _validatePayment locals -> _assetsSum; create-path bytes data -> atomDatas/atomData (multicall's data untouched); _hasCounterStake account; _finalizeAtomBatch atomCount; redeemBatch return 'received' -> assets; atomId/termId/tripleId/counterTripleId unified across IMultiVault, IMultiVaultCore, MultiVault, MultiVaultCore, including error params and the isAtom/isTriple predicates taking termId; _isCounterTriple's copy-pasted natspec and the creation-fee/VaultFees unit docs corrected. Also names _calculateRedeem/_calculateTripleCreate's returns and applies forge fmt to the files touched in this pass. Full suite: 2134 passed, 0 failed, 7 skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Also aligns the RolloverSystemUtilization test harness wrappers with the renamed utilization params (int256 assets). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e rename pass abis/ bytecodes/ and dist/ are tracked and published to consumers, so they still carried the pre-rename names (withdrawalFeeBps, growthGBps, fulcrumAlpha, FeeProxy_ZeroValue, MAX_WITHDRAWAL_CAP_BPS, the earned getter). Regenerated via 'bun run extract' and 'bun run build:ts'. Note: dist/ is listed in .gitignore but 12 of its files are tracked from before that rule, so they are refreshed here rather than left stale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reverts the data -> atomDatas/atomData rename in MultiVault and MultiVaultLib. Two reasons to keep the historical name: - The published ABI (abis/MultiVault.ts, what SDK consumers decode) has always carried 'data' — 7 occurrences — so the rename was a real downstream break for no functional gain. It is back to byte-equal with the base branch. - There is established precedent in this codebase for the plural array being called 'data'. Known cost, now a conscious keep rather than an oversight: the pre-existing interface/implementation split stays, with IMultiVault declaring 'atomDatas' (as it already did on main) and the implementation declaring 'data'. MultiVault_AtomExists(bytes atomData) and AtomCreated(..., bytes atomData, ...) keep atomData — they always had it, and atomDataMaxLength is untouched. Full suite: 2134 passed, 0 failed, 7 skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kamescg
marked this pull request as ready for review
August 24, 2026 04:07
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.
No description provided.