From ce38a0b8f01aed630c9d01e6e408fdea98c2d176 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 18:11:32 +0100 Subject: [PATCH 1/7] style: 1.1 naming --- README.md | 2 +- certora/applyMunging.patch | 18 ++-- package.json | 10 +-- src/{MetaMorpho.sol => MetaMorphoV1_1.sol} | 86 +++++++++---------- ...oFactory.sol => MetaMorphoV1_1Factory.sol} | 18 ++-- .../{IMetaMorpho.sol => IMetaMorphoV1_1.sol} | 12 +-- ...Factory.sol => IMetaMorphoV1_1Factory.sol} | 8 +- test/forge/DeploymentTest.sol | 2 +- test/forge/MetaMorphoFactoryTest.sol | 12 +-- test/forge/MulticallTest.sol | 6 +- test/forge/ReentrancyTest.sol | 10 +-- test/forge/helpers/BaseTest.sol | 2 +- test/forge/helpers/IntegrationTest.sol | 6 +- test/forge/helpers/InternalTest.sol | 6 +- 14 files changed, 99 insertions(+), 99 deletions(-) rename src/{MetaMorpho.sol => MetaMorphoV1_1.sol} (95%) rename src/{MetaMorphoFactory.sol => MetaMorphoV1_1Factory.sol} (67%) rename src/interfaces/{IMetaMorpho.sol => IMetaMorphoV1_1.sol} (96%) rename src/interfaces/{IMetaMorphoFactory.sol => IMetaMorphoV1_1Factory.sol} (85%) diff --git a/README.md b/README.md index 759d0bbc..6729c8a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MetaMorpho No Bad Debt Realization +# MetaMorpho v1.1 > [!NOTE] > This repo is a fork of [metamorpho](https://github.com/morpho-org/metamorpho), with 3 changes: diff --git a/certora/applyMunging.patch b/certora/applyMunging.patch index b2c79e3a..1f2155a3 100644 --- a/certora/applyMunging.patch +++ b/certora/applyMunging.patch @@ -1,6 +1,6 @@ -diff -ruN interfaces/IMetaMorpho.sol interfaces/IMetaMorpho.sol ---- interfaces/IMetaMorpho.sol 2024-08-19 12:35:33.153217935 +0200 -+++ interfaces/IMetaMorpho.sol 2024-09-04 10:44:42.493695519 +0200 +diff -ruN interfaces/IMetaMorphoV1_1.sol interfaces/IMetaMorphoV1_1.sol +--- interfaces/IMetaMorphoV1_1.sol 2024-08-19 12:35:33.153217935 +0200 ++++ interfaces/IMetaMorphoV1_1.sol 2024-09-04 10:44:42.493695519 +0200 @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; @@ -15,8 +15,8 @@ diff -ruN interfaces/IMetaMorpho.sol interfaces/IMetaMorpho.sol import {MarketConfig, PendingUint192, PendingAddress} from "../libraries/PendingLib.sol"; @@ -30,7 +30,7 @@ - /// @dev Consider using the IMetaMorpho interface instead of this one. - interface IMetaMorphoBase { + /// @dev Consider using the IMetaMorphoV1_1 interface instead of this one. + interface IMetaMorphoV1_1Base { /// @notice The address of the Morpho contract. - function MORPHO() external view returns (IMorpho); + function MORPHO() external view returns (IMorphoHarness); @@ -51,9 +51,9 @@ diff -ruN MetaMorpho.sol MetaMorpho.sol --- MetaMorpho.sol 2024-09-04 10:44:33.985829466 +0200 +++ MetaMorpho.sol 2024-09-04 10:44:42.497695457 +0200 @@ -9,24 +9,22 @@ - IMetaMorphoBase, - IMetaMorphoStaticTyping - } from "./interfaces/IMetaMorpho.sol"; + IMetaMorphoV1_1Base, + IMetaMorphoV1_1StaticTyping + } from "./interfaces/IMetaMorphoV1_1.sol"; -import {Id, MarketParams, Market, IMorpho} from "../lib/morpho-blue/src/interfaces/IMorpho.sol"; +import {Id, MarketParams, Market, IMorphoHarness} from "../helpers/IMorphoHarness.sol"; @@ -108,7 +108,7 @@ diff -ruN MetaMorpho.sol MetaMorpho.sol @@ -56,7 +52,7 @@ /* IMMUTABLES */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base - IMorpho public immutable MORPHO; + IMorphoHarness public immutable MORPHO; diff --git a/package.json b/package.json index b6448b1b..95526d18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@morpho-org/metamorpho", - "description": "MetaMorpho", + "name": "@morpho-org/metamorpho-v1.1", + "description": "MetaMorpho V1.1", "license": "GPL-2.0-or-later", "version": "1.1.0", "main": "lib/index.js", @@ -28,7 +28,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/morpho-org/metamorpho.git" + "url": "git+https://github.com/morpho-org/metamorpho-v1.1.git" }, "author": { "name": "Morpho Labs", @@ -36,9 +36,9 @@ "url": "https://github.com/morpho-labs" }, "bugs": { - "url": "https://github.com/morpho-org/metamorpho/issues" + "url": "https://github.com/morpho-org/metamorpho-v1.1/issues" }, - "homepage": "https://github.com/morpho-org/metamorpho#readme", + "homepage": "https://github.com/morpho-org/metamorpho-v1.1#readme", "dependencies": { "ethers": "^6.9.2", "evm-maths": "^6.0.0", diff --git a/src/MetaMorpho.sol b/src/MetaMorphoV1_1.sol similarity index 95% rename from src/MetaMorpho.sol rename to src/MetaMorphoV1_1.sol index 92a1dc62..260c7144 100644 --- a/src/MetaMorpho.sol +++ b/src/MetaMorphoV1_1.sol @@ -6,9 +6,9 @@ import { PendingUint192, PendingAddress, MarketAllocation, - IMetaMorphoBase, - IMetaMorphoStaticTyping -} from "./interfaces/IMetaMorpho.sol"; + IMetaMorphoV1_1Base, + IMetaMorphoV1_1StaticTyping +} from "./interfaces/IMetaMorphoV1_1.sol"; import {Id, MarketParams, Market, IMorpho} from "../lib/morpho-blue/src/interfaces/IMorpho.sol"; import {PendingUint192, PendingAddress, PendingLib} from "./libraries/PendingLib.sol"; @@ -40,7 +40,7 @@ import { /// @author Morpho Labs /// @custom:contact security@morpho.org /// @notice ERC4626 compliant vault allowing users to deposit assets to Morpho. -contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorphoStaticTyping { +contract MetaMorphoV1_1 is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorphoV1_1StaticTyping { using Math for uint256; using UtilsLib for uint256; using SafeCast for uint256; @@ -55,7 +55,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* IMMUTABLES */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base IMorpho public immutable MORPHO; /// @notice OpenZeppelin decimals offset used by the ERC4626 implementation. @@ -65,49 +65,49 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* STORAGE */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base address public curator; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base mapping(address => bool) public isAllocator; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base address public guardian; - /// @inheritdoc IMetaMorphoStaticTyping + /// @inheritdoc IMetaMorphoV1_1StaticTyping mapping(Id => MarketConfig) public config; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base uint256 public timelock; - /// @inheritdoc IMetaMorphoStaticTyping + /// @inheritdoc IMetaMorphoV1_1StaticTyping PendingAddress public pendingGuardian; - /// @inheritdoc IMetaMorphoStaticTyping + /// @inheritdoc IMetaMorphoV1_1StaticTyping mapping(Id => PendingUint192) public pendingCap; - /// @inheritdoc IMetaMorphoStaticTyping + /// @inheritdoc IMetaMorphoV1_1StaticTyping PendingUint192 public pendingTimelock; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base uint96 public fee; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base address public feeRecipient; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base address public skimRecipient; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base Id[] public supplyQueue; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base Id[] public withdrawQueue; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base uint256 public lastTotalAssets; - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base uint256 public lostAssets; /// @dev "Overrides" the ERC20's storage variable to be able to modify it. @@ -212,7 +212,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetSymbol(newSymbol); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setCurator(address newCurator) external onlyOwner { if (newCurator == curator) revert ErrorsLib.AlreadySet(); @@ -221,7 +221,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetCurator(newCurator); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setIsAllocator(address newAllocator, bool newIsAllocator) external onlyOwner { if (isAllocator[newAllocator] == newIsAllocator) revert ErrorsLib.AlreadySet(); @@ -230,7 +230,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetIsAllocator(newAllocator, newIsAllocator); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setSkimRecipient(address newSkimRecipient) external onlyOwner { if (newSkimRecipient == skimRecipient) revert ErrorsLib.AlreadySet(); @@ -239,7 +239,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetSkimRecipient(newSkimRecipient); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function submitTimelock(uint256 newTimelock) external onlyOwner { if (newTimelock == timelock) revert ErrorsLib.AlreadySet(); if (pendingTimelock.validAt != 0) revert ErrorsLib.AlreadyPending(); @@ -255,7 +255,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph } } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setFee(uint256 newFee) external onlyOwner { if (newFee == fee) revert ErrorsLib.AlreadySet(); if (newFee > ConstantsLib.MAX_FEE) revert ErrorsLib.MaxFeeExceeded(); @@ -270,7 +270,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetFee(_msgSender(), fee); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setFeeRecipient(address newFeeRecipient) external onlyOwner { if (newFeeRecipient == feeRecipient) revert ErrorsLib.AlreadySet(); if (newFeeRecipient == address(0) && fee != 0) revert ErrorsLib.ZeroFeeRecipient(); @@ -283,7 +283,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetFeeRecipient(newFeeRecipient); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function submitGuardian(address newGuardian) external onlyOwner { if (newGuardian == guardian) revert ErrorsLib.AlreadySet(); if (pendingGuardian.validAt != 0) revert ErrorsLib.AlreadyPending(); @@ -299,7 +299,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* ONLY CURATOR FUNCTIONS */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function submitCap(MarketParams memory marketParams, uint256 newSupplyCap) external onlyCuratorRole { Id id = marketParams.id(); if (marketParams.loanToken != asset()) revert ErrorsLib.InconsistentAsset(id); @@ -318,7 +318,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph } } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function submitMarketRemoval(MarketParams memory marketParams) external onlyCuratorRole { Id id = marketParams.id(); if (config[id].removableAt != 0) revert ErrorsLib.AlreadyPending(); @@ -334,7 +334,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* ONLY ALLOCATOR FUNCTIONS */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function setSupplyQueue(Id[] calldata newSupplyQueue) external onlyAllocatorRole { uint256 length = newSupplyQueue.length; @@ -349,7 +349,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetSupplyQueue(_msgSender(), newSupplyQueue); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function updateWithdrawQueue(uint256[] calldata indexes) external onlyAllocatorRole { uint256 newLength = indexes.length; uint256 currLength = withdrawQueue.length; @@ -392,7 +392,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph emit EventsLib.SetWithdrawQueue(_msgSender(), newWithdrawQueue); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function reallocate(MarketAllocation[] calldata allocations) external onlyAllocatorRole { uint256 totalSupplied; uint256 totalWithdrawn; @@ -446,28 +446,28 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* REVOKE FUNCTIONS */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function revokePendingTimelock() external onlyGuardianRole { delete pendingTimelock; emit EventsLib.RevokePendingTimelock(_msgSender()); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function revokePendingGuardian() external onlyGuardianRole { delete pendingGuardian; emit EventsLib.RevokePendingGuardian(_msgSender()); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function revokePendingCap(Id id) external onlyCuratorOrGuardianRole { delete pendingCap[id]; emit EventsLib.RevokePendingCap(_msgSender(), id); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function revokePendingMarketRemoval(Id id) external onlyCuratorOrGuardianRole { delete config[id].removableAt; @@ -476,27 +476,27 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* EXTERNAL */ - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function supplyQueueLength() external view returns (uint256) { return supplyQueue.length; } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function withdrawQueueLength() external view returns (uint256) { return withdrawQueue.length; } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function acceptTimelock() external afterTimelock(pendingTimelock.validAt) { _setTimelock(pendingTimelock.value); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function acceptGuardian() external afterTimelock(pendingGuardian.validAt) { _setGuardian(pendingGuardian.value); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function acceptCap(MarketParams memory marketParams) external afterTimelock(pendingCap[marketParams.id()].validAt) @@ -507,7 +507,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph _setCap(marketParams, id, uint184(pendingCap[id].value)); } - /// @inheritdoc IMetaMorphoBase + /// @inheritdoc IMetaMorphoV1_1Base function skim(address token) external { if (skimRecipient == address(0)) revert ErrorsLib.ZeroAddress(); @@ -605,7 +605,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /// @inheritdoc IERC4626 /// @dev totalAssets is the sum of the vault's assets on the Morpho markets plus the lost assets (see corresponding - /// docs in IMetaMorpho.sol). + /// docs in IMetaMorphoV1_1.sol). function totalAssets() public view override returns (uint256) { (, uint256 newTotalAssets,) = _accruedFeeAndAssets(); diff --git a/src/MetaMorphoFactory.sol b/src/MetaMorphoV1_1Factory.sol similarity index 67% rename from src/MetaMorphoFactory.sol rename to src/MetaMorphoV1_1Factory.sol index 7f13e1b5..36cd17d1 100644 --- a/src/MetaMorphoFactory.sol +++ b/src/MetaMorphoV1_1Factory.sol @@ -1,27 +1,27 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.26; -import {IMetaMorpho} from "./interfaces/IMetaMorpho.sol"; -import {IMetaMorphoFactory} from "./interfaces/IMetaMorphoFactory.sol"; +import {IMetaMorphoV1_1} from "./interfaces/IMetaMorphoV1_1.sol"; +import {IMetaMorphoV1_1Factory} from "./interfaces/IMetaMorphoV1_1Factory.sol"; import {EventsLib} from "./libraries/EventsLib.sol"; import {ErrorsLib} from "./libraries/ErrorsLib.sol"; -import {MetaMorpho} from "./MetaMorpho.sol"; +import {MetaMorphoV1_1} from "./MetaMorphoV1_1.sol"; /// @title MetaMorphoFactory /// @author Morpho Labs /// @custom:contact security@morpho.org /// @notice This contract allows to create MetaMorpho vaults, and to index them easily. -contract MetaMorphoFactory is IMetaMorphoFactory { +contract MetaMorphoV1_1Factory is IMetaMorphoV1_1Factory { /* IMMUTABLES */ - /// @inheritdoc IMetaMorphoFactory + /// @inheritdoc IMetaMorphoV1_1Factory address public immutable MORPHO; /* STORAGE */ - /// @inheritdoc IMetaMorphoFactory + /// @inheritdoc IMetaMorphoV1_1Factory mapping(address => bool) public isMetaMorpho; /* CONSTRUCTOR */ @@ -36,7 +36,7 @@ contract MetaMorphoFactory is IMetaMorphoFactory { /* EXTERNAL */ - /// @inheritdoc IMetaMorphoFactory + /// @inheritdoc IMetaMorphoV1_1Factory function createMetaMorpho( address initialOwner, uint256 initialTimelock, @@ -44,9 +44,9 @@ contract MetaMorphoFactory is IMetaMorphoFactory { string memory name, string memory symbol, bytes32 salt - ) external returns (IMetaMorpho metaMorpho) { + ) external returns (IMetaMorphoV1_1 metaMorpho) { metaMorpho = - IMetaMorpho(address(new MetaMorpho{salt: salt}(initialOwner, MORPHO, initialTimelock, asset, name, symbol))); + IMetaMorphoV1_1(address(new MetaMorphoV1_1{salt: salt}(initialOwner, MORPHO, initialTimelock, asset, name, symbol))); isMetaMorpho[address(metaMorpho)] = true; diff --git a/src/interfaces/IMetaMorpho.sol b/src/interfaces/IMetaMorphoV1_1.sol similarity index 96% rename from src/interfaces/IMetaMorpho.sol rename to src/interfaces/IMetaMorphoV1_1.sol index 53452d38..ba032a0f 100644 --- a/src/interfaces/IMetaMorpho.sol +++ b/src/interfaces/IMetaMorphoV1_1.sol @@ -26,9 +26,9 @@ interface IOwnable { function pendingOwner() external view returns (address); } -/// @dev This interface is used for factorizing IMetaMorphoStaticTyping and IMetaMorpho. -/// @dev Consider using the IMetaMorpho interface instead of this one. -interface IMetaMorphoBase { +/// @dev This interface is used for factorizing IMetaMorphoV1_1StaticTyping and IMetaMorpho. +/// @dev Consider using the IMetaMorphoV1_1 interface instead of this one. +interface IMetaMorphoV1_1Base { /// @notice The address of the Morpho contract. function MORPHO() external view returns (IMorpho); function DECIMALS_OFFSET() external view returns (uint8); @@ -189,8 +189,8 @@ interface IMetaMorphoBase { } /// @dev This interface is inherited by MetaMorpho so that function signatures are checked by the compiler. -/// @dev Consider using the IMetaMorpho interface instead of this one. -interface IMetaMorphoStaticTyping is IMetaMorphoBase { +/// @dev Consider using the IMetaMorphoV1_1 interface instead of this one. +interface IMetaMorphoV1_1StaticTyping is IMetaMorphoV1_1Base { /// @notice Returns the current configuration of each market. function config(Id) external view returns (uint184 cap, bool enabled, uint64 removableAt); @@ -208,7 +208,7 @@ interface IMetaMorphoStaticTyping is IMetaMorphoBase { /// @author Morpho Labs /// @custom:contact security@morpho.org /// @dev Use this interface for MetaMorpho to have access to all the functions with the appropriate function signatures. -interface IMetaMorpho is IMetaMorphoBase, IERC4626, IERC20Permit, IOwnable, IMulticall { +interface IMetaMorphoV1_1 is IMetaMorphoV1_1Base, IERC4626, IERC20Permit, IOwnable, IMulticall { /// @notice Returns the current configuration of each market. function config(Id) external view returns (MarketConfig memory); diff --git a/src/interfaces/IMetaMorphoFactory.sol b/src/interfaces/IMetaMorphoV1_1Factory.sol similarity index 85% rename from src/interfaces/IMetaMorphoFactory.sol rename to src/interfaces/IMetaMorphoV1_1Factory.sol index 1fc10bb8..168b0295 100644 --- a/src/interfaces/IMetaMorphoFactory.sol +++ b/src/interfaces/IMetaMorphoV1_1Factory.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; -import {IMetaMorpho} from "./IMetaMorpho.sol"; +import {IMetaMorphoV1_1} from "./IMetaMorphoV1_1.sol"; -/// @title IMetaMorphoFactory +/// @title IMetaMorphoV1_1Factory /// @author Morpho Labs /// @custom:contact security@morpho.org /// @notice Interface of MetaMorpho's factory. -interface IMetaMorphoFactory { +interface IMetaMorphoV1_1Factory { /// @notice The address of the Morpho contract. function MORPHO() external view returns (address); @@ -28,5 +28,5 @@ interface IMetaMorphoFactory { string memory name, string memory symbol, bytes32 salt - ) external returns (IMetaMorpho metaMorpho); + ) external returns (IMetaMorphoV1_1 metaMorpho); } diff --git a/test/forge/DeploymentTest.sol b/test/forge/DeploymentTest.sol index f8c9175d..eca3e9ee 100644 --- a/test/forge/DeploymentTest.sol +++ b/test/forge/DeploymentTest.sol @@ -67,7 +67,7 @@ contract DeploymentTest is IntegrationTest { assumeNotZeroAddress(morpho); initialTimelock = _boundInitialTimelock(initialTimelock); - IMetaMorpho newVault = createMetaMorpho(owner, morpho, initialTimelock, address(loanToken), name, symbol); + IMetaMorphoV1_1 newVault = createMetaMorpho(owner, morpho, initialTimelock, address(loanToken), name, symbol); assertEq(newVault.owner(), owner, "owner"); assertEq(address(newVault.MORPHO()), morpho, "morpho"); diff --git a/test/forge/MetaMorphoFactoryTest.sol b/test/forge/MetaMorphoFactoryTest.sol index fb838ff4..38d4f253 100644 --- a/test/forge/MetaMorphoFactoryTest.sol +++ b/test/forge/MetaMorphoFactoryTest.sol @@ -3,20 +3,20 @@ pragma solidity ^0.8.0; import "./helpers/IntegrationTest.sol"; -import "../../src/MetaMorphoFactory.sol"; +import "../../src/MetaMorphoV1_1Factory.sol"; contract MetaMorphoFactoryTest is IntegrationTest { - MetaMorphoFactory factory; + MetaMorphoV1_1Factory factory; function setUp() public override { super.setUp(); - factory = new MetaMorphoFactory(address(morpho)); + factory = new MetaMorphoV1_1Factory(address(morpho)); } function testFactoryAddressZero() public { vm.expectRevert(ErrorsLib.ZeroAddress.selector); - new MetaMorphoFactory(address(0)); + new MetaMorphoV1_1Factory(address(0)); } function testCreateMetaMorpho( @@ -30,7 +30,7 @@ contract MetaMorphoFactoryTest is IntegrationTest { initialTimelock = _boundInitialTimelock(initialTimelock); bytes32 initCodeHash = hashInitCode( - type(MetaMorpho).creationCode, + type(MetaMorphoV1_1).creationCode, abi.encode(initialOwner, address(morpho), initialTimelock, address(loanToken), name, symbol) ); address expectedAddress = computeCreate2Address(salt, initCodeHash, address(factory)); @@ -40,7 +40,7 @@ contract MetaMorphoFactoryTest is IntegrationTest { expectedAddress, address(this), initialOwner, initialTimelock, address(loanToken), name, symbol, salt ); - IMetaMorpho metaMorpho = + IMetaMorphoV1_1 metaMorpho = factory.createMetaMorpho(initialOwner, initialTimelock, address(loanToken), name, symbol, salt); assertEq(expectedAddress, address(metaMorpho), "computeCreate2Address"); diff --git a/test/forge/MulticallTest.sol b/test/forge/MulticallTest.sol index b198582a..92d3f427 100644 --- a/test/forge/MulticallTest.sol +++ b/test/forge/MulticallTest.sol @@ -7,9 +7,9 @@ contract MulticallTest is IntegrationTest { bytes[] internal data; function testMulticall() public { - data.push(abi.encodeCall(IMetaMorphoBase.setCurator, (address(1)))); - data.push(abi.encodeCall(IMetaMorphoBase.setIsAllocator, (address(1), true))); - data.push(abi.encodeCall(IMetaMorphoBase.submitTimelock, (ConstantsLib.MAX_TIMELOCK))); + data.push(abi.encodeCall(IMetaMorphoV1_1Base.setCurator, (address(1)))); + data.push(abi.encodeCall(IMetaMorphoV1_1Base.setIsAllocator, (address(1), true))); + data.push(abi.encodeCall(IMetaMorphoV1_1Base.submitTimelock, (ConstantsLib.MAX_TIMELOCK))); vm.prank(OWNER); vault.multicall(data); diff --git a/test/forge/ReentrancyTest.sol b/test/forge/ReentrancyTest.sol index 163278d5..77636826 100644 --- a/test/forge/ReentrancyTest.sol +++ b/test/forge/ReentrancyTest.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; -import {IMetaMorpho} from "../../src/interfaces/IMetaMorpho.sol"; +import {IMetaMorphoV1_1} from "../../src/interfaces/IMetaMorphoV1_1.sol"; import {ERC1820Registry} from "../../src/mocks/ERC1820Registry.sol"; import {ERC777Mock, IERC1820Registry} from "../../src/mocks/ERC777Mock.sol"; import {IERC1820Implementer} from "../../lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol"; -import "../../src/MetaMorphoFactory.sol"; +import "../../src/MetaMorphoV1_1Factory.sol"; import "./helpers/IntegrationTest.sol"; uint256 constant FEE = 0.1 ether; // 50% @@ -40,9 +40,9 @@ contract ReentrancyTest is IntegrationTest, IERC1820Implementer { morpho.createMarket(idleParams); - vault = IMetaMorpho( + vault = IMetaMorphoV1_1( address( - new MetaMorpho(OWNER, address(morpho), TIMELOCK, address(reentrantToken), "MetaMorpho Vault", "MMV") + new MetaMorphoV1_1(OWNER, address(morpho), TIMELOCK, address(reentrantToken), "MetaMorpho Vault", "MMV") ) ); @@ -126,7 +126,7 @@ contract ReentrancyTest is IntegrationTest, IERC1820Implementer { if ((from == attacker) && (amount == 5000)) { // Don't call back on first deposit(1) vm.startPrank(attacker); - IMetaMorpho(to).withdraw(1, attacker, attacker); + IMetaMorphoV1_1(to).withdraw(1, attacker, attacker); vm.stopPrank(); } } diff --git a/test/forge/helpers/BaseTest.sol b/test/forge/helpers/BaseTest.sol index 84f8b472..cb048c50 100644 --- a/test/forge/helpers/BaseTest.sol +++ b/test/forge/helpers/BaseTest.sol @@ -9,7 +9,7 @@ import {MarketParamsLib} from "../../../lib/morpho-blue/src/libraries/MarketPara import {MorphoLib} from "../../../lib/morpho-blue/src/libraries/periphery/MorphoLib.sol"; import {MorphoBalancesLib} from "../../../lib/morpho-blue/src/libraries/periphery/MorphoBalancesLib.sol"; -import "../../../src/interfaces/IMetaMorpho.sol"; +import "../../../src/interfaces/IMetaMorphoV1_1.sol"; import "../../../src/libraries/ConstantsLib.sol"; import {ErrorsLib} from "../../../src/libraries/ErrorsLib.sol"; diff --git a/test/forge/helpers/IntegrationTest.sol b/test/forge/helpers/IntegrationTest.sol index 55728a54..35270e99 100644 --- a/test/forge/helpers/IntegrationTest.sol +++ b/test/forge/helpers/IntegrationTest.sol @@ -10,7 +10,7 @@ contract IntegrationTest is BaseTest { using MorphoBalancesLib for IMorpho; using MarketParamsLib for MarketParams; - IMetaMorpho internal vault; + IMetaMorphoV1_1 internal vault; function setUp() public virtual override { super.setUp(); @@ -50,9 +50,9 @@ contract IntegrationTest is BaseTest { address asset, string memory name, string memory symbol - ) public returns (IMetaMorpho) { + ) public returns (IMetaMorphoV1_1) { return - IMetaMorpho(deployCode("MetaMorpho.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol))); + IMetaMorphoV1_1(deployCode("MetaMorpho.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol))); } function _idle() internal view returns (uint256) { diff --git a/test/forge/helpers/InternalTest.sol b/test/forge/helpers/InternalTest.sol index 725ff830..42cbb88f 100644 --- a/test/forge/helpers/InternalTest.sol +++ b/test/forge/helpers/InternalTest.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.0; import "./BaseTest.sol"; -import {MetaMorpho} from "../../../src/MetaMorpho.sol"; +import {MetaMorphoV1_1} from "../../../src/MetaMorphoV1_1.sol"; -contract InternalTest is BaseTest, MetaMorpho { - constructor() MetaMorpho(OWNER, address(morpho), 1 days, address(loanToken), "MetaMorpho Vault", "MM") {} +contract InternalTest is BaseTest, MetaMorphoV1_1 { + constructor() MetaMorphoV1_1(OWNER, address(morpho), 1 days, address(loanToken), "MetaMorpho Vault", "MM") {} function setUp() public virtual override { super.setUp(); From e3f18cec548d6afe6e3beabd8703195705e089ea Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 18:37:06 +0100 Subject: [PATCH 2/7] chore: fmt --- src/MetaMorphoV1_1Factory.sol | 5 +++-- test/forge/helpers/IntegrationTest.sol | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MetaMorphoV1_1Factory.sol b/src/MetaMorphoV1_1Factory.sol index 36cd17d1..26e8a491 100644 --- a/src/MetaMorphoV1_1Factory.sol +++ b/src/MetaMorphoV1_1Factory.sol @@ -45,8 +45,9 @@ contract MetaMorphoV1_1Factory is IMetaMorphoV1_1Factory { string memory symbol, bytes32 salt ) external returns (IMetaMorphoV1_1 metaMorpho) { - metaMorpho = - IMetaMorphoV1_1(address(new MetaMorphoV1_1{salt: salt}(initialOwner, MORPHO, initialTimelock, asset, name, symbol))); + metaMorpho = IMetaMorphoV1_1( + address(new MetaMorphoV1_1{salt: salt}(initialOwner, MORPHO, initialTimelock, asset, name, symbol)) + ); isMetaMorpho[address(metaMorpho)] = true; diff --git a/test/forge/helpers/IntegrationTest.sol b/test/forge/helpers/IntegrationTest.sol index 35270e99..1b3bc25e 100644 --- a/test/forge/helpers/IntegrationTest.sol +++ b/test/forge/helpers/IntegrationTest.sol @@ -51,8 +51,9 @@ contract IntegrationTest is BaseTest { string memory name, string memory symbol ) public returns (IMetaMorphoV1_1) { - return - IMetaMorphoV1_1(deployCode("MetaMorpho.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol))); + return IMetaMorphoV1_1( + deployCode("MetaMorpho.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol)) + ); } function _idle() internal view returns (uint256) { From bd8a3b5837aec3a8e912832034bce52ab527ac02 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 18:46:50 +0100 Subject: [PATCH 3/7] test: fix certora --- README.md | 6 +++--- certora/applyMunging.patch | 6 +++--- certora/gambit.conf | 2 +- certora/helpers/ERC20Helper.sol | 2 +- certora/helpers/MetaMorphoHarness.sol | 2 +- test/forge/helpers/IntegrationTest.sol | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6729c8a0..a1f8ae37 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This repo is a fork of [metamorpho](https://github.com/morpho-org/metamorpho), with 3 changes: -> - this MetaMorpho vault does not realize the bad debt (more on this [here](https://github.com/morpho-org/metamorpho-no-bad-debt-realization/blob/d16ecfed0da4b4c51ed65c2eba865f5623c2242b/src/interfaces/IMetaMorpho.sol#L81)); +> - this MetaMorpho vault does not realize the bad debt (more on this [here](https://github.com/morpho-org/metamorpho-no-bad-debt-realization/blob/d16ecfed0da4b4c51ed65c2eba865f5623c2242b/src/interfaces/IMetaMorphoV1_1.sol#L81)); > - the timelock can be set to zero at deployment; > - the name and symbol are mutable. @@ -16,9 +16,9 @@ Users of MetaMorpho are liquidity providers who want to earn from borrowing inte The active management of the deposited assets is the responsibility of a set of different roles (owner, curator and allocators). These roles are primarily responsible for enabling and disabling markets on Morpho Blue and managing the allocation of users’ funds. -[`MetaMorpho`](./src/MetaMorpho.sol) vaults are [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vaults, with ([ERC-2612](https://eips.ethereum.org/EIPS/eip-2612)) permit. +[`MetaMorphoV1_1`](./src/MetaMorphoV1_1.sol) vaults are [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vaults, with ([ERC-2612](https://eips.ethereum.org/EIPS/eip-2612)) permit. One MetaMorpho vault is related to one loan asset on Morpho Blue. -The [`MetaMorphoFactory`](./src/MetaMorphoFactory.sol) is deploying immutable onchain instances of MetaMorpho vaults. +The [`MetaMorphoV1_1Factory`](./src/MetaMorphoV1_1Factory.sol) is deploying immutable onchain instances of MetaMorpho vaults. Users can supply or withdraw assets at any time, depending on the available liquidity on Morpho Blue. A maximum of 30 markets can be enabled on a given MetaMorpho vault. diff --git a/certora/applyMunging.patch b/certora/applyMunging.patch index 1f2155a3..80cfaa62 100644 --- a/certora/applyMunging.patch +++ b/certora/applyMunging.patch @@ -47,9 +47,9 @@ diff -ruN libraries/EventsLib.sol libraries/EventsLib.sol import {PendingAddress} from "./PendingLib.sol"; -diff -ruN MetaMorpho.sol MetaMorpho.sol ---- MetaMorpho.sol 2024-09-04 10:44:33.985829466 +0200 -+++ MetaMorpho.sol 2024-09-04 10:44:42.497695457 +0200 +diff -ruN MetaMorphoV1_1.sol MetaMorphoV1_1.sol +--- MetaMorphoV1_1.sol 2024-09-04 10:44:33.985829466 +0200 ++++ MetaMorphoV1_1.sol 2024-09-04 10:44:42.497695457 +0200 @@ -9,24 +9,22 @@ IMetaMorphoV1_1Base, IMetaMorphoV1_1StaticTyping diff --git a/certora/gambit.conf b/certora/gambit.conf index 703c51d5..b11026aa 100644 --- a/certora/gambit.conf +++ b/certora/gambit.conf @@ -1,5 +1,5 @@ { - "filename" : "../src/MetaMorpho.sol", + "filename" : "../src/MetaMorphoV1_1.sol", "sourceroot": "..", "num_mutants": 15, "solc_remappings": [] diff --git a/certora/helpers/ERC20Helper.sol b/certora/helpers/ERC20Helper.sol index 8b686cee..cfff89b5 100644 --- a/certora/helpers/ERC20Helper.sol +++ b/certora/helpers/ERC20Helper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.26; -import {IERC20, SafeERC20} from "../munged/MetaMorpho.sol"; +import {IERC20, SafeERC20} from "../munged/MetaMorphoV1_1.sol"; contract ERC20Helper { using SafeERC20 for IERC20; diff --git a/certora/helpers/MetaMorphoHarness.sol b/certora/helpers/MetaMorphoHarness.sol index 5378a2ee..e9095bde 100644 --- a/certora/helpers/MetaMorphoHarness.sol +++ b/certora/helpers/MetaMorphoHarness.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.26; import { Math, MetaMorpho, Id, ConstantsLib, PendingUint192, PendingAddress, MarketConfig -} from "../munged/MetaMorpho.sol"; +} from "../munged/MetaMorphoV1_1.sol"; contract MetaMorphoHarness is MetaMorpho { constructor( diff --git a/test/forge/helpers/IntegrationTest.sol b/test/forge/helpers/IntegrationTest.sol index 1b3bc25e..f4be978c 100644 --- a/test/forge/helpers/IntegrationTest.sol +++ b/test/forge/helpers/IntegrationTest.sol @@ -52,7 +52,7 @@ contract IntegrationTest is BaseTest { string memory symbol ) public returns (IMetaMorphoV1_1) { return IMetaMorphoV1_1( - deployCode("MetaMorpho.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol)) + deployCode("MetaMorphoV1_1.sol", abi.encode(owner, morpho, initialTimelock, asset, name, symbol)) ); } From a7c5031a5416491364b54e1dc96222bbbcc5f70e Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 18:51:12 +0100 Subject: [PATCH 4/7] test: fix certora --- certora/helpers/MetaMorphoHarness.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/certora/helpers/MetaMorphoHarness.sol b/certora/helpers/MetaMorphoHarness.sol index e9095bde..6f137328 100644 --- a/certora/helpers/MetaMorphoHarness.sol +++ b/certora/helpers/MetaMorphoHarness.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.26; import { - Math, MetaMorpho, Id, ConstantsLib, PendingUint192, PendingAddress, MarketConfig + Math, MetaMorphoV1_1, Id, ConstantsLib, PendingUint192, PendingAddress, MarketConfig } from "../munged/MetaMorphoV1_1.sol"; -contract MetaMorphoHarness is MetaMorpho { +contract MetaMorphoHarness is MetaMorphoV1_1 { constructor( address owner, address morpho, @@ -13,7 +13,7 @@ contract MetaMorphoHarness is MetaMorpho { address _asset, string memory _name, string memory _symbol - ) MetaMorpho(owner, morpho, initialTimelock, _asset, _name, _symbol) {} + ) MetaMorphoV1_1(owner, morpho, initialTimelock, _asset, _name, _symbol) {} function pendingTimelock_() external view returns (PendingUint192 memory) { return pendingTimelock; From 2d03412cab5ade9a556a589baae501efab4984f4 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 19:12:27 +0100 Subject: [PATCH 5/7] test: fix hardhat --- pkg/MetaMorphoAction.ts | 6 +++--- test/hardhat/MetaMorpho.spec.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/MetaMorphoAction.ts b/pkg/MetaMorphoAction.ts index 92f1d798..58cce01c 100644 --- a/pkg/MetaMorphoAction.ts +++ b/pkg/MetaMorphoAction.ts @@ -1,8 +1,8 @@ import { BigNumberish } from "ethers"; -import { MetaMorpho__factory } from "types"; -import { MarketAllocationStruct, MarketParamsStruct } from "types/src/MetaMorpho"; +import { MetaMorphoV1_1__factory } from "types"; +import { MarketAllocationStruct, MarketParamsStruct } from "types/src/MetaMorphoV1_1"; -const METAMORPHO_IFC = MetaMorpho__factory.createInterface(); +const METAMORPHO_IFC = MetaMorphoV1_1__factory.createInterface(); export type MetaMorphoCall = string; diff --git a/test/hardhat/MetaMorpho.spec.ts b/test/hardhat/MetaMorpho.spec.ts index 70826e8b..110302be 100644 --- a/test/hardhat/MetaMorpho.spec.ts +++ b/test/hardhat/MetaMorpho.spec.ts @@ -2,8 +2,8 @@ import { AbiCoder, MaxUint256, ZeroAddress, ZeroHash, keccak256, toBigInt } from import hre from "hardhat"; import _range from "lodash/range"; import { MetaMorphoAction } from "pkg"; -import { ERC20Mock, OracleMock, MetaMorpho, IMorpho, MetaMorphoFactory, MetaMorpho__factory, IIrm } from "types"; -import { MarketParamsStruct } from "types/src/MetaMorpho"; +import { ERC20Mock, OracleMock, MetaMorphoV1_1, IMorpho, MetaMorphoV1_1Factory, MetaMorphoV1_1__factory, IIrm } from "types"; +import { MarketParamsStruct } from "types/src/MetaMorphoV1_1"; import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { mine } from "@nomicfoundation/hardhat-network-helpers"; @@ -70,8 +70,8 @@ describe("MetaMorpho", () => { let oracle: OracleMock; let irm: IIrm; - let factory: MetaMorphoFactory; - let metaMorpho: MetaMorpho; + let factory: MetaMorphoV1_1Factory; + let metaMorpho: MetaMorphoV1_1; let metaMorphoAddress: string; let supplyCap: bigint; @@ -184,9 +184,9 @@ describe("MetaMorpho", () => { await morpho.enableLltv(idleParams.lltv); await morpho.createMarket(idleParams); - const MetaMorphoFactoryFactory = await hre.ethers.getContractFactory("MetaMorphoFactory", admin); + const MetaMorphoV1_1FactoryFactory = await hre.ethers.getContractFactory("MetaMorphoV1_1Factory", admin); - factory = await MetaMorphoFactoryFactory.deploy(morphoAddress); + factory = await MetaMorphoV1_1FactoryFactory.deploy(morphoAddress); metaMorphoAddress = await factory.createMetaMorpho.staticCall( admin.address, @@ -197,7 +197,7 @@ describe("MetaMorpho", () => { ZeroHash, ); - metaMorpho = MetaMorpho__factory.connect(metaMorphoAddress, admin); + metaMorpho = MetaMorphoV1_1__factory.connect(metaMorphoAddress, admin); await factory.createMetaMorpho(admin.address, timelock, loanAddress, "MetaMorpho", "mB", ZeroHash); From 2363cd79e14ce590c568392bca8532925646c251 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 17 Dec 2024 19:14:59 +0100 Subject: [PATCH 6/7] chore: fmt --- test/hardhat/MetaMorpho.spec.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/hardhat/MetaMorpho.spec.ts b/test/hardhat/MetaMorpho.spec.ts index 110302be..a384d2bc 100644 --- a/test/hardhat/MetaMorpho.spec.ts +++ b/test/hardhat/MetaMorpho.spec.ts @@ -2,7 +2,15 @@ import { AbiCoder, MaxUint256, ZeroAddress, ZeroHash, keccak256, toBigInt } from import hre from "hardhat"; import _range from "lodash/range"; import { MetaMorphoAction } from "pkg"; -import { ERC20Mock, OracleMock, MetaMorphoV1_1, IMorpho, MetaMorphoV1_1Factory, MetaMorphoV1_1__factory, IIrm } from "types"; +import { + ERC20Mock, + OracleMock, + MetaMorphoV1_1, + IMorpho, + MetaMorphoV1_1Factory, + MetaMorphoV1_1__factory, + IIrm, +} from "types"; import { MarketParamsStruct } from "types/src/MetaMorphoV1_1"; import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; From 831e3005afbdfb557adc17b67ceaf6bf3ce28026 Mon Sep 17 00:00:00 2001 From: Quentin Garchery Date: Tue, 17 Dec 2024 20:16:48 +0100 Subject: [PATCH 7/7] fix: more naming occurrences --- src/MetaMorphoV1_1Factory.sol | 4 ++-- src/interfaces/IMetaMorphoV1_1.sol | 9 +++++---- src/interfaces/IMetaMorphoV1_1Factory.sol | 8 ++++---- src/libraries/EventsLib.sol | 14 +++++++------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/MetaMorphoV1_1Factory.sol b/src/MetaMorphoV1_1Factory.sol index 26e8a491..fea5cd40 100644 --- a/src/MetaMorphoV1_1Factory.sol +++ b/src/MetaMorphoV1_1Factory.sol @@ -9,10 +9,10 @@ import {ErrorsLib} from "./libraries/ErrorsLib.sol"; import {MetaMorphoV1_1} from "./MetaMorphoV1_1.sol"; -/// @title MetaMorphoFactory +/// @title MetaMorphoV1_1Factory /// @author Morpho Labs /// @custom:contact security@morpho.org -/// @notice This contract allows to create MetaMorpho vaults, and to index them easily. +/// @notice This contract allows to create MetaMorphoV1_1 vaults, and to index them easily. contract MetaMorphoV1_1Factory is IMetaMorphoV1_1Factory { /* IMMUTABLES */ diff --git a/src/interfaces/IMetaMorphoV1_1.sol b/src/interfaces/IMetaMorphoV1_1.sol index ba032a0f..b7e97254 100644 --- a/src/interfaces/IMetaMorphoV1_1.sol +++ b/src/interfaces/IMetaMorphoV1_1.sol @@ -26,7 +26,7 @@ interface IOwnable { function pendingOwner() external view returns (address); } -/// @dev This interface is used for factorizing IMetaMorphoV1_1StaticTyping and IMetaMorpho. +/// @dev This interface is used for factorizing IMetaMorphoV1_1StaticTyping and IMetaMorphoV1_1. /// @dev Consider using the IMetaMorphoV1_1 interface instead of this one. interface IMetaMorphoV1_1Base { /// @notice The address of the Morpho contract. @@ -188,7 +188,7 @@ interface IMetaMorphoV1_1Base { function reallocate(MarketAllocation[] calldata allocations) external; } -/// @dev This interface is inherited by MetaMorpho so that function signatures are checked by the compiler. +/// @dev This interface is inherited by MetaMorphoV1_1 so that function signatures are checked by the compiler. /// @dev Consider using the IMetaMorphoV1_1 interface instead of this one. interface IMetaMorphoV1_1StaticTyping is IMetaMorphoV1_1Base { /// @notice Returns the current configuration of each market. @@ -204,10 +204,11 @@ interface IMetaMorphoV1_1StaticTyping is IMetaMorphoV1_1Base { function pendingTimelock() external view returns (uint192 value, uint64 validAt); } -/// @title IMetaMorpho +/// @title IMetaMorphoV1_1 /// @author Morpho Labs /// @custom:contact security@morpho.org -/// @dev Use this interface for MetaMorpho to have access to all the functions with the appropriate function signatures. +/// @dev Use this interface for MetaMorphoV1_1 to have access to all the functions with the appropriate function +/// signatures. interface IMetaMorphoV1_1 is IMetaMorphoV1_1Base, IERC4626, IERC20Permit, IOwnable, IMulticall { /// @notice Returns the current configuration of each market. function config(Id) external view returns (MarketConfig memory); diff --git a/src/interfaces/IMetaMorphoV1_1Factory.sol b/src/interfaces/IMetaMorphoV1_1Factory.sol index 168b0295..97b5910d 100644 --- a/src/interfaces/IMetaMorphoV1_1Factory.sol +++ b/src/interfaces/IMetaMorphoV1_1Factory.sol @@ -6,21 +6,21 @@ import {IMetaMorphoV1_1} from "./IMetaMorphoV1_1.sol"; /// @title IMetaMorphoV1_1Factory /// @author Morpho Labs /// @custom:contact security@morpho.org -/// @notice Interface of MetaMorpho's factory. +/// @notice Interface of MetaMorphoV1_1's factory. interface IMetaMorphoV1_1Factory { /// @notice The address of the Morpho contract. function MORPHO() external view returns (address); - /// @notice Whether a MetaMorpho vault was created with the factory. + /// @notice Whether a MetaMorphoV1_1 vault was created with the factory. function isMetaMorpho(address target) external view returns (bool); - /// @notice Creates a new MetaMorpho vault. + /// @notice Creates a new MetaMorphoV1_1 vault. /// @param initialOwner The owner of the vault. /// @param initialTimelock The initial timelock of the vault. /// @param asset The address of the underlying asset. /// @param name The name of the vault. /// @param symbol The symbol of the vault. - /// @param salt The salt to use for the MetaMorpho vault's CREATE2 address. + /// @param salt The salt to use for the MetaMorphoV1_1 vault's CREATE2 address. function createMetaMorpho( address initialOwner, uint256 initialTimelock, diff --git a/src/libraries/EventsLib.sol b/src/libraries/EventsLib.sol index 7b061892..a855de5a 100644 --- a/src/libraries/EventsLib.sol +++ b/src/libraries/EventsLib.sol @@ -96,15 +96,15 @@ library EventsLib { /// @notice Emitted when an `amount` of `token` is transferred to the skim recipient by `caller`. event Skim(address indexed caller, address indexed token, uint256 amount); - /// @notice Emitted when a new MetaMorpho vault is created. - /// @param metaMorpho The address of the MetaMorpho vault. + /// @notice Emitted when a new MetaMorphoV1_1 vault is created. + /// @param metaMorpho The address of the MetaMorphoV1_1 vault. /// @param caller The caller of the function. - /// @param initialOwner The initial owner of the MetaMorpho vault. - /// @param initialTimelock The initial timelock of the MetaMorpho vault. + /// @param initialOwner The initial owner of the MetaMorphoV1_1 vault. + /// @param initialTimelock The initial timelock of the MetaMorphoV1_1 vault. /// @param asset The address of the underlying asset. - /// @param name The name of the MetaMorpho vault. - /// @param symbol The symbol of the MetaMorpho vault. - /// @param salt The salt used for the MetaMorpho vault's CREATE2 address. + /// @param name The name of the MetaMorphoV1_1 vault. + /// @param symbol The symbol of the MetaMorphoV1_1 vault. + /// @param salt The salt used for the MetaMorphoV1_1 vault's CREATE2 address. event CreateMetaMorpho( address indexed metaMorpho, address indexed caller,