-
Notifications
You must be signed in to change notification settings - Fork 614
Permissioned Pools #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Permissioned Pools #476
Conversation
| address permissionedToken1 = | ||
| WRAPPED_TOKEN_FACTORY.verifiedPermissionedTokenOf(Currency.unwrap(poolKey.currency1)); | ||
| if (permissionedToken0 != address(0)) { | ||
| IWrappedPermissionedToken(permissionedToken0).isAllowed(msgSender()); |
There was a problem hiding this comment.
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 😄 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!!
* 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
7522c84 to
1154a7a
Compare
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
PositionManagerandV4Router.Updates to
PositionManagerandV4Router:Enhanced
PositionManagerfunctionality:_mintand_paymethods virtual to allow overriding in derived contracts. (src/PositionManager.sol, [1] [2]PermissionedPositionManagercontract, which overrides_mintand_payto enforce permissioned token checks and wrapping logic. (src/hooks/permissionedPools/PermissionedPositionManager.sol, src/hooks/permissionedPools/PermissionedPositionManager.solR1-R74)Permissioned Router:
PermissionedV4Routercontract, which integrates permissioned token wrapping and allowlist checks into the router's payment logic. (src/hooks/permissionedPools/PermissionedV4Router.sol, src/hooks/permissionedPools/PermissionedV4Router.solR1-R53)Implementation of Wrapped Permissioned Tokens:
Wrapped Permissioned Token Contract:
WrappedPermissionedTokencontract to manage wrapping and unwrapping of permissioned tokens, enforce allowlist checks, and restrict token transfers to the pool manager. (src/hooks/permissionedPools/WrappedPermissionedToken.sol, src/hooks/permissionedPools/WrappedPermissionedToken.solR1-R104)Wrapped Permissioned Token Factory:
WrappedPermissionedTokenFactorycontract to facilitate the creation and verification of wrapped permissioned tokens. (src/hooks/permissionedPools/WrappedPermissionedTokenFactory.sol, src/hooks/permissionedPools/WrappedPermissionedTokenFactory.solR1-R42)New Interfaces for Permissioned Pools:
Allowlist Checker Interface:
IAllowlistCheckerinterface to standardize allowlist checks for permissioned tokens. (src/hooks/permissionedPools/interfaces/IAllowlistChecker.sol, src/hooks/permissionedPools/interfaces/IAllowlistChecker.solR1-R8)Wrapped Permissioned Token Interface:
IWrappedPermissionedTokeninterface to define the behavior of wrapped permissioned tokens, including wrapping, unwrapping, and allowlist checks. (src/hooks/permissionedPools/interfaces/IWrappedPermissionedToken.sol, src/hooks/permissionedPools/interfaces/IWrappedPermissionedToken.solR1-R60)Wrapped Permissioned Token Factory Interface:
IWrappedPermissionedTokenFactoryinterface to define methods for creating and verifying wrapped permissioned tokens. (src/hooks/permissionedPools/interfaces/IWrappedPermissionedTokenFactory.sol, src/hooks/permissionedPools/interfaces/IWrappedPermissionedTokenFactory.solR1-R48)