Functions readMaxValue and readMinValue need to be implemented

オープン
#2 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
solidity
領域
blockchain

調査の方向性

Start by locating readMaxValue and readMinValue in the Solidity contracts, then read the existing value-submission and history logic. Confirm how N and gamma are represented before implementing the described historical traversal and update behavior; done means both functions return the highest or lowest value from the N most recent stored averages.

索引モデルが issue の本文から書いたものです。

説明

enhancement

These two functions are important for protocols such as Djed Shu.

There are different ways in which we could implement them. Here is a reasonable and simple one:

  • We keep an array of historical average values.

  • When readMaxValue is called, we traverse the N most recent values from this array and return the highest average price found.

  • When readMinValue is called, we traverse the N most recent values from this array and return the lowest average price found.

  • Let t be the timestamp of the most recent entry in the history array. Whenever a new value is submitted at time a t' and t' > t + gamma, the new average should be pushed into the history array.

The reason for having a minimal interval gamma is that we want the maximum and minimum value to be values over a significant period of time.

(I have a simple idea to optimize the traversals by caching some results. But let's implement the non-optimized version first, which traverses the history on every call to read...Value . Later we can discuss the caching optimization.)

主要言語
Solidity
スター
3
フォーク
3
平均マージ
15時間 55分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

StabilityNexus/OrbOracle-Solidity のほかの issue

StabilityNexus/OrbOracle-Solidity の issue をすべて見る

似ている issue

Blockchain の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。