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: standardize positions and observations functions documentation #1018

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

Standardize the documentation format for positions() and observations() functions in IUniswapV3PoolState.sol. This change focuses on improving clarity and maintaining consistency with Solidity documentation best practices.

Changes

  • Standardize return value documentation with proper @return tags
  • Remove redundant commas and "Returns" prefixes
  • Simplify descriptions while maintaining technical accuracy
  • Make documentation more concise and direct

Technical Details

The changes maintain all the important technical information while presenting it in a more standardized format:

  • For positions(): Clearly document the position key structure and return values
  • For observations(): Improve clarity of observation data structure documentation

Before and After Comparison

positions() Before:

// Returns liquidity The amount of liquidity in the position,
/// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
/// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,

positions() After:

/// @return liquidity The amount of liquidity in the position
/// @return feeGrowthInside0LastX128 Fee growth of token0 inside the tick range as of the last mint/burn/poke
/// @return feeGrowthInside1LastX128 Fee growth of token1 inside the tick range as of the last mint/burn/poke

observations() Before:

/// @return blockTimestamp The timestamp of the observation,
/// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
/// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,

observations() After:

/// @return blockTimestamp The timestamp of the observation
/// @return tickCumulative The tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp
/// @return secondsPerLiquidityCumulativeX128 The seconds per in range liquidity for the life of the pool as of the observation timestamp

Type of change

Documentation update (non-breaking change)

Checklist

  • Documentation update only
  • No code changes
  • No breaking changes
  • Improves documentation consistency
  • Maintains all technical details

- Add proper @return tags for all return parameters
- Remove redundant commas and 'Returns' prefixes
- Improve documentation clarity and consistency
- Maintain technical accuracy while simplifying format
Copy link

@l14zj l14zj left a comment

Choose a reason for hiding this comment

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

‏_xcciu

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