Uniswap V 2 Price Provider
UniswapV2 price provider This implementation can be affected by price manipulation due to not using TWAP For development purposes only
Methods
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
DESCRIPTION
Returns
_0
string
undefined
MODERATOR_ROLE
Returns
_0
bytes32
undefined
changeActive
Parameters
token
address
undefined
active
bool
undefined
getEvaluation
Parameters
token
address
undefined
tokenAmount
uint256
undefined
Returns
evaluation
uint256
undefined
getEvaluationSigned
return the evaluation in $ of tokenAmount
with signed price
Parameters
token
address
the address of token to get evaluation in $
tokenAmount
uint256
the amount of token to get evaluation. Amount is scaled by 10 in power token decimals
priceMantissa
uint256
the price multiplied by priceDecimals. The dimension of priceMantissa should be $/token
validTo
uint256
the timestamp in seconds, when price is gonna be not valid.
signature
bytes
the ECDSA sign on eliptic curve secp256k1.
Returns
evaluation
uint256
undefined
getPrice
Parameters
token
address
undefined
Returns
price
uint256
undefined
priceDecimals
uint8
undefined
getPriceDecimals
Returns
_0
uint8
undefined
getPriceSigned
Parameters
token
address
undefined
priceMantissa
uint256
undefined
validTo
uint256
undefined
signature
bytes
undefined
Returns
_priceMantissa
uint256
undefined
_priceDecimals
uint8
undefined
getReserves
Parameters
uniswapPair
address
undefined
tokenA
address
undefined
tokenB
address
undefined
Returns
reserveA
uint256
undefined
reserveB
uint256
undefined
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
role
bytes32
undefined
Returns
_0
bytes32
undefined
grandModerator
Parameters
newModerator
address
undefined
grantRole
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
role
bytes32
undefined
account
address
undefined
hasRole
Returns true
if account
has been granted role
.
Parameters
role
bytes32
undefined
account
address
undefined
Returns
_0
bool
undefined
initialize
isActive
Parameters
token
address
undefined
Returns
_0
bool
undefined
isListed
Parameters
token
address
undefined
Returns
_0
bool
undefined
renounceRole
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
role
bytes32
undefined
account
address
undefined
revokeModerator
Parameters
moderator
address
undefined
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
role
bytes32
undefined
account
address
undefined
setTokenAndPair
Parameters
token
address
undefined
pair
address
undefined
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
uniswapV2Metadata
Parameters
_0
address
undefined
Returns
isActive
bool
undefined
pair
address
undefined
pairAsset
address
undefined
tokenDecimals
uint8
undefined
pairAssetDecimals
uint8
undefined
usdDecimals
Returns
_0
uint8
undefined
Events
ChangeActive
Parameters
who indexed
address
undefined
token indexed
address
undefined
active
bool
undefined
GrandModeratorRole
Parameters
who indexed
address
undefined
newModerator indexed
address
undefined
RevokeModeratorRole
Parameters
who indexed
address
undefined
moderator indexed
address
undefined
RoleAdminChanged
Parameters
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
RoleGranted
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
RoleRevoked
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
SetTokenAndPair
Parameters
who indexed
address
undefined
token indexed
address
undefined
pair indexed
address
undefined
Last updated