-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from joaobrunoah/rate-provider/binance-st-eth
Create a RateProvider to wBETH
- Loading branch information
Showing
2 changed files
with
63 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,37 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "./interfaces/IRateProvider.sol"; | ||
import "./interfaces/IwBETH.sol"; | ||
|
||
/** | ||
* @title Wrapped Binance Beacon ETH Rate Provider | ||
* @notice Returns the value of wBETH in terms of ETH | ||
*/ | ||
contract BinanceBeaconEthRateProvider is IRateProvider { | ||
IwBETH public immutable wBETH; | ||
|
||
constructor(IwBETH _wBETH) { | ||
wBETH = _wBETH; | ||
} | ||
|
||
/** | ||
* @return the value of wBETH in terms of ETH | ||
*/ | ||
function getRate() external view override returns (uint256) { | ||
return wBETH.exchangeRate(); | ||
} | ||
} |
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,26 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
/** | ||
* @title Token wrapper for Binance ETH staking deposits. | ||
*/ | ||
interface IwBETH { | ||
/** | ||
* @notice Get amount of ETH for 1 wBETH | ||
* @return Amount of ETH for 1 wBETH | ||
*/ | ||
function exchangeRate() external view returns (uint256); | ||
} |