-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
contracts/oracle/implementations/arbitrum/EUR/OracleSTEURETHChainlinkArbitrum.sol
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,35 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity ^0.8.12; | ||
|
||
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | ||
|
||
import "../../../BaseOracleChainlinkMultiTwoFeeds.sol"; | ||
import "../../../../interfaces/external/IERC4626.sol"; | ||
|
||
/// @title OracleSTEURETHChainlinkArbitrum | ||
/// @author Angle Labs, Inc. | ||
/// @notice Gives the price of stEUR in ETH in base 18 | ||
contract OracleSTEURETHChainlinkArbitrum is BaseOracleChainlinkMultiTwoFeeds { | ||
string public constant DESCRIPTION = "stEUR/ETH Oracle"; | ||
IERC4626 public constant STEUR = IERC4626(0x004626A008B1aCdC4c74ab51644093b155e59A23); | ||
|
||
constructor(uint32 _stalePeriod, address _treasury) BaseOracleChainlinkMultiTwoFeeds(_stalePeriod, _treasury) {} | ||
|
||
/// @inheritdoc IOracle | ||
function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) { | ||
AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](2); | ||
// Oracle agEUR/USD | ||
_circuitChainlink[0] = AggregatorV3Interface(0x37963F10245e7c3a10c0E9d43a6E617B4Bc8440A); | ||
// Oracle ETH/USD | ||
_circuitChainlink[1] = AggregatorV3Interface(0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612); | ||
return _circuitChainlink; | ||
} | ||
|
||
/// @inheritdoc BaseOracleChainlinkMultiTwoFeeds | ||
function _getQuoteAmount() internal view override returns (uint256) { | ||
return STEUR.convertToAssets(1 ether); | ||
} | ||
|
||
// TODO: latestAnswer | ||
} |
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,37 @@ | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import yargs from 'yargs'; | ||
|
||
import { OracleSTEURETHChainlinkArbitrum, OracleSTEURETHChainlinkArbitrum__factory } from '../../typechain'; | ||
|
||
const argv = yargs.env('').boolean('ci').parseSync(); | ||
|
||
const func: DeployFunction = async ({ deployments, ethers, network }) => { | ||
const { deploy } = deployments; | ||
const { deployer } = await ethers.getNamedSigners(); | ||
|
||
// const treasury = (await deployments.get(`Treasury`)).address; | ||
const treasury = '0x37963F10245e7c3a10c0E9d43a6E617B4Bc8440A'; | ||
console.log('Now deploying the Oracle wstETH/USD'); | ||
console.log(`Treasury: ${treasury}`); | ||
await deploy('Oracle_STEUR_ETH', { | ||
contract: `OracleSTEURETHChainlinkArbitrum`, | ||
from: deployer.address, | ||
args: [3600 * 36, treasury], | ||
log: !argv.ci, | ||
}); | ||
const oracle = (await deployments.get('Oracle_STEUR_ETH')).address; | ||
console.log(`Successfully deployed Oracle stEUR/ETH at the address ${oracle}`); | ||
|
||
const oracleContract = new ethers.Contract( | ||
oracle, | ||
OracleSTEURETHChainlinkArbitrum__factory.createInterface(), | ||
deployer, | ||
) as OracleSTEURETHChainlinkArbitrum; | ||
|
||
const oracleValue = await oracleContract.read(); | ||
console.log('Oracle value', oracleValue.toString()); | ||
console.log(''); | ||
}; | ||
|
||
func.tags = ['newOracle']; | ||
export default func; |
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
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
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