Skip to content

Commit b5d47f1

Browse files
authored
Certora M-02: Relayer can force losses onto Morpho vault depositors through reallocations (#96)
1 parent abdd2ca commit b5d47f1

File tree

2 files changed

+0
-309
lines changed

2 files changed

+0
-309
lines changed

src/ForeignController.sol

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ pragma solidity ^0.8.21;
44
import { IAToken } from "aave-v3-origin/src/core/contracts/interfaces/IAToken.sol";
55
import { IPool as IAavePool } from "aave-v3-origin/src/core/contracts/interfaces/IPool.sol";
66

7-
import { IMetaMorpho, Id, MarketAllocation } from "metamorpho/interfaces/IMetaMorpho.sol";
8-
97
import { IERC7540 } from "forge-std/interfaces/IERC7540.sol";
108

119
import { AccessControl } from "openzeppelin-contracts/contracts/access/AccessControl.sol";
@@ -411,7 +409,6 @@ contract ForeignController is AccessControl {
411409
ERC20Lib.transfer(proxy, asset, destination, amount);
412410
}
413411

414-
415412
/**********************************************************************************************/
416413
/*** Relayer ERC4626 functions ***/
417414
/**********************************************************************************************/
@@ -792,43 +789,6 @@ contract ForeignController is AccessControl {
792789
}));
793790
}
794791

795-
/**********************************************************************************************/
796-
/*** Relayer Morpho functions ***/
797-
/**********************************************************************************************/
798-
799-
function setSupplyQueueMorpho(address morphoVault, Id[] memory newSupplyQueue)
800-
external
801-
onlyRole(RELAYER)
802-
rateLimitExists(RateLimitHelpers.makeAssetKey(LIMIT_4626_DEPOSIT, morphoVault))
803-
{
804-
proxy.doCall(
805-
morphoVault,
806-
abi.encodeCall(IMetaMorpho(morphoVault).setSupplyQueue, (newSupplyQueue))
807-
);
808-
}
809-
810-
function updateWithdrawQueueMorpho(address morphoVault, uint256[] calldata indexes)
811-
external
812-
onlyRole(RELAYER)
813-
rateLimitExists(RateLimitHelpers.makeAssetKey(LIMIT_4626_DEPOSIT, morphoVault))
814-
{
815-
proxy.doCall(
816-
morphoVault,
817-
abi.encodeCall(IMetaMorpho(morphoVault).updateWithdrawQueue, (indexes))
818-
);
819-
}
820-
821-
function reallocateMorpho(address morphoVault, MarketAllocation[] calldata allocations)
822-
external
823-
onlyRole(RELAYER)
824-
rateLimitExists(RateLimitHelpers.makeAssetKey(LIMIT_4626_DEPOSIT, morphoVault))
825-
{
826-
proxy.doCall(
827-
morphoVault,
828-
abi.encodeCall(IMetaMorpho(morphoVault).reallocate, (allocations))
829-
);
830-
}
831-
832792
/**********************************************************************************************/
833793
/*** Relayer Pendle functions ***/
834794
/**********************************************************************************************/

test/spark-base-fork/MorphoAllocations.t.sol

Lines changed: 0 additions & 269 deletions
This file was deleted.

0 commit comments

Comments
 (0)