feat(v3-fee-adapter): add excluded-token set to V3OpenFeeAdapter - #134
Closed
pinky-gh[bot] wants to merge 1 commit into
Closed
feat(v3-fee-adapter): add excluded-token set to V3OpenFeeAdapter#134pinky-gh[bot] wants to merge 1 commit into
pinky-gh[bot] wants to merge 1 commit into
Conversation
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.
What
Adds an excluded-token set to
V3OpenFeeAdapterso the protocol can opt out of collecting fees in specific tokens across all v3 pools.Changes:
excludedTokensmapping (address → bool) onV3OpenFeeAdapterand its interface.setExcludedToken(address token, bool excluded)setter guarded byonlyOwner(tighter thanonlyFeeSetter, keeping the exclusion list under stricter control than routine fee adjustments).ExcludedTokenUpdated(address indexed token, bool excluded)event emitted on updates._setProtocolFeenow unpacks the waterfall-resolvedfeeValueinto its two 4-bit sides (feeProtocol0,feeProtocol1) and zeroes out whichever side corresponds to an excluded token before forwarding toIUniswapV3Pool.setFeeProtocol— so if USDC is excluded and istoken0in a pool,feeProtocol0is forced to 0 regardless of tier/global defaults.Why
The existing fee-setting waterfall has no concept of per-token exclusions — operators would have to manually zero the correct fee side pool-by-pool, knowing whether the unwanted token is token0 or token1 in each pool. This diff adds a single authoritative exclusion list that is applied automatically at fee-set time across all pools.
This is an illustrative example patch, not production-ready code.
🤖 Opened by cornbot on behalf of Mark Toda.