Skip to content
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

docs: improve slot0 function return value documentation #1016

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Caplost
Copy link

@Caplost Caplost commented Dec 17, 2024

Description

Improve the documentation format for the slot0() function in IUniswapV3PoolState.sol. Add proper @return tags for all return values to maintain consistent documentation style.

Changes

  • Add @return tags for all return parameters in slot0() function
  • Maintain detailed descriptions while improving readability
  • Keep consistent documentation format across the interface

Before

/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy

After

/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// @return tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick boundary.
/// @return observationIndex The index of the last oracle observation that was written
/// @return observationCardinality The current maximum number of observations stored in the pool
/// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation
/// @return feeProtocol The protocol fee for both tokens of the pool. Encoded as two 4 bit values, where the protocol fee of token1
/// is shifted 4 bits and the protocol fee of token0 is the lower 4 bits. Used as the denominator of a fraction of the swap fee,
/// e.g. 4 means 1/4th of the swap fee.
/// @return unlocked Whether the pool is currently locked to reentrancy

Type of change

Documentation update (non-breaking change)

Checklist

  • Documentation update only
  • No code changes
  • No breaking changes
  • Maintains all technical details while improving format

- Format each return value with proper @return tag
- Improve readability of slot0 function documentation
- Keep detailed descriptions while maintaining consistent format
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.

2 participants