-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add crv gauge oracle * fix: update solidity version
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |