PriceProvidersRepository
PriceProvidersRepository
A repository of price providers. It manages price providers as well as maps assets to their price provider. It acts as a entry point for Silo for token prices.
Methods
acceptOwnership
Transfers ownership of the contract to a pending owner Can only be called by the pending owner.
addPriceProvider
Register new price provider
Parameters
_provider
contract IPriceProvider
undefined
changeManager
Change manager address
Callable by manager or external owner role
Parameters
_manager
address
new manager address
getPrice
Returns "Time-Weighted Average Price" for an asset
Parameters
_asset
address
address of an asset for which to read price
Returns
_0
uint256
TWAP price of a token with 18 decimals
isPriceProvider
Returns true if address is a registered price provider
Parameters
_provider
contract IPriceProvider
address of price provider to be removed
Returns
_0
bool
true if address is a registered price provider, otherwise false
manager
Gets manager role address
Returns
_0
address
manager role address
owner
Returns the address of the current owner.
Returns
_0
address
undefined
pendingOwner
Returns the address of the pending owner.
Returns
_0
address
undefined
priceProviders
Maps asset address to its price provider
Each asset must have a price provider contract assigned, otherwise it's not supported
Parameters
_0
address
undefined
Returns
_0
contract IPriceProvider
undefined
priceProvidersRepositoryPing
Sanity check funciton
Returns
_0
bool
returns always TRUE
providerList
Gets an array of price providers
Returns
_0
address[]
array of price providers
providersCount
Gets number of pice providers registerd
Returns
_0
uint256
number of pice providers registerd
providersReadyForAsset
Check if prices are available for an asset
Parameters
_asset
address
asset address to check
Returns
_0
bool
returns TRUE if price feed is ready, otherwise false
quoteToken
Token in which prices are quoted. It's most likely WETH, however it could vary from deployment to deployment. For example 1 SILO costs X amount of quoteToken.
Returns
_0
address
undefined
removePriceProvider
Unregister price provider
Parameters
_provider
contract IPriceProvider
undefined
renounceOwnership
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
setPriceProviderForAsset
Sets price provider for asset
Request for asset price is forwarded to the price provider assigned to that asset
Parameters
_asset
address
address of an asset for which price provider will be used
_provider
contract IPriceProvider
undefined
siloRepository
SiloRepository contract address
Returns
_0
address
undefined
transferOwnership
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
newOwner
address
undefined
transferPendingOwnership
Transfers pending ownership of the contract to a new account (newPendingOwner
). Can only be called by the current owner.
Parameters
newPendingOwner
address
undefined
Events
ManagerChanged
Emitted when manager is changed
Parameters
manager
address
undefined
NewPriceProvider
Emitted when price provider is added
Parameters
newPriceProvider
contract IPriceProvider
undefined
OwnershipPending
Emitted when ownership transfer is proposed, aka pending owner is set
Parameters
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
OwnershipTransferred
Emitted when ownership is transferred on transferOwnership
and acceptOwnership
Parameters
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
PriceProviderForAsset
Emitted when asset is assigned to price provider
Parameters
asset indexed
address
undefined
priceProvider
contract IPriceProvider
undefined
PriceProviderRemoved
Emitted when price provider is removed
Parameters
priceProvider
contract IPriceProvider
undefined
Last updated