Open
Conversation
jakub-lore
reviewed
Feb 12, 2026
jakub-lore
reviewed
Feb 12, 2026
jakub-lore
reviewed
Feb 12, 2026
jakub-lore
reviewed
Feb 12, 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.
Summary
This PR delivers two major improvements:
BackedAutoFeeTokenWrappedBackedTokenthat operates directly on shares of the underlying token rather than transferring tokensIt also extracts the
IBackedAutoFeeTokeninterface and removes the delegate whitelist mechanism from the wrapped token.Changes
1. New
IBackedAutoFeeTokenInterfaceFile:
contracts/interfaces/IBackedAutoFeeToken.solA new dedicated interface is introduced for the auto-fee token, consolidating:
MultiplierUpdatestruct with fields:previousMultiplier,newMultiplier,activationTimeNewMultiplierUpdater,TransferShares,MultiplierUpdatedMultiplierScheduledevent, emitted when a future multiplier activation is queuedBackedAutoFeeTokenImplementationnow explicitly implements this interface.2. Multiplier Update History in
BackedAutoFeeTokenImplementationFile:
contracts/BackedAutoFeeTokenImplementation.solMultiplierUpdate[] public multiplierUpdates— a new on-chain array that stores every scheduled multiplier change (past and future), enabling historical lookups._storeScheduledMultiplierUpdate()— internal function called on every multiplier update. If the last stored entry has a future activation time (i.e., not yet applied), it is overridden, since only one scheduled update can be pending at a time. The new entry is then appended.initialize_v4()— a one-time migration initializer that seeds themultiplierUpdatesarray with a genesis entry (multiplier = 1e18, activationTime = 0) and any historically provided past updates.multiplierUpdatesLength()— a new view function returning the array length.updateMultiplierValue()andupdateMultiplierValueWithNonce()now call_storeScheduledMultiplierUpdate()after scheduling.MultiplierScheduledevent is emitted when a future-dated multiplier update is queued.3. Share-based
WrappedBackedTokenFile:
contracts/WrappedBackedTokenImplementation.solThe wrapped token is redesigned to operate on shares of the underlying
IBackedAutoFeeTokenrather than on token balances:totalAssets()— recalculated as the contract's shares balance × current multiplier, ensuring the wrapper's asset accounting always reflects the rebasing of the underlying token._convertToShares()/_convertToAssets()— now fetchgetCurrentMultiplier()from the underlyingIBackedAutoFeeTokenfor all conversions._deposit()— transfers shares from the user (viatransferSharesFrom) instead of ERC20 tokens; mints wrapped tokens 1:1 with shares received._withdraw()— burns wrapped tokens and transfers shares back to the receiver (viatransferShares).previewMint()andpreviewWithdraw()— overridden to useRounding.Downto accommodate multiplier math.setDelegateWhitelist(),setDelegateMode(),allowedDelegatemodifier, and thepermit()override are all deleted.delegatedTransfer()andpermit()are now open to all callers.WrappedBackedToken: sender is sanctioned/WrappedBackedToken: spender is sanctioned.4. Factory Fix
File:
contracts/WrappedBackedTokenFactory.solsaltfor proxy deployment now includes theunderlyingtoken address (previously onlyname+symbol), preventing salt collisions across different underlying tokens with the same name/symbol.upgradeToAndCall()is used to initialize it, and finallychangeAdmin()transfers proxy admin rights — enabling the factory to call initialization within the same transaction.5. Tests
test/BackedAutoFeeTokenImplementation.ts(+212 lines)New tests covering:
multiplierUpdatesarray storage and contentsinitialize_v4migration initializerMultiplierScheduledevent emissionmultiplierUpdatesLength()view functiontest/WrappedBackedTokenImplementation.ts(+599 / -52 lines)Expanded test suite covering:
deposit,mint,withdraw,redeemflowspreviewDeposit,previewMint,previewWithdraw,previewRedeem)Stats