LPPriceProvider
Overview
License: MIT
The LPPriceProvider contract is the contract that provides the functionality of getting the latest price from Uniswap V2 LP tokens.
Contract that provides the functionality of getting the latest price from Uniswap V2 LP tokens. Inherit from PriceProvider.
Structs info
LPMetadata
Events info
SetLPTokenAndPriceProvider
Emitted when the LPToken and its corresponding price provider are set.
Parameters:
ChangeActive
Emitted when the active status of a token changes.
Parameters:
SetTokenDecimals
Emitted when the token decimals is set.
Parameters:
Constants info
MODERATOR_ROLE (0x797669c9)
State variables info
tokenDecimals (0x3b97e856)
lpMetadata (0x1e3214d8)
Modifiers info
onlyModerator
Modifier to restrict access to functions to only the contract's moderator.
Functions info
initialize (0x8129fc1c)
Initializes the LPPriceProvider contract by setting up the access control roles and the number of decimals for the USD price.
setTokenDecimals (0xf2cf47be)
Sets the number of decimals used by the token. Only the moderator can call this function.
Parameters:
setLPTokenAndProvider (0x98a0fb36)
Sets the LP token and price provider for the given LP token address.
Requirements:
lpToken
cannot be the zero address.provider
cannot be the zero address.
Parameters:
changeActive (0x258a4532)
Changes the active status of a token in the LPPriceProvider contract.
Requirements:
The token must be listed in the contract.
Only the contract moderator can call this function.
Parameters:
isListed (0xf794062e)
Checks if a token is listed in the LPPriceProvider.
Parameters:
Return values:
isActive (0x9f8a13d7)
Returns whether a token is active or not.
Parameters:
Return values:
getUSDPx (0x89378bc7)
Returns the value of the given input as ETH per unit, multiplied by 2**112.
Parameters:
Return values:
getPrice (0x41976e09)
Returns the price of the given LP token in USD.
Parameters:
Return values:
getPriceDecimals (0x1b30aafc)
Returns the number of decimals used for the price provided by this contract.
Return values:
Last updated