Skip to content

Commit

Permalink
Reuse _checkZeroAddress in _checkZeroAddressOrAmount
Browse files Browse the repository at this point in the history
Addressed comments in PR #1742.
  • Loading branch information
davidvuong committed Aug 10, 2023
1 parent 58347f5 commit 5d41088
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/core-contracts/contracts/token/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ contract ERC20 is IERC20 {
}

function _checkZeroAddressOrAmount(address target, uint256 amount) private pure {
if (target == address(0)) {
revert ParameterError.InvalidParameter("target", "Zero address");
}
_checkZeroAddress(target);

if (amount == 0) {
revert ParameterError.InvalidParameter("amount", "Zero amount");
Expand Down

0 comments on commit 5d41088

Please sign in to comment.