Skip to content

Commit

Permalink
Add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
oldchili committed Dec 6, 2023
1 parent 76a377e commit 2c5f9b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/StickyOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
pragma solidity ^0.8.16;

interface PipLike {
function read() external view returns (uint128);
function peek() external view returns (uint128, bool);
function read() external view returns (uint128); // TODO: shouldn't this (and our function) return bytes32? https://github.com/makerdao/osm/blob/e36c874b4e14fba860e48c0cf99cd600c0c59efa/src/osm.sol#L150C49-L150C56
function peek() external view returns (uint128, bool); // TODO: shouldn't this (and our function) return (bytes32, bool)? https://github.com/makerdao/osm/blob/e36c874b4e14fba860e48c0cf99cd600c0c59efa/src/osm.sol#L142
}
// TODO: should we implement peep as well? (even if a dummy implementation) Scribe does - https://github.com/chronicleprotocol/scribe/blob/41f25a8a40f1a1d2ef62d6a073f98a3c57d23579/src/Scribe.sol#L276.

contract StickyOracle {
mapping (address => uint256) public wards;
Expand Down Expand Up @@ -105,7 +106,7 @@ contract StickyOracle {
function init(uint256 days_) external auth {
require(cap == 0, "StickyOracle/already-init");

uint128 pokePrice_ = pokePrice = cap = pip.read();
uint128 pokePrice_ = pokePrice = cap = pip.read(); // TODO: should this use peek() and return true/false instead of reverting? it will be called from a spell so we don't want it to revert
uint256 pokeDay_ = pokeDay = block.timestamp / 1 days;
uint256 accumulatedVal = 0;
uint32 accumulatedTs = uint32(block.timestamp - days_ * 1 days);
Expand Down

0 comments on commit 2c5f9b3

Please sign in to comment.