Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add crv gauge oracle #42

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.17;

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());
}
}