Skip to main content

PositionTokenRenderer

Git Source

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

NameTypeDescription
positionManager_addressThe address of the position manager contract
positionId_uint256The ID of the position to render

Returns

NameTypeDescription
<none>stringThe token URI as a string

_getTimeString​

function _getTimeString(uint48 time_) internal pure returns (string memory);

Parameters

NameTypeDescription
time_uint48

Returns

NameTypeDescription
<none>string

_renderSVG​

function _renderSVG(
IDepositPositionManager.Position memory position_,
string memory cdSymbol_,
bool positionIsConvertible_
) internal view returns (string memory);

Parameters

NameTypeDescription
position_IDepositPositionManager.Position
cdSymbol_string
positionIsConvertible_bool

Returns

NameTypeDescription
<none>string

supportsInterface​

function supportsInterface(bytes4 interfaceId_) external pure returns (bool);

Parameters

NameTypeDescription
interfaceId_bytes4

Returns

NameTypeDescription
<none>bool