-
Notifications
You must be signed in to change notification settings - Fork 488
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
add state view contract #187
Conversation
view | ||
returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee) | ||
{ | ||
return StateLibrary.getSlot0(poolManager, poolId); |
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.
i think it would be nicer to have poolManager.getX(...)
for each of these
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.
Can I do that separately? i'd like this commit to show the deploy broadcast info with the same bytecode 😄
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.
maybe its not that important tho..
src/lens/StateView.sol
Outdated
|
||
/** | ||
* @notice Live calculate the fee growth inside a tick range of a pool | ||
* @dev pools[poolId].feeGrowthInside0LastX128 in Position.Info is cached and can become stale. This function will live calculate the feeGrowthInside |
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.
* @dev pools[poolId].feeGrowthInside0LastX128 in Position.Info is cached and can become stale. This function will live calculate the feeGrowthInside | |
* @dev pools[poolId].feeGrowthInside0LastX128 in Position.Info is cached and can become stale. This function will calculate the up to date feeGrowthInside |
A lot of offchain services will want to read core state. This is a lens contract we can deploy to expose that to integrators