From 79708597d27671b6d3df504541d5e341bea49262 Mon Sep 17 00:00:00 2001 From: Tom Rpl Date: Tue, 21 Nov 2023 16:53:36 +0100 Subject: [PATCH] feat(modifier): modifier at the top of the snippet --- src/blue/CallbacksSnippets.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/blue/CallbacksSnippets.sol b/src/blue/CallbacksSnippets.sol index 41e122c..f1ea028 100644 --- a/src/blue/CallbacksSnippets.sol +++ b/src/blue/CallbacksSnippets.sol @@ -46,6 +46,11 @@ contract CallbacksSnippets is IMorphoSupplyCollateralCallback, IMorphoRepayCallb swapMock = ISwap(swapAddress); } + modifier onlyMorpho() { + require(msg.sender == address(morpho), "msg.sender should be Morpho Blue"); + _; + } + /* Callbacks @@ -141,11 +146,6 @@ contract CallbacksSnippets is IMorphoSupplyCollateralCallback, IMorphoRepayCallb ); } - modifier onlyMorpho() { - require(msg.sender == address(morpho), "msg.sender should be Morpho Blue"); - _; - } - function _approveMaxTo(address asset, address spender) internal { if (ERC20(asset).allowance(address(this), spender) == 0) { ERC20(asset).approve(spender, type(uint256).max);