Skip to content

Conversation

@gretzke
Copy link
Contributor

@gretzke gretzke commented Jun 18, 2025

This pull request introduces a significant update to the codebase by adding support for permissioned pools and wrapped permissioned tokens. The changes include implementing new contracts, interfaces, and functionality to enforce allowlist checks, manage permissioned tokens, and integrate these features into existing components like PositionManager and V4Router.

Updates to PositionManager and V4Router:

  • Enhanced PositionManager functionality:

    • Made _mint and _pay methods virtual to allow overriding in derived contracts. (src/PositionManager.sol, [1] [2]
    • Added the PermissionedPositionManager contract, which overrides _mint and _pay to enforce permissioned token checks and wrapping logic. (src/hooks/permissionedPools/PermissionedPositionManager.sol, src/hooks/permissionedPools/PermissionedPositionManager.solR1-R74)
  • Permissioned Router:

Implementation of Wrapped Permissioned Tokens:

New Interfaces for Permissioned Pools:

@gretzke gretzke changed the title Initial commit: Permissioned Pools Permissioned Pools Jun 18, 2025
address permissionedToken1 =
WRAPPED_TOKEN_FACTORY.verifiedPermissionedTokenOf(Currency.unwrap(poolKey.currency1));
if (permissionedToken0 != address(0)) {
IWrappedPermissionedToken(permissionedToken0).isAllowed(msgSender());
Copy link

@ericneil-sanc ericneil-sanc Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question here: Given we are dealing with a permissioned/wrapped binary, why are we casting the permissioned token to an interface for the wrapped token? Shouldn't this be on poolKey.currency0 (and poolKey.currency1 for line 56)? Unless we are expecting the permissioned tokens to have the same function? I apologize if I am missing something, which definitely may be the case 😄 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!!

gretzke and others added 13 commits June 21, 2025 04:41
* Initial commit: wrapped token tests

* fix imports
* initial commit

* touch ups, rm shadowed vars

* bring in wrapped change

* format

* nit change to pure

* external, pure nit

* reset getCode paths

* relative imports

* fix isolated mint_clear_revert test

* use relative paths for mock allowlist

* use BaseAllowList not BaseAllowlist

* change allowList to allowlist

* move to permissioned tests folder

* all tests working

* merging new changes from permissioned-pools

* touch ups, rm shadowed vars

* bring in wrapped change

* format

* nit change to pure

* external, pure nit

* reset getCode paths

* relative imports

* fix isolated mint_clear_revert test

* use relative paths for mock allowlist

* use BaseAllowList not BaseAllowlist

* change allowList to allowlist

* move to permissioned tests folder

* all tests working

* replace mockAllowlist with permissionedPoolsBase

* rm mock allowlist

* run linter

* rm unused

* change casing on const

* reorganize vars

* add most of the tests mentioned in comments

* all paths covered

* seperate hooks contract instead of delegate router

* minor cleanup

* use all combinations of permissioned and normal in liq tests

* spacing nit

* nit, edit note

* add clarifying comment to wrapped factory balance check

* remove circular dependency from permissioned pools implementation (#482)

* initial commit

* rm fallback from permissioned v4 router, leave receive

* fix github ci

* use currency instead of ierc20 in some tests

* add comment to hooks on why verifyAllowlist is sufficient

* inherit from BaseHook contract

* remove unused import, generate gas snapshot

---------

Co-authored-by: gretzke <[email protected]>
* Initial commit: forced transfers by admins

* fix merge conflict

* remove event
* Initial commit: forced transfers by admins

* add granular allow list and multiple hooks and fix revert tests

* add coverage for receive

* permissioned v4 router test spacing nits

* change allowed hook check

* allowedHooks on pposm

* nit

* add inheritdoc to transferFrom

* fix merge conflict

* make setAllowedHook external

* fix test resulting for resolving conflict

* simplify checkAllowedHooks

* fix snapshot

---------

Co-authored-by: gretzke <[email protected]>
* initial commit

* linted

* make dispatch internal

* changed revert for command not implemented

* add underscore to internal/prive functions on permissioned v4 router

* applied fmt to permissioned v4 router
* Add check whether swapping is enabled

* Gas snapshot

* Add natspec to event
@gretzke gretzke force-pushed the permissioned-pools branch from 7522c84 to 1154a7a Compare November 3, 2025 10:54
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.

3 participants