Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit b413199

Browse files
Merge pull request #1554 from morpho-dao/upgrade-morpho-1
Upgrade Morpho #1
2 parents c66cdf3 + 4810ba9 commit b413199

90 files changed

Lines changed: 2052 additions & 2418 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/ci-foundry/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ runs:
7777

7878
- name: Check coverage threshold
7979
if: ${{ inputs.codecovToken != '' }}
80-
run: npx lcov-total lcov.info --gte=90.3
80+
run: npx lcov-total lcov.info --gte=90
8181
shell: bash
8282

8383
- name: Upload coverage to Codecov
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Autogenerated documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
autogen-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: recursive
15+
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
cache: yarn
20+
21+
- name: Install Foundry
22+
uses: onbjerg/foundry-toolchain@v1
23+
with:
24+
version: nightly
25+
26+
- name: Node dependencies cache
27+
uses: actions/cache@v3
28+
with:
29+
path: "node_modules"
30+
key: yarn-${{ hashFiles('yarn.lock') }}
31+
32+
- name: Install dependencies
33+
run: yarn install --frozen-lockfile
34+
shell: bash
35+
36+
- name: Generate docs
37+
run: forge doc --build
38+
shell: bash
39+
40+
- name: Upload docs
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: docs-foundry
44+
path: docs/book
45+
46+
upload-to-s3:
47+
runs-on: ubuntu-latest
48+
needs: autogen-docs
49+
environment:
50+
name: docs
51+
url: https://developers.morpho.xyz
52+
steps:
53+
- name: Download docs
54+
uses: actions/download-artifact@v2
55+
with:
56+
name: docs-foundry
57+
path: docs
58+
59+
- name: Setup AWS credentials
60+
uses: aws-actions/configure-aws-credentials@v1
61+
with:
62+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
63+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
64+
aws-region: ${{ secrets.AWS_REGION }}
65+
66+
- name: Upload docs to S3
67+
run: aws s3 sync ./docs s3://$BUCKET --delete --acl public-read
68+
env:
69+
BUCKET: ${{ secrets.AWS_S3_BUCKET }}
70+
71+
- name: Invalidate CloudFront cache
72+
run: aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/*"
73+
env:
74+
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ yarn-error.log*
3636
*.ansi
3737
*.html
3838
lcov.*
39+
40+
# docs
41+
/docs

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ It also interacts with `RewardsManager`, which manages the underlying pool's rew
4141
## Documentation
4242

4343
- [White Paper](https://whitepaper.morpho.xyz)
44+
- [Yellow Paper](https://yellowpaper.morpho.xyz/)
4445
- [Morpho Documentation](https://docs.morpho.xyz)
45-
- Yellow Paper (coming soon)
46+
- [Morpho Developers Documentation](https://developers.morpho.xyz)
4647

4748
---
4849

@@ -64,24 +65,25 @@ You can also send an email to [security@morpho.xyz](mailto:security@morpho.xyz)
6465
### Morpho-Compound Ethereum
6566

6667
- Morpho Proxy: [0x8888882f8f843896699869179fb6e4f7e3b58888](https://etherscan.io/address/0x8888882f8f843896699869179fb6e4f7e3b58888)
67-
- Morpho Implementation: [0xbbb011b923f382543a94e67e1d0c88d9763356e5](https://etherscan.io/address/0xbbb011b923f382543a94e67e1d0c88d9763356e5)
68-
- PositionsManager: [0x309a4505d79fcc59affaba205fdcb880d400ef39](https://etherscan.io/address/0x309a4505d79fcc59affaba205fdcb880d400ef39)
69-
- InterestRatesManager: [0x3e483225666871d192b686c42e6834e217a9871c](https://etherscan.io/address/0x3e483225666871d192b686c42e6834e217a9871c)
68+
- Morpho Implementation: [0xe3d7a242614174ccf9f96bd479c42795d666fc81](https://etherscan.io/address/0xe3d7a242614174ccf9f96bd479c42795d666fc81)
69+
- PositionsManager: [0x79a1b5888009bB4887E00EA27CF52551aAf2A004](https://etherscan.io/address/0x79a1b5888009bB4887E00EA27CF52551aAf2A004)
70+
- InterestRatesManager: [0xD9B7209eD2936b5c06990A8356D155c3665d43Ab](https://etherscan.io/address/0xD9B7209eD2936b5c06990A8356D155c3665d43Ab)
7071
- RewardsManager Proxy: [0x78681e63b6f3ad81ecd64aecc404d765b529c80d](https://etherscan.io/address/0x78681e63b6f3ad81ecd64aecc404d765b529c80d)
71-
- RewardsManager Implementation: [0xf47963cc317ebe4b8ebcf30f6e144b7e7e5571b7](https://etherscan.io/address/0xf47963cc317ebe4b8ebcf30f6e144b7e7e5571b7)
72+
- RewardsManager Implementation: [0x581c3816589ad0de7f9c76bc242c97fe96c9f100](https://etherscan.io/address/0x581c3816589ad0de7f9c76bc242c97fe96c9f100)
7273
- Lens Proxy: [0x930f1b46e1d081ec1524efd95752be3ece51ef67](https://etherscan.io/address/0x930f1b46e1d081ec1524efd95752be3ece51ef67)
73-
- Lens Implementation: [0xe54dde06d245fadcba50dd786f717d44c341f81b](https://etherscan.io/address/0xe54dde06d245fadcba50dd786f717d44c341f81b)
74+
- Lens Implementation: [0x834632a7c70ddd7badd3d21ba9d885a9da66b0de](https://etherscan.io/address/0x834632a7c70ddd7badd3d21ba9d885a9da66b0de)
75+
- Lens Extension: [0xc5c3bB32c70d1d547023346BD1E32a6c5BC7FD1e](https://etherscan.io/address/0xc5c3bB32c70d1d547023346BD1E32a6c5BC7FD1e)
7476
- CompRewardsLens: [0x9e977f745d5ae26c6d47ac5417ee112312873ba7](https://etherscan.io/address/0x9e977f745d5ae26c6d47ac5417ee112312873ba7)
7577

7678
### Morpho-Aave-V2 Ethereum
7779

7880
- Morpho Proxy: [0x777777c9898d384f785ee44acfe945efdff5f3e0](https://etherscan.io/address/0x777777c9898d384f785ee44acfe945efdff5f3e0)
79-
- Morpho Implementation: [0x206a1609a484db5129ca118f138e5a8abb9c61e0](https://etherscan.io/address/0x206a1609a484db5129ca118f138e5a8abb9c61e0)
80-
- EntryPositionsManager: [0x2a46cad23484c15f60663ece368395b3a249632a](https://etherscan.io/address/0x2a46cad23484c15f60663ece368395b3a249632a)
81-
- ExitPositionsManager: [0xfa652aa169c23277a941cf2d23d2d707fda60ed9](https://etherscan.io/address/0xfa652aa169c23277a941cf2d23d2d707fda60ed9)
82-
- InterestRatesManager: [0x4f54235e17eb8dcdfc941a77e7734a537f7bed86](https://etherscan.io/address/0x4f54235e17eb8dcdfc941a77e7734a537f7bed86)
81+
- Morpho Implementation: [0xFBc7693f114273739C74a3FF028C13769C49F2d0](https://etherscan.io/address/0xFBc7693f114273739C74a3FF028C13769C49F2d0)
82+
- EntryPositionsManager: [0x029Ee1AF5BafC481f9E8FBeD5164253f1266B968](https://etherscan.io/address/0x029Ee1AF5BafC481f9E8FBeD5164253f1266B968)
83+
- ExitPositionsManager: [0xfd9b1Ad429667D27cE666EA800f828B931A974D2](https://etherscan.io/address/0xfd9b1Ad429667D27cE666EA800f828B931A974D2)
84+
- InterestRatesManager: [0x22a4ecf5195c87605ae6bad413ae79d5c4170ff1](https://etherscan.io/address/0x22a4ecf5195c87605ae6bad413ae79d5c4170ff1)
8385
- Lens Proxy: [0x507fa343d0a90786d86c7cd885f5c49263a91ff4](https://etherscan.io/address/0x507fa343d0a90786d86c7cd885f5c49263a91ff4)
84-
- Lens Implementation: [0xce23e457fb01454b8c59e31f4f72e4bd3d29b5eb](https://etherscan.io/address/0xce23e457fb01454b8c59e31f4f72e4bd3d29b5eb)
86+
- Lens Implementation: [0x4bf26012b64312b462bf70f2e42d1be8881d0f84](https://etherscan.io/address/0x4bf26012b64312b462bf70f2e42d1be8881d0f84)
8587

8688
### Common Ethereum
8789

audits/Spearbit_MorphoV1.pdf

258 KB
Binary file not shown.

config/aave-v2/Config.sol

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ pragma solidity >=0.8.0;
33

44
import {ILendingPool} from "src/aave-v2/interfaces/aave/ILendingPool.sol";
55
import {IPriceOracleGetter} from "src/aave-v2/interfaces/aave/IPriceOracleGetter.sol";
6-
import {IAaveIncentivesController} from "src/aave-v2/interfaces/aave/IAaveIncentivesController.sol";
76
import {ILendingPoolAddressesProvider} from "src/aave-v2/interfaces/aave/ILendingPoolAddressesProvider.sol";
8-
import {IRewardsManager} from "src/aave-v2/interfaces/IRewardsManager.sol";
9-
import {IIncentivesVault} from "src/aave-v2/interfaces/IIncentivesVault.sol";
107
import {IEntryPositionsManager} from "src/aave-v2/interfaces/IEntryPositionsManager.sol";
118
import {IExitPositionsManager} from "src/aave-v2/interfaces/IExitPositionsManager.sol";
129
import {IInterestRatesManager} from "src/aave-v2/interfaces/IInterestRatesManager.sol";
13-
import {ILendingPoolConfigurator} from "../../../test/aave-v2/helpers/ILendingPoolConfigurator.sol";
10+
import {ILendingPoolConfigurator} from "test/aave-v2/helpers/ILendingPoolConfigurator.sol";
1411
import {IMorpho} from "src/aave-v2/interfaces/IMorpho.sol";
1512

1613
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
@@ -44,29 +41,21 @@ contract Config is BaseConfig {
4441
ILendingPoolAddressesProvider(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5);
4542
ILendingPoolConfigurator public lendingPoolConfigurator =
4643
ILendingPoolConfigurator(0x311Bb771e4F8952E6Da169b425E7e92d6Ac45756);
47-
IAaveIncentivesController public aaveIncentivesController =
48-
IAaveIncentivesController(0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5);
4944
IPriceOracleGetter public oracle = IPriceOracleGetter(poolAddressesProvider.getPriceOracle());
5045
ILendingPool public pool = ILendingPool(poolAddressesProvider.getLendingPool());
5146

52-
address public REWARD_TOKEN = aaveIncentivesController.REWARD_TOKEN();
53-
5447
ProxyAdmin public proxyAdmin = ProxyAdmin(0x99917ca0426fbC677e84f873Fb0b726Bb4799cD8);
5548

5649
TransparentUpgradeableProxy public lensProxy =
5750
TransparentUpgradeableProxy(payable(0x507fA343d0A90786d86C7cd885f5C49263A91FF4));
5851
TransparentUpgradeableProxy public morphoProxy =
5952
TransparentUpgradeableProxy(payable(0x777777c9898D384F785Ee44Acfe945efDFf5f3E0));
60-
TransparentUpgradeableProxy public rewardsManagerProxy;
6153

6254
Lens public lensImplV1;
6355
Morpho public morphoImplV1;
64-
IRewardsManager public rewardsManagerImplV1;
6556

6657
Lens public lens;
6758
Morpho public morpho;
68-
IRewardsManager public rewardsManager;
69-
IIncentivesVault public incentivesVault;
7059
IEntryPositionsManager public entryPositionsManager;
7160
IExitPositionsManager public exitPositionsManager;
7261
IInterestRatesManager public interestRatesManager;

config/compound/Config.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pragma solidity >=0.8.0;
33

44
import "src/compound/interfaces/compound/ICompound.sol";
5-
import {IIncentivesVault} from "src/compound/interfaces/IIncentivesVault.sol";
65
import {IPositionsManager} from "src/compound/interfaces/IPositionsManager.sol";
76
import {IInterestRatesManager} from "src/compound/interfaces/IInterestRatesManager.sol";
87
import {IMorpho} from "src/compound/interfaces/IMorpho.sol";
@@ -11,6 +10,7 @@ import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transpa
1110
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
1211

1312
import {RewardsManager} from "src/compound/RewardsManager.sol";
13+
import {LensExtension} from "src/compound/lens/LensExtension.sol";
1414
import {Lens} from "src/compound/lens/Lens.sol";
1515
import {Morpho} from "src/compound/Morpho.sol";
1616
import {BaseConfig} from "../BaseConfig.sol";
@@ -50,9 +50,10 @@ contract Config is BaseConfig {
5050
RewardsManager public rewardsManagerImplV1;
5151

5252
Lens public lens;
53+
LensExtension public lensExtension;
54+
5355
Morpho public morpho;
5456
RewardsManager public rewardsManager;
55-
IIncentivesVault public incentivesVault;
5657
IPositionsManager public positionsManager;
5758
IInterestRatesManager public interestRatesManager;
5859
}

lib/morpho-data-structures

scripts/aave-v2/Deploy.s.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: AGPL-3.0-only
22
pragma solidity 0.8.13;
33

4-
import "src/aave-v2/interfaces/IIncentivesVault.sol";
54
import "src/aave-v2/interfaces/IInterestRatesManager.sol";
65
import "src/aave-v2/interfaces/IExitPositionsManager.sol";
76
import "src/aave-v2/interfaces/IEntryPositionsManager.sol";
@@ -27,7 +26,6 @@ contract Deploy is Script, Config {
2726
IEntryPositionsManager public entryPositionsManager;
2827
IExitPositionsManager public exitPositionsManager;
2928
IInterestRatesManager public interestRatesManager;
30-
IIncentivesVault public incentivesVault;
3129

3230
function run() external {
3331
vm.startBroadcast();

scripts/compound/Deploy.s.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
pragma solidity 0.8.13;
33

44
import "src/compound/interfaces/IRewardsManager.sol";
5-
import "src/compound/interfaces/IIncentivesVault.sol";
65
import "src/compound/interfaces/IInterestRatesManager.sol";
76
import "src/compound/interfaces/IPositionsManager.sol";
87
import "src/compound/interfaces/compound/ICompound.sol";
98

109
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
1110
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
1211

13-
import {IncentivesVault} from "src/compound/IncentivesVault.sol";
1412
import {RewardsManager} from "src/compound/RewardsManager.sol";
1513
import {InterestRatesManager} from "src/compound/InterestRatesManager.sol";
1614
import {PositionsManager} from "src/compound/PositionsManager.sol";
@@ -27,7 +25,6 @@ contract Deploy is Script, Config {
2725
Morpho public morpho;
2826
IPositionsManager public positionsManager;
2927
IInterestRatesManager public interestRatesManager;
30-
IIncentivesVault public incentivesVault;
3128
RewardsManager public rewardsManager;
3229

3330
function run() external {

0 commit comments

Comments
 (0)