Skip to content

Commit 08bf417

Browse files
committed
chore: move check to internal function
1 parent 1a37e1a commit 08bf417

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/router.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ contract Router is IRouter {
4242

4343
/// Only allow the PoolManager to call certain functions.
4444
modifier onlyPoolManager() {
45-
require(msg.sender == address(POOLMANAGER));
45+
_checkCallerIsPoolManager();
4646
_;
4747
}
4848

49+
function _checkCallerIsPoolManager() internal view {
50+
require(msg.sender == address(POOLMANAGER), "Caller is not PoolManager");
51+
}
52+
4953
/// @inheritdoc IRouter
5054
function swap(AsyncOrder calldata order, bytes memory userData) external {
5155
address onBehalf = address(this);

0 commit comments

Comments
 (0)