-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into certora/dev
- Loading branch information
Showing
60 changed files
with
1,369 additions
and
1,367 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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts |
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 |
---|---|---|
@@ -1,12 +1,43 @@ | ||
# Morpho Blue | ||
|
||
## Licensing | ||
Morpho Blue is a noncustodial lending protocol implemented for the Ethereum Virtual Machine. | ||
Morpho Blue offers a new trustless primitive with increased efficiency and flexibility compared to existing lending platforms. | ||
It provides permissionless risk management and permissionless market creation with oracle agnostic pricing. | ||
It also enables higher collateralization factors, improved interest rates, and lower gas consumption. | ||
The protocol is designed to be a simple, immutable, and governance-minimized base layer that allows for a wide variety of other layers to be built on top. | ||
Morpho Blue also offers a convenient developer experience with a singleton implementation, callbacks, free flash loans, and account management features. | ||
|
||
The primary license for Morpho Blue is the Business Source License 1.1 (`BUSL-1.1`), see [`LICENSE`](./LICENSE). However, some files are dual licensed under `GPL-2.0-or-later`. | ||
## Whitepaper | ||
|
||
All files in the following folders can also be licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers): | ||
- `src/interfaces`, see [`src/interfaces/LICENSE`](./src/interfaces/LICENSE) | ||
- `src/libraries`, see [`src/libraries/LICENSE`](./src/libaries/LICENSE) | ||
- `src/mocks`, see [`src/mocks/LICENSE`](./src/mocks/LICENSE) | ||
- `test`, see [`test/LICENSE`](./test/LICENSE) | ||
- `certora`, see [`certora/LICENSE`](./certora/LICENSE) | ||
The protocol is described in detail in the [Morpho Blue Whitepaper](./morpho-blue-whitepaper.pdf). | ||
|
||
## Repository Structure | ||
|
||
[`Morpho.sol`](./src/Morpho.sol) contains most of the source code of the core contract of Morpho Blue. | ||
It solely relies on internal libraries in the [`src/libraries`](./src/libraries) subdirectory. | ||
|
||
Libraries in the [`src/libraries/periphery`](./src/libraries/periphery) directory are not used by Morpho Blue. | ||
They are useful helpers that integrators can reuse or adapt to their own needs. | ||
|
||
The [`src/mocks`](./src/mocks) directory contains contracts designed exclusively for testing. | ||
|
||
You'll find relevant comments in [`IMorpho.sol`](./src/interfaces/IMorpho.sol), notably a list of requirements about market dependencies. | ||
|
||
## Getting Started | ||
|
||
Install dependencies: `yarn` | ||
|
||
Run forge tests: `yarn test:forge` | ||
|
||
Run hardhat tests: `yarn test:hardhat` | ||
|
||
You will find other useful commands in the [`package.json`](./package.json) file. | ||
|
||
## Audits | ||
|
||
All audits are stored in the [audits](./audits/)' folder. | ||
|
||
## Licences | ||
|
||
The primary license for Morpho Blue is the Business Source License 1.1 (`BUSL-1.1`), see [`LICENSE`](./LICENSE). | ||
However, all files in the following folders can also be licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers): [`src/interfaces`](./src/interfaces), [`src/libraries`](./src/libraries), [`src/mocks`](./src/mocks), [`test`](./test), [`certora`](./certora). |
Binary file not shown.
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
Submodule openzeppelin-contracts
deleted from
fd81a9
Binary file not shown.
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/ | ||
@morpho-blue/=./ |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity >=0.6.2; | ||
pragma solidity >=0.5.0; | ||
|
||
/// @title IERC20 | ||
/// @author Morpho Labs | ||
/// @custom:contact security@morpho.xyz | ||
/// @custom:contact security@morpho.org | ||
/// @dev Empty because we only call library functions. It prevents calling transfer (transferFrom) instead of | ||
/// safeTransfer (safeTransferFrom). | ||
interface IERC20 {} |
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity >=0.6.2; | ||
pragma solidity >=0.5.0; | ||
|
||
/// @title IOracle | ||
/// @author Morpho Labs | ||
/// @custom:contact security@morpho.xyz | ||
/// @custom:contact security@morpho.org | ||
/// @notice Interface that oracles used by Morpho must implement. | ||
interface IOracle { | ||
/// @notice Returns the price of 1 asset of collateral token quoted in 1 asset of borrowable token, scaled by 1e36. | ||
/// @dev It corresponds to the price of 10**(collateral decimals) assets of collateral token quoted in | ||
/// 10**(borrowable decimals) assets of borrowable token with `36 + borrowable decimals - collateral decimals` | ||
/// @notice Returns the price of 1 asset of collateral token quoted in 1 asset of loan token, scaled by 1e36. | ||
/// @dev It corresponds to the price of 10**(collateral token decimals) assets of collateral token quoted in | ||
/// 10**(loan token decimals) assets of loan token with `36 + loan token decimals - collateral token decimals` | ||
/// decimals of precision. | ||
function price() external view returns (uint256); | ||
} |
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
Oops, something went wrong.