PositionTokenRenderer
Inherits: IPositionTokenRenderer
Title: Position Token Renderer
Implementation of the IPositionTokenRenderer interface This contract implements a custom token renderer for the Olympus Deposit Position Manager
Constants
DISPLAY_DECIMALS
The number of decimal places to display when rendering values as decimal strings
uint8 public constant DISPLAY_DECIMALS = 2;
OHM_DECIMALS
uint8 public constant OHM_DECIMALS = 9;
Functions
tokenURI
Renders the token URI for a given position
This function should return a valid JSON metadata string that follows the ERC721 metadata standard
function tokenURI(
address positionManager_,
uint256 positionId_
) external view override returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
| positionManager_ | address | The address of the position manager contract |
| positionId_ | uint256 | The ID of the position to render |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string | The token URI as a string |
_getTimeString
function _getTimeString(uint48 time_) internal pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
| time_ | uint48 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
_renderSVG
function _renderSVG(
IDepositPositionManager.Position memory position_,
string memory cdSymbol_,
bool positionIsConvertible_
) internal view returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
| position_ | IDepositPositionManager.Position | |
| cdSymbol_ | string | |
| positionIsConvertible_ | bool |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
supportsInterface
function supportsInterface(bytes4 interfaceId_) external pure returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId_ | bytes4 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |