Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/DeleGatorCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,40 @@ abstract contract DeleGatorCore is
* @dev Check that the caller is the entry point
*/
modifier onlyEntryPoint() {
if (msg.sender != address(entryPoint)) revert NotEntryPoint();
_onlyEntryPoint();
_;
}

function _onlyEntryPoint() private view {
if (msg.sender != address(entryPoint)) revert NotEntryPoint();
}

/**
* @notice Require the function call to come from the EntryPoint or this contract.
* @dev Check that the caller is either the delegator contract itself or the entry point
*/
modifier onlyEntryPointOrSelf() {
if (msg.sender != address(entryPoint) && msg.sender != address(this)) revert NotEntryPointOrSelf();
_onlyEntryPointOrSelf();
_;
}

function _onlyEntryPointOrSelf() private view {
if (msg.sender != address(entryPoint) && msg.sender != address(this)) revert NotEntryPointOrSelf();
}

/**
* @notice Require the function call to come from the DelegationManager.
* @dev Check that the caller is the stored delegation manager.
*/
modifier onlyDelegationManager() {
if (msg.sender != address(delegationManager)) revert NotDelegationManager();
_onlyDelegationManager();
_;
}

function _onlyDelegationManager() private view {
if (msg.sender != address(delegationManager)) revert NotDelegationManager();
}

////////////////////////////// Constructor //////////////////////////////

/**
Expand Down