Skip to content

Commit

Permalink
feat: add crv gauge oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
r0ohafza committed Sep 23, 2022
1 parent 59b26a3 commit ac5c4b6
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/curve/Stable2CurveGaugeOracle.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {IOracle} from "../core/IOracle.sol";

interface IGauge {
function lp_token() external view returns (address);
}

/**
@title Stable 2 curve gauge oracle
@notice Price Oracle for 2 curve stable gauge
*/
contract Stable2CurveGaugeOracle is IOracle {

/* -------------------------------------------------------------------------- */
/* STATE VARIABLES */
/* -------------------------------------------------------------------------- */

/// @notice Oracle Facade
IOracle immutable oracleFacade;

/* -------------------------------------------------------------------------- */
/* CONSTRUCTOR */
/* -------------------------------------------------------------------------- */

/**
@notice Contract constructor
@param _oracle Address of oracleFacade
*/
constructor(IOracle _oracle) {
oracleFacade = _oracle;
}

/* -------------------------------------------------------------------------- */
/* PUBLIC FUNCTIONS */
/* -------------------------------------------------------------------------- */

/// @inheritdoc IOracle
function getPrice(address token) external view returns (uint) {
return oracleFacade.getPrice(IGauge(token).lp_token());
}
}

0 comments on commit ac5c4b6

Please sign in to comment.