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.
function acceptOwnership() external nonpayable
Transfers ownership of the contract to a pending owner Can only be called by the pending owner.
function addPriceProvider(contract IPriceProvider _provider) external nonpayable
Register new price provider
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | undefined |
function changeManager(address _manager) external nonpayable
Change manager address
Callable by manager or external owner role
Name | Type | Description |
---|---|---|
_manager | address | new manager address |
function getPrice(address _asset) external view returns (uint256)
Returns "Time-Weighted Average Price" for an asset
Name | Type | Description |
---|---|---|
_asset | address | address of an asset for which to read price |
Name | Type | Description |
---|---|---|
_0 | uint256 | TWAP price of a token with 18 decimals |
function isPriceProvider(contract IPriceProvider _provider) external view returns (bool)
Returns true if address is a registered price provider
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | address of price provider to be removed |
Name | Type | Description |
---|---|---|
_0 | bool | true if address is a registered price provider, otherwise false |
function manager() external view returns (address)
Gets manager role address
Name | Type | Description |
---|---|---|
_0 | address | manager role address |
function owner() external view returns (address)
Returns the address of the current owner.
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function pendingOwner() external view returns (address)
Returns the address of the pending owner.
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function priceProviders(address) external view returns (contract IPriceProvider)
Maps asset address to its price provider
Each asset must have a price provider contract assigned, otherwise it's not supported
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | contract IPriceProvider | undefined |
function priceProvidersRepositoryPing() external pure returns (bool)
Sanity check funciton
Name | Type | Description |
---|---|---|
_0 | bool | returns always TRUE |
function providerList() external view returns (address[])
Gets an array of price providers
Name | Type | Description |
---|---|---|
_0 | address[] | array of price providers |
function providersCount() external view returns (uint256)
Gets number of pice providers registerd
Name | Type | Description |
---|---|---|
_0 | uint256 | number of pice providers registerd |
function providersReadyForAsset(address _asset) external view returns (bool)
Check if prices are available for an asset
Name | Type | Description |
---|---|---|
_asset | address | asset address to check |
Name | Type | Description |
---|---|---|
_0 | bool | returns TRUE if price feed is ready, otherwise false |
function quoteToken() external view returns (address)
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.
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function removePriceProvider(contract IPriceProvider _provider) external nonpayable
Unregister price provider
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | undefined |
function renounceOwnership() external nonpayable
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.function setPriceProviderForAsset(address _asset, contract IPriceProvider _provider) external nonpayable
Sets price provider for asset
Request for asset price is forwarded to the price provider assigned to that asset
Name | Type | Description |
---|---|---|
_asset | address | address of an asset for which price provider will be used |
_provider | contract IPriceProvider | undefined |
function siloRepository() external view returns (address)
SiloRepository contract address
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function transferOwnership(address newOwner) external nonpayable
Transfers ownership of the contract to a new account (
newOwner
). Can only be called by the current owner.Name | Type | Description |
---|---|---|
newOwner | address | undefined |
function transferPendingOwnership(address newPendingOwner) external nonpayable
Transfers pending ownership of the contract to a new account (
newPendingOwner
). Can only be called by the current owner.Name | Type | Description |
---|---|---|
newPendingOwner | address | undefined |
event ManagerChanged(address manager)
Emitted when manager is changed
Name | Type | Description |
---|---|---|
manager | address | undefined |
event NewPriceProvider(contract IPriceProvider newPriceProvider)
Emitted when price provider is added
Name | Type | Description |
---|---|---|
newPriceProvider | contract IPriceProvider | undefined |
event OwnershipPending(address indexed previousOwner, address indexed newOwner)
Emitted when ownership transfer is proposed, aka pending owner is set
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Emitted when ownership is transferred on
transferOwnership
and acceptOwnership
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
event PriceProviderForAsset(address indexed asset, contract IPriceProvider priceProvider)
Emitted when asset is assigned to price provider
Name | Type | Description |
---|---|---|
asset indexed | address | undefined |
priceProvider | contract IPriceProvider | undefined |
event PriceProviderRemoved(contract IPriceProvider priceProvider)
Emitted when price provider is removed
Name | Type | Description |
---|---|---|
priceProvider | contract IPriceProvider | undefined |
Last modified 1yr ago