Abstract Base Oracle

SimpleOracle and BaseOracle are abstract contracts that will standardize and extend some useful features to all price providers while inheriting our basic interface TokenPriceOracle.

Among the features that BaseOracle implement are:

  • Implementing ERC165: Declares support of contract interfaces (such as ITokenPriceOracle, Multicall), which can then be queried by others.

  • Adding Multicall support: Provides a function to batch together multiple calls in a single external call, allowing multiple quotes for multiple pairs.

SimpleOracle inherits all BaseOracle features while also standardizing the implementation of addOrModifySupportForPair and addSupportForPairIfNeeded functions by defining and re-using the abstract internal function _addOrModifySupportForPair . This internal function should be defined by whomever inherits SimpleOracle.

Last updated