Uniswap / v4-periphery

🦄 🦄 🦄 🦄 Peripheral smart contracts for interacting with Uniswap v4
https://blog.uniswap.org/uniswap-v4
GNU General Public License v2.0
684 stars 463 forks source link

[posm]: Create a view only library specific to posm positions #171

Open snreynolds opened 1 month ago

snreynolds commented 1 month ago

Component

Position Manager

Describe the suggested feature and problem it solves.

This library should use StateLibrary.sol but be specific to querying information about a tokenId's position and should abstract away most under-the-hood logic (like the tokenId is used as a salt)

WRT this issue, we should maybe consider implementing the mapping from tokenId => positionId so this lookup is easier.

Also consider adding view functions for calculating fee growth of a specific position.

Describe the desired implementation.

No response

Describe alternatives.

No response

Additional context.

No response

linear[bot] commented 1 month ago

PROTO-332 [posm]: Create a view only library specific to posm positions

saucepoint commented 1 month ago

Decided to provide getters instead of extsload + library helpers because

  1. we arent as constrained by bytecode as PoolManager
  2. there's very little state on posm itself

partially closed with https://github.com/Uniswap/v4-periphery/pull/270 where a getter was added to access liquidity

still need a view function for fee growth, which will be useful for integrators and clients