From 2c5f9b31bd042a98f2982c2ae94ca25063230d6c Mon Sep 17 00:00:00 2001 From: oldchili <130549691+oldchili@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:25:59 +0200 Subject: [PATCH] Add some TODOs --- src/StickyOracle.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/StickyOracle.sol b/src/StickyOracle.sol index ff5c2018..89684218 100644 --- a/src/StickyOracle.sol +++ b/src/StickyOracle.sol @@ -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; @@ -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);