From 20560d7e51fc64b5aee4bccab17ccebf17c88478 Mon Sep 17 00:00:00 2001 From: Hayden Shively <17186559+haydenshively@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:34:21 -0500 Subject: [PATCH] Create MultiManager --- periphery/src/managers/MultiManager.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 periphery/src/managers/MultiManager.sol diff --git a/periphery/src/managers/MultiManager.sol b/periphery/src/managers/MultiManager.sol new file mode 100644 index 00000000..b5d185e8 --- /dev/null +++ b/periphery/src/managers/MultiManager.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: AGPL-3.0-only +pragma solidity 0.8.17; + +import {IManager} from "aloe-ii-core/Borrower.sol"; + +contract MultiManager is IManager { + function callback(bytes calldata data, address, uint208) external override returns (uint208) { + unchecked { + bytes[] memory calls = abi.decode(data, (bytes[])); + + uint256 count = calls.length; + for (uint256 i; i < count; i++) { + (bool success, ) = msg.sender.call(calls[i]); // solhint-disable-line avoid-low-level-calls + require(success); + } + + return 0; + } + } +}