Skip to content

Commit

Permalink
feat(modifier): modifier at the top of the snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrpl committed Nov 21, 2023
1 parent 48905e0 commit 7970859
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/blue/CallbacksSnippets.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7970859

Please sign in to comment.