Price Provider Aggregator
Methods
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
MODERATOR_ROLE
Returns
_0
bytes32
undefined
changeActive
Parameters
priceProvider
address
undefined
token
address
undefined
active
bool
undefined
getEvaluation
returns the USD evaluation of token by its tokenAmount
Parameters
token
address
the address of token to evaluate
tokenAmount
uint256
the amount of token to evaluate
Returns
evaluation
uint256
undefined
getEvaluationSigned
returns the USD evaluation of token by its tokenAmount
Parameters
token
address
the address of token
tokenAmount
uint256
the amount of token including decimals
priceMantissa
uint256
- the price of token (used in verifying the signature)
validTo
uint256
- the timestamp in seconds (used in verifying the signature)
signature
bytes
- the backend signature of secp256k1. length is 65 bytes
Returns
evaluation
uint256
undefined
getPrice
price = priceMantissa / (10 ** priceDecimals)
returns tuple (priceMantissa, priceDecimals)
Parameters
token
address
the address of token wich price is to return
Returns
priceMantissa
uint256
undefined
priceDecimals
uint8
undefined
getPriceSigned
returns the tupple (priceMantissa, priceDecimals) of token multiplied by 10 ** priceDecimals given by price provider. price can be calculated as priceMantissa / (10 ** priceDecimals) i.e. price = priceMantissa / (10 ** priceDecimals)
Parameters
token
address
the address of token
priceMantissa
uint256
- the price of token (used in verifying the signature)
validTo
uint256
- the timestamp in seconds (used in verifying the signature)
signature
bytes
- the backend signature of secp256k1. length is 65 bytes
Returns
priceMantissa_
uint256
undefined
priceDecimals
uint8
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
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
setTokenAndPriceProvider
sets price provider to token
Parameters
token
address
the address of token
priceProvider
address
the address of price provider. Should implememnt the interface of PriceProvider
hasFunctionWithSign
bool
true - if price provider has function with signatures false - if price provider does not have function with signatures
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
tokenPriceProvider
Parameters
_0
address
undefined
Returns
priceProvider
address
undefined
hasSignedFunction
bool
undefined
usdDecimals
Returns
_0
uint8
undefined
Events
ChangeActive
Parameters
who indexed
address
undefined
priceProvider 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
SetTokenAndPriceProvider
Parameters
who indexed
address
undefined
token indexed
address
undefined
priceProvider indexed
address
undefined
Last updated