Descriptor
Git Source - Generated with forge doc
Describes NFT token positions
Reference: https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/NFTDescriptor.sol
State Variables
sqrt10X128
uint256 constant sqrt10X128 = 1076067327063303206878105757264492625226;
Functions
constructTokenURI
Constructs the token URI for a Uniswap v4 NFT
function constructTokenURI(ConstructTokenURIParams memory params) internal pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
params | ConstructTokenURIParams | Parameters needed to construct the token URI |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The token URI as a string |
escapeSpecialCharacters
Escapes special characters in a string if they are present
function escapeSpecialCharacters(string memory symbol) internal pure returns (string memory);
generateDescriptionPartOne
Generates the first part of the description for a Uniswap v4 NFT
function generateDescriptionPartOne(
string memory quoteCurrencySymbol,
string memory baseCurrencySymbol,
string memory poolManager
) private pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
quoteCurrencySymbol | string | The symbol of the quote currency |
baseCurrencySymbol | string | The symbol of the base currency |
poolManager | string | The address of the pool manager |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The first part of the description |
generateDescriptionPartTwo
Generates the second part of the description for a Uniswap v4 NFTs
function generateDescriptionPartTwo(
string memory tokenId,
string memory baseCurrencySymbol,
string memory quoteCurrency,
string memory baseCurrency,
string memory hooks,
string memory feeTier
) private pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | string | The token ID |
baseCurrencySymbol | string | The symbol of the base currency |
quoteCurrency | string | The address of the quote currency |
baseCurrency | string | The address of the base currency |
hooks | string | The address of the hooks contract |
feeTier | string | The fee tier of the pool |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The second part of the description |
generateName
Generates the name for a Uniswap v4 NFT
function generateName(ConstructTokenURIParams memory params, string memory feeTier)
private
pure
returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
params | ConstructTokenURIParams | Parameters needed to generate the name |
feeTier | string | The fee tier of the pool |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The name of the NFT |
generateDecimalString
function generateDecimalString(DecimalStringParams memory params) private pure returns (string memory);
tickToDecimalString
Gets the price (quote/base) at a specific tick in decimal form MIN or MAX are returned if tick is at the bottom or top of the price curve
function tickToDecimalString(
int24 tick,
int24 tickSpacing,
uint8 baseCurrencyDecimals,
uint8 quoteCurrencyDecimals,
bool flipRatio
) internal pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
tick | int24 | The tick (either tickLower or tickUpper) |
tickSpacing | int24 | The tick spacing of the pool |
baseCurrencyDecimals | uint8 | The decimals of the base currency |
quoteCurrencyDecimals | uint8 | The decimals of the quote currency |
flipRatio | bool | True if the ratio was flipped |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The ratio value as a string |
sigfigsRounded
function sigfigsRounded(uint256 value, uint8 digits) private pure returns (uint256, bool);