-
Notifications
You must be signed in to change notification settings - Fork 22
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
1 parent
b060563
commit e428e50
Showing
3 changed files
with
98 additions
and
12 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
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,22 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.7; | ||
|
||
import {ICErc20, ICToken} from "../interfaces/compound/ICompound.sol"; | ||
|
||
/// Price Oracle for liquidation tests | ||
contract SimplePriceOracle { | ||
mapping(address => uint256) public prices; | ||
|
||
function getUnderlyingPrice(ICToken _cToken) public view returns (uint256) { | ||
return prices[address(ICErc20(address(_cToken)).underlying())]; | ||
} | ||
|
||
function setUnderlyingPrice(ICToken _cToken, uint256 _underlyingPriceMantissa) public { | ||
address asset = address(ICErc20(address(_cToken)).underlying()); | ||
prices[asset] = _underlyingPriceMantissa; | ||
} | ||
|
||
function setDirectPrice(address _asset, uint256 _price) public { | ||
prices[_asset] = _price; | ||
} | ||
} |
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