UniswapV2PriceProviderMock
Overview
License: MIT
This implementation can be affected by price manipulation due to not using TWAP. For development purposes only
Structs info
PriceInfo
UniswapV2Metadata
Events info
GrantModeratorRole
RevokeModeratorRole
SetTokenAndPrice
ChangeActive
SetTokenDecimals
Constants info
MODERATOR_ROLE (0x797669c9)
DESCRIPTION (0xf1ae8856)
State variables info
tokenDecimals (0x3b97e856)
uniswapV2Metadata (0x809205db)
tokenPrice (0x84ba3f69)
Modifiers info
onlyAdmin
onlyModerator
Functions info
initialize (0x8129fc1c)
grantModerator (0x6981c7ae)
revokeModerator (0x36445636)
setTokenDecimals (0xf2cf47be)
Sets the number of decimals used by the token. Only the moderator can call this function.
Parameters:
Name | Type | Description |
---|---|---|
newTokenDecimals | uint8 | The new number of decimals used by the token. |
setTokenAndPrice (0x179750ec)
changeActive (0x258a4532)
Changes the active status of a token.
Parameters:
Name | Type | Description |
---|---|---|
token | address | The address of the token to change the active status for. |
active | bool | The new active status of the token. |
isListed (0xf794062e)
Returns a boolean indicating whether the given token address is listed in the price provider.
Parameters:
Name | Type | Description |
---|---|---|
token | address | The address of the token to check. |
Return values:
Name | Type | Description |
---|---|---|
[0] | bool | A boolean indicating whether the token is listed or not. |
isActive (0x9f8a13d7)
Returns whether a token is active or not.
Parameters:
Name | Type | Description |
---|---|---|
token | address | The address of the token to check. |
Return values:
Name | Type | Description |
---|---|---|
[0] | bool | A boolean indicating whether the token is active or not. |
getPrice (0x41976e09)
Returns the price of the specified token.
Parameters:
Name | Type | Description |
---|---|---|
token | address | The address of the token to get the price for. |
Return values:
Name | Type | Description |
---|---|---|
priceMantissa | uint256 | The price of the token, represented as a mantissa. |
priceDecimals | uint8 | The number of decimal places in the token's price. |
getReserves (0x32749461)
getPriceDecimals (0x1b30aafc)
Returns the number of decimal places for the price returned by the price provider.
Return values:
Name | Type | Description |
---|---|---|
priceDecimals | uint8 | The number of decimal places for the price. |
Last updated