Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: getLatest * feat: getTimeWeightedAverage * feat: add error for invalid pairs * test: add test for samples * docs: update enum docs * lint: forge fmt * test: setup scaffold and infra * test: testGetInstantValue_NotInitialized * test: findNearestSample * test: more error test cases * test: introduce wrapper for QueryProcessor * test: getPastAccumulator * test: extrapolating * test: interpolating * test: fix logic error * refactor: no longer passing struct to lib function * feat: add `unchecked` to arithmetic operations * lint: forge fmt * test: getTimeWeightedAverage * fix: make `updateOracle` emit an event * test: wip adding tests * test: `block.basefee` * docs: update comment for using `block.basefee` * refactor: move function around * chore: import euler's `IPriceOracle` * feat: introduce `Utils` * test: furnish cases * feat: reentrancy guard for certain functions * fix: change max price deviation threshold to 10% * refactor: change func sig for `updatePrice` * docs: note idea * fix: rm `name` function from interface * feat: `ReservoirPriceCache::setRoute` * test: complete `ReservoirPriceCache::setRoute` test suite * refactor: use base class for test * fix: extra step in test setUp * fix: updating logic for `_getQuote` * test: use `deployCodeTo` to have contracts at known addresses * wip: multiple hops for getQuote * docs: add docs for storage variables * refactor: avoiding repeating hardcoded values * fix: price inversion logic * fix: rm `isPriceUpdateIncentivized` function * refactor: make tests inherit from `BaseTest` * test: furnish many more cases for `updatePrice` * test: some cases for `ReservoirPriceOracle` * test: `getLatest` * test: `getPastAccumulators` * refactor: select all for using directive * test: getTimeWeightedAverage * doc: add todo * fix: merge `ReservoirPriceCache` and `ReservoirPriceOracle` * fix: logic optimizations * fix: change error message * test: address todo and add assert conditions * fix: rm unused error * fix: PR comments * fix: update interface after euler's vault kit release * feat: `SLOAD` optimized route and price * wip: `setRoute` and `clearRoute` * refactor: use `_calculateSlot` internal function * fix: emit event for `clearRoute` * fix: route between last and second last token * test: fix order of `expectEmit` * feat: `route` * refactor: use `_route` internal function * feat: new implementation for price cache * feat: new implementation for `_getQuote` * fix: rm console2 import * feat: complete `clearRoute` * feat: allow `updatePrice` to specify address(0) when not seeking reward * docs: rm comment * fix: do not shift address by 88 bits * docs: improve docs on assembly * refactor: streamline logic for populating intermediate routes * refactor: re-use shared variable * docs: add comment * docs: update comments * docs: update comment * wip: integrating decimal diff into data structure * fix: make `_priceCache` return the decimal diff as well * fix: price calculation works now * wip: squeezing route data into two words * refactor: store decimal differences in the second byte instead combining with route flag in the first * feat: packing a 3 hop route within two words * test: update req condition * fix: handle price when any hop's price is zero * docs: clarify comment on receiving ether as reward * test: fuzz everything one hop * test: randomize all 2 hop route * fix: decimal bug for intermediate route * test: finish 2 hop randomize everything test * forge install: solady v0.0.201 * test: use `EnumerableSetLib` to keep track of existing addresses * test: 3 hop test working * test: tighten assert condition * ci: enable `via-ir` to make test run * test: rm scratch tests * feat: return original amount for same base quote scenario * fix: handle case where `updatePrice` gives a price out of range * chore: rm unused reentrancy modifiers * refactor: put all errors into the `OracleErrors` lib * fix: calculate using intermediate amounts * fix: do not support reverse order of token for `getTimeWeightedAverage` * chore: upgrade solidity version to 0.8.26 * fix: use sequenced mul and div instead of inverting prices * feat: save 1 sload for 2 hop routes * refactor: move packing and bit shifting operations into lib * chore: change solc target back to 0.8.25 * docs: add safety comments for unchecked arithmetic * feat: introduce `MAX_SUPPORTED_PRICE` and `MAX_AMOUNT_IN` * ci: change solc target to 0.8.26 * fix: enforce only ordered token for raw oracle query * lint: forge fmt * docs: update safety comment on unchecked math * chore: update license to GPL 3.0
- Loading branch information