Skip to content

Commit

Permalink
chore: remove is functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Jan 31, 2024
1 parent 3a012e7 commit 8967801
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 56 deletions.
54 changes: 6 additions & 48 deletions src/TokenizedStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,7 @@ contract TokenizedStrategy {
* @param _sender The original msg.sender.
*/
function requireManagement(address _sender) public view {
require(isManagement(_sender), "!management");
}

/**
* @notice Return if a caller is `management`.
* @dev Is left public so that it can be used by the Strategy.
*
* When the Strategy calls this the msg.sender would be the
* address of the strategy so we need to specify the sender.
*
* Will return `true` if the check passed.
*
* @param _sender The original msg.sender.
*/
function isManagement(address _sender) public view returns (bool) {
return _sender == _strategyStorage().management;
require(_sender == _strategyStorage().management, "!management");
}

/**
Expand All @@ -336,23 +321,8 @@ contract TokenizedStrategy {
* @param _sender The original msg.sender.
*/
function requireKeeperOrManagement(address _sender) public view {
require(isKeeperOrManagement(_sender), "!keeper");
}

/**
* @notice Return if a caller is the `keeper` OR `management`
* @dev Is left public so that it can be used by the Strategy.
*
* When the Strategy calls this the msg.sender would be the
* address of the strategy so we need to specify the sender.
*
* Will return `true` if the check passed.
*
* @param _sender The original msg.sender.
*/
function isKeeperOrManagement(address _sender) public view returns (bool) {
StrategyData storage S = _strategyStorage();
return _sender == S.keeper || _sender == S.management;
require(_sender == S.keeper || _sender == S.management, "!keeper");
}

/**
Expand All @@ -365,23 +335,11 @@ contract TokenizedStrategy {
* @param _sender The original msg.sender.
*/
function requireEmergencyAuthorized(address _sender) public view {
require(isEmergencyAuthorized(_sender), "!emergency authorized");
}

/**
* @notice Return if a caller is the `management` or `emergencyAdmin`.
* @dev Is left public so that it can be used by the Strategy.
*
* When the Strategy calls this the msg.sender would be the
* address of the strategy so we need to specify the sender.
*
* Will return `true` if the check passed.
*
* @param _sender The original msg.sender.
*/
function isEmergencyAuthorized(address _sender) public view returns (bool) {
StrategyData storage S = _strategyStorage();
return _sender == S.emergencyAdmin || _sender == S.management;
require(
_sender == S.emergencyAdmin || _sender == S.management,
"!emergency authorized"
);
}

/*//////////////////////////////////////////////////////////////
Expand Down
8 changes: 0 additions & 8 deletions src/interfaces/ITokenizedStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ interface ITokenizedStrategy is IERC4626, IERC20Permit {

function requireEmergencyAuthorized(address _sender) external view;

function isManagement(address _sender) external view returns (bool);

function isKeeperOrManagement(address _sender) external view returns (bool);

function isEmergencyAuthorized(
address _sender
) external view returns (bool);

/*//////////////////////////////////////////////////////////////
KEEPERS FUNCTIONS
//////////////////////////////////////////////////////////////*/
Expand Down

0 comments on commit 8967801

Please sign in to comment.