Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:morpho-dao/morpho-v1 into fix/staked…
Browse files Browse the repository at this point in the history
…-eth
  • Loading branch information
MerlinEgalite committed Sep 20, 2022
2 parents c9ffd06 + 1a56fcb commit 27ecd34
Show file tree
Hide file tree
Showing 56 changed files with 725 additions and 65 deletions.
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Morpho Core Protocol V1

[![Test](https://github.com/morpho-labs/morpho-contracts/actions/workflows/ci-foundry.yml/badge.svg)](https://github.com/morpho-labs/morpho-contracts/actions/workflows/ci-foundry.yml)
[![Test](https://github.com/morpho-labs/morpho-contracts/actions/workflows/ci-foundry.yml/badge.svg)](https://github.com/morpho-dao/morpho-v1/actions/workflows/ci-foundry.yml)

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/uLq5V14.png">
Expand All @@ -22,8 +22,6 @@ TL;DR: Instead of borrowing or lending on your favorite pool like Compound or Aa

## Contracts overview

In this repository.

The Morpho protocol is designed at its core with a set of contracts delegating calls to implementation contracts (to overcome the contract size limit).

Here is a brief overview of the Morpho protocol's contracts interactions:
Expand Down Expand Up @@ -173,4 +171,4 @@ For any question or feedback you can send an email to [[email protected]](mailto

## Licensing

The code is under the GNU General Public License v3.0 license, see [`LICENSE`](https://github.com/morphodao/morpho-core-v1/blob/main/LICENSE).
The code is under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0, see [`LICENSE`](./LICENSE).
2 changes: 1 addition & 1 deletion config/avalanche-mainnet/aave-v3/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.10;
pragma solidity >=0.8.0;

contract Config {
address constant aave = 0x63a72806098Bd3D9520cC43356dD78afe5D386D9;
Expand Down
2 changes: 1 addition & 1 deletion config/eth-mainnet/BaseConfig.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.13;
pragma solidity >=0.8.0;

contract BaseConfig {
address constant aave = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9;
Expand Down
2 changes: 1 addition & 1 deletion config/eth-mainnet/aave-v2/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.13;
pragma solidity >=0.8.0;

import {ILendingPool} from "@contracts/aave-v2/interfaces/aave/ILendingPool.sol";
import {IPriceOracleGetter} from "@contracts/aave-v2/interfaces/aave/IPriceOracleGetter.sol";
Expand Down
2 changes: 1 addition & 1 deletion config/eth-mainnet/compound/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.13;
pragma solidity >=0.8.0;

import "@contracts/compound/interfaces/compound/ICompound.sol";
import {IIncentivesVault} from "@contracts/compound/interfaces/IIncentivesVault.sol";
Expand Down
2 changes: 1 addition & 1 deletion config/goerli/compound/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.13;
pragma solidity >=0.8.0;

import "@contracts/compound/libraries/Types.sol";

Expand Down
2 changes: 1 addition & 1 deletion config/polygon-mainnet/aave-v3/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.10;
pragma solidity >=0.8.0;

contract Config {
address constant aave = 0xD6DF932A45C0f255f85145f286eA0b292B21C90B;
Expand Down
3 changes: 2 additions & 1 deletion config/polygon-mumbai/aave-v2/Config.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

import "@contracts/aave-v2/libraries/Types.sol";

Expand Down
2 changes: 1 addition & 1 deletion config/ropsten/compound/Config.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity 0.8.13;
pragma solidity >=0.8.0;

import "@contracts/compound/libraries/Types.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IEntryPositionsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IEntryPositionsManager {
function supplyLogic(
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IExitPositionsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IExitPositionsManager {
function withdrawLogic(
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IGetterUnderlyingAsset.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IGetterUnderlyingAsset {
function UNDERLYING_ASSET_ADDRESS() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IIncentivesVault.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./IOracle.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IInterestRatesManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IInterestRatesManager {
function ST_ETH() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/ILens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./aave/IPriceOracleGetter.sol";
import "./aave/ILendingPool.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IMorpho.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./aave/ILendingPoolAddressesProvider.sol";
import "./aave/ILendingPool.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IOracle {
function consult(uint256 _amountIn) external returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/IRewardsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./aave/IAaveIncentivesController.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/aave-v2/interfaces/aave/IAToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

import {IERC20} from "./IERC20.sol";
import {IScaledBalanceToken} from "./IScaledBalanceToken.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

interface IAaveDistributionManager {
event AssetConfigUpdated(address indexed asset, uint256 emission);
Expand Down
4 changes: 2 additions & 2 deletions contracts/aave-v2/interfaces/aave/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

/**
* @dev Interface of the ERC20 standard as defined in the EIP.
Expand Down
4 changes: 2 additions & 2 deletions contracts/aave-v2/interfaces/aave/ILendingPool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;
pragma experimental ABIEncoderV2;

import {ILendingPoolAddressesProvider} from "./ILendingPoolAddressesProvider.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

/**
* @title LendingPoolAddressesProvider contract
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/interfaces/aave/IPriceOracleGetter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

/************
@title IPriceOracleGetter interface
Expand Down
4 changes: 2 additions & 2 deletions contracts/aave-v2/interfaces/aave/IScaledBalanceToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

interface IScaledBalanceToken {
/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/aave-v2/interfaces/aave/IVariableDebtToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity >=0.8.0;

import {IScaledBalanceToken} from "./IScaledBalanceToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/IndexesLens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import "../interfaces/IInterestRatesManager.sol";
import "../interfaces/lido/ILido.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/Lens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import "./MarketsLens.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/LensStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import "../interfaces/aave/IPriceOracleGetter.sol";
import "../interfaces/aave/ILendingPool.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/MarketsLens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import "./RatesLens.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/RatesLens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import "../interfaces/aave/IVariableDebtToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/lens/UsersLens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity 0.8.13;

import {ERC20} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/libraries/aave/DataTypes.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;

library DataTypes {
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/libraries/aave/Errors.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v2/libraries/aave/ReserveConfiguration.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;

import {Errors} from "./Errors.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IEntryPositionsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IEntryPositionsManager {
function supplyLogic(
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IExitPositionsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IExitPositionsManager {
function withdrawLogic(
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IIncentivesVault.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./IOracle.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IInterestRatesManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IInterestRatesManager {
function updateIndexes(address _marketAddress) external;
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IMorpho.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "@aave/periphery-v3/contracts/rewards/interfaces/IRewardsController.sol";
import "./aave/IPool.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IOracle {
function consult(uint256 _amountIn, address _tokenIn) external returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/IRewardsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "@aave/periphery-v3/contracts/rewards/interfaces/IRewardsController.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/aave/IPool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import {IPoolAddressesProvider} from "./IPoolAddressesProvider.sol";
import {DataTypes} from "../../libraries/aave/DataTypes.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IPoolAddressesProvider {
function getPool() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/aave-v3/interfaces/aave/IPoolToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IPoolToken {
function UNDERLYING_ASSET_ADDRESS() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IIncentivesVault.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./IOracle.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IInterestRatesManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IInterestRatesManager {
function updateP2PIndexes(address _marketAddress) external;
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/ILens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./compound/ICompound.sol";
import "./IRewardsManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IMorpho.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./IInterestRatesManager.sol";
import "./IPositionsManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IOracle {
function consult(uint256 _amountIn) external returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IPositionsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IPositionsManager {
function supplyLogic(
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IRewardsManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

import "./compound/ICompound.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IWETH.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface IWETH {
function deposit() external payable;
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/compound/ICompound.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.0;
pragma solidity >=0.8.0;

interface ICEth {
function accrueInterest() external returns (uint256);
Expand Down
Loading

0 comments on commit 27ecd34

Please sign in to comment.