Skip to content

Commit

Permalink
fix(TWABDelegator): inline delegator address check
Browse files Browse the repository at this point in the history
  • Loading branch information
PierrickGT committed Mar 2, 2022
1 parent 92ba89f commit 73d9c5a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions contracts/TWABDelegator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ contract TWABDelegator is ERC20, LowLevelDelegator, PermitAndMulticall {
uint256 _slot,
uint256 _amount
) external returns (Delegation) {
_requireDelegatorNotZeroAddress(_delegator);
require(_delegator != address(0), "TWABDelegator/dlgtr-not-zero-adr");
_requireAmountGtZero(_amount);

Delegation _delegation = Delegation(_computeAddress(_delegator, _slot));
Expand Down Expand Up @@ -606,14 +606,6 @@ contract TWABDelegator is ERC20, LowLevelDelegator, PermitAndMulticall {
require(_amount > 0, "TWABDelegator/amount-gt-zero");
}

/**
* @notice Require to verify that `_delegator` is not address zero.
* @param _delegator Address to check
*/
function _requireDelegatorNotZeroAddress(address _delegator) internal pure {
require(_delegator != address(0), "TWABDelegator/dlgtr-not-zero-adr");
}

/**
* @notice Require to verify that `_to` is not address zero.
* @param _to Address to check
Expand Down

0 comments on commit 73d9c5a

Please sign in to comment.