Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates specification of SrotedOracles #10970

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/protocol/contracts/stability/SortedOracles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Returns the number of rates that are currently stored for a specifed rateFeedId.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the number of rates is being retrieved.
* @return uint256 The number of reported oracle rates stored for the given rateFeedId.
*/
Expand Down Expand Up @@ -355,6 +356,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Gets all elements from the doubly linked list.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the rates are being retrieved.
* @return keys Keys of an unpacked list of elements from largest to smallest.
* @return values Values of an unpacked list of elements from largest to smallest.
Expand All @@ -371,6 +373,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Returns the number of timestamps.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the number of timestamps is being retrieved.
* @return uint256 The number of oracle report timestamps for the specified rateFeedId.
*/
Expand All @@ -381,6 +384,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Returns the median timestamp.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the median timestamp is being retrieved.
* @return uint256 The median report timestamp for the specified rateFeedId.
*/
Expand All @@ -391,6 +395,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Gets all elements from the doubly linked list.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the timestamps are being retrieved.
* @return keys Keys of nn unpacked list of elements from largest to smallest.
* @return values Values of an unpacked list of elements from largest to smallest.
Expand All @@ -407,6 +412,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Checks if a report exists for a specified rateFeedId from a given oracle.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the report should be checked.
* @param oracle The oracle whose report should be checked.
* @return bool True if a report exists, false otherwise.
Expand All @@ -418,6 +424,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Returns the list of oracles for a speficied rateFeedId.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the oracles are being retrieved.
* @return address[] A list of oracles for the given rateFeedId.
*/
Expand All @@ -428,6 +435,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Returns the expiry for specified rateFeedId if it exists, if not the default is returned.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the report expiry is being retrieved.
* @return The report expiry in seconds.
*/
Expand All @@ -442,6 +450,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
/**
* @notice Removes an oracle value and updates the median.
* @dev Does not take the equivalentTokens mapping into account.
* For that, the underlying token should be queried.
* @param token The token for which the oracle report should be removed.
* @param oracle The oracle whose value should be removed.
* @dev This can be used to delete elements for oracles that have been removed.
Expand Down
Loading