I Price Provider Aggregator

Methods

MODERATOR_ROLE

function MODERATOR_ROLE() external view returns (bytes32)

Returns

NameTypeDescription

_0

bytes32

undefined

changeActive

function changeActive(address priceProvider, address token, bool active) external nonpayable

Parameters

NameTypeDescription

priceProvider

address

undefined

token

address

undefined

active

bool

undefined

getEvaluation

function getEvaluation(address token, uint256 tokenAmount) external view returns (uint256 evaluation)

returns the USD evaluation of token by its tokenAmount

Parameters

NameTypeDescription

token

address

the address of token to evaluate

tokenAmount

uint256

the amount of token to evaluate

Returns

NameTypeDescription

evaluation

uint256

undefined

getEvaluationSigned

function getEvaluationSigned(address token, uint256 tokenAmount, uint256 priceMantissa, uint8 priceDecimals, uint256 validTo, bytes signature) external view returns (uint256 evaluation)

returns the USD evaluation of token by its tokenAmount

Parameters

NameTypeDescription

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)

priceDecimals

uint8

- the price decimals (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

NameTypeDescription

evaluation

uint256

undefined

getPrice

function getPrice(address token) external view returns (uint256 priceMantissa, uint8 priceDecimals)

price = priceMantissa / (10 ** priceDecimals)

returns tuple (priceMantissa, priceDecimals)

Parameters

NameTypeDescription

token

address

the address of token wich price is to return

Returns

NameTypeDescription

priceMantissa

uint256

undefined

priceDecimals

uint8

undefined

getPriceSigned

function getPriceSigned(address token, uint256 _priceMantissa, uint8 _priceDecimals, uint256 validTo, bytes signature) external view returns (uint256 priceMantissa, uint8 priceDecimals)

returns the price 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

NameTypeDescription

token

address

the address of token

_priceMantissa

uint256

- the price of token (used in verifying the signature)

_priceDecimals

uint8

- the price decimals (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

NameTypeDescription

priceMantissa

uint256

undefined

priceDecimals

uint8

undefined

grandModerator

function grandModerator(address newModerator) external nonpayable

Parameters

NameTypeDescription

newModerator

address

undefined

initialize

function initialize() external nonpayable

revokeModerator

function revokeModerator(address moderator) external nonpayable

Parameters

NameTypeDescription

moderator

address

undefined

setTokenAndPriceProvider

function setTokenAndPriceProvider(address token, address priceProvider, bool hasFunctionWithSign) external nonpayable

Parameters

NameTypeDescription

token

address

undefined

priceProvider

address

undefined

hasFunctionWithSign

bool

undefined

tokenPriceProvider

function tokenPriceProvider(address projectToken) external view returns (address priceProvider, bool hasSignedFunction)

Parameters

NameTypeDescription

projectToken

address

undefined

Returns

NameTypeDescription

priceProvider

address

undefined

hasSignedFunction

bool

undefined

usdDecimals

function usdDecimals() external view returns (uint8)

Returns

NameTypeDescription

_0

uint8

undefined

Events

ChangeActive

event ChangeActive(address indexed who, address indexed priceProvider, address indexed token, bool active)

Parameters

NameTypeDescription

who indexed

address

undefined

priceProvider indexed

address

undefined

token indexed

address

undefined

active

bool

undefined

GrandModeratorRole

event GrandModeratorRole(address indexed who, address indexed newModerator)

Parameters

NameTypeDescription

who indexed

address

undefined

newModerator indexed

address

undefined

RevokeModeratorRole

event RevokeModeratorRole(address indexed who, address indexed moderator)

Parameters

NameTypeDescription

who indexed

address

undefined

moderator indexed

address

undefined

SetTokenAndPriceProvider

event SetTokenAndPriceProvider(address indexed who, address indexed token, address indexed priceProvider)

Parameters

NameTypeDescription

who indexed

address

undefined

token indexed

address

undefined

priceProvider indexed

address

undefined

Last updated