makerdao / univ2-lp-oracle

GNU Affero General Public License v3.0
23 stars 13 forks source link

CFV-51: make seek less overflow-prone #48

Closed kmbarry1 closed 3 years ago

kmbarry1 commented 3 years ago

See updated comments for explanation.

There is one irrelevant commit in this PR: removing require(ts == block.timestamp from seek. A quick read of the Uniswap v2 code is sufficient to show this is useless at best: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2Pair.sol . OTOH, removing it will save a little gas. I slipped it into this PR since I was touching seek anyway, but happy to move it to its own PR if that is preferred.