Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
chore: add ctoken and clean up interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Sawit Trisirisatayawong committed Mar 10, 2021
1 parent 4dd2dfd commit 078123f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 23 deletions.
2 changes: 0 additions & 2 deletions interfaces/aave/Aave.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pragma solidity ^0.5.17;

interface Aave {
function getRevision() internal pure returns (uint256);

/**
* @dev deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens)
* is minted.
Expand Down
2 changes: 1 addition & 1 deletion interfaces/aave/LendingPoolAddressesProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.5.17;
@notice provides the interface to fetch the LendingPoolCore address
*/

contract ILendingPoolAddressesProvider {
contract LendingPoolAddressesProvider {
/**
* @dev returns the address of the LendingPool proxy
* @return the lending pool proxy address
Expand Down
15 changes: 3 additions & 12 deletions interfaces/aave/Oracle.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
pragma solidity ^0.5.17;

/************
@title IPriceOracle interface
@notice Interface for the Aave price oracle.*/
interface IPriceOracle {
/***********
@dev returns the asset price in ETH
*/
function getAssetPrice(address _asset) external view returns (uint256);
interface Oracle {
function getAssetPrice(address reserve) external view returns (uint256);

/***********
@dev sets the asset price, in wei
*/
function setAssetPrice(address _asset, uint256 _price) external;
function latestAnswer() external view returns (uint256);
}
8 changes: 1 addition & 7 deletions interfaces/compound/Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ interface cToken {
*/
function allowance(address owner, address spender) external view returns (uint256);

/**
* @dev Function to simply retrieve block number
* This exists mainly for inheriting test contracts to stub this result.
*/
function getBlockNumber() internal view returns (uint256);

/**
* @notice Returns the current per-block borrow interest rate for this cToken
* @return The borrow interest rate per block, scaled by 1e18
Expand Down Expand Up @@ -118,7 +112,7 @@ interface cToken {

/**
* @notice Get the token balance of the `owner`
* @param owner The address of the account to query
* @param _owner The address of the account to query
* @return The number of tokens owned by `owner`
*/
function balanceOf(address _owner) external view returns (uint256);
Expand Down
27 changes: 27 additions & 0 deletions interfaces/cream/CToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.17;

interface CToken {
function decimals() external view returns (uint8);

function totalSupply() external view returns (uint256);

function underlying() external view returns (address);

function balanceOfUnderlying(address) external returns (uint256);

function supplyRatePerBlock() external returns (uint256);

function exchangeRateCurrent() external returns (uint256);

function mint(uint256) external returns (uint256);

function balanceOf(address) external view returns (uint256);

function redeemUnderlying(uint256) external returns (uint256);

function redeem(uint256) external returns (uint256);

function approve(address, uint256) external returns (bool);
}
4 changes: 3 additions & 1 deletion interfaces/cream/Controller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

pragma solidity ^0.5.17;

import "./CToken.sol";

interface Creamtroller {
/**
* @notice Claim all the comp accrued by holder in all markets
Expand Down Expand Up @@ -29,5 +31,5 @@ interface Creamtroller {
* @param cTokens The list of addresses of the cToken markets to be enabled
* @return Success indicator for whether each corresponding market was entered
*/
function enterMarkets(address[] memory cTokens) public returns (uint256[] memory);
function enterMarkets(address[] calldata cTokens) external returns (uint256[] memory);
}

0 comments on commit 078123f

Please sign in to comment.