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
changeManager
Change manager address
Callable by manager or external owner role
Parameters
getPrice
Returns "Time-Weighted Average Price" for an asset
Parameters
Returns
isPriceProvider
Returns true if address is a registered price provider
Parameters
Returns
manager
Gets manager role address
Returns
owner
Returns the address of the current owner.
Returns
pendingOwner
Returns the address of the pending owner.
Returns
priceProviders
Maps asset address to its price provider
Each asset must have a price provider contract assigned, otherwise it's not supported
Parameters
Returns
priceProvidersRepositoryPing
Sanity check funciton
Returns
providerList
Gets an array of price providers
Returns
providersCount
Gets number of pice providers registerd
Returns
providersReadyForAsset
Check if prices are available for an asset
Parameters
Returns
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
removePriceProvider
Unregister price provider
Parameters
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
siloRepository
SiloRepository contract address
Returns
transferOwnership
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
transferPendingOwnership
Transfers pending ownership of the contract to a new account (newPendingOwner
). Can only be called by the current owner.
Parameters
Events
ManagerChanged
Emitted when manager is changed
Parameters
NewPriceProvider
Emitted when price provider is added
Parameters
OwnershipPending
Emitted when ownership transfer is proposed, aka pending owner is set
Parameters
OwnershipTransferred
Emitted when ownership is transferred on transferOwnership
and acceptOwnership
Parameters
PriceProviderForAsset
Emitted when asset is assigned to price provider
Parameters
PriceProviderRemoved
Emitted when price provider is removed
Parameters
Last updated