FactorLPDescriptor.sol
Contract Overview
The FactorLPDescriptor.sol
contract enables the SVG representation of a position to be generated on-chain. This is achieved via the encoding of position metadata as SVG strings.
Properties
Public
Property | Type | Modifier | Description |
---|---|---|---|
tokenDescriptions | mapping(address => string) | public | A mapping between the token address and the corresponding name (i.e. symbol). |
Structs
TokenURIParams
A struct that defines the URI of the token (representing a position on the underlying LP Vault contract).
Variables | Type | Description |
---|---|---|
id | uint256 | The identifier of the position managed by the LP Vault contract. |
name | string | The name of the LP Vault collection. Used as the NFT collection name. |
description | string | The symbol of the LP Vault collection. Used as the NFT collection symbol. |
token0 | address | The address of the liquidity position's token0 (i.e. 1 half of the token pair sorted alphabetically by address). |
token1 | address | The address of the liquidity position's token1 (i.e. the other half of the token pair sorted alphabetically by address). |
Methods
constructTokenURI() - public
view
returns
public
view
returns
Assembles the encoded string which contains the ERC721 metadata JSON. This includes a base64
string representation of the position's SVG image that contains position data.
Parameters
Params | Type | Description |
---|---|---|
params | An object that contains position information queried from the position's Strategy contract:
|
Returns
Type | Description |
---|---|
string | An encoded string that contains the ERC721 metadata JSON. This includes a |
renderImage() - private
view
returns
private
view
returns
Renders a base64
string that represents the position's information in a SVG format.
Parameters
Params | Type | Description |
---|---|---|
id | uint256 | The identifier of the position managed by the LP Vault contract. |
token0 | address | The address of the liquidity position's token0 (i.e. 1 half of the token pair sorted alphabetically by address). |
token1 | address | The address of the liquidity position's token1 (i.e. the other half of the token pair sorted alphabetically by address). |
Returns
Type | Description |
---|---|
string | A |
renderId() - private
view
returns
private
view
returns
Renders a SVG string of the position identifier.
Parameters
Params | Type | Description |
---|---|---|
id | uint256 | The identifier of the position managed by the LP Vault contract. |
Returns
Type | Description |
---|---|
string | A SVG string representation of the position identifier. |
renderStrategy() - private
view
returns
private
view
returns
Renders a SVG string of the Strategy's asset
and debt
names (i.e. symbols).
Parameters
Params | Type | Description |
---|---|---|
token0 | string | The name (i.e. symbol) of the Strategy's |
token1 | string | The name (i.e. symbol) of the Strategy's |
Returns
Type | Description |
---|---|
string | A SVG string representation of the position's |
Last updated