From 31b57b6e0f91a851d698c53aaac7e74a3303e279 Mon Sep 17 00:00:00 2001 From: yushihang Date: Fri, 31 Jan 2025 18:03:38 +0800 Subject: [PATCH] fix: remove redundant check in validPercentValue modifier The validPercentValue modifier had a redundant check for `percent < 0` since the parameter is of type uint256 which cannot be negative. Removed this check to improve code clarity and gas efficiency. --- contracts/payment/MCPayment.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/payment/MCPayment.sol b/contracts/payment/MCPayment.sol index 4142ebfe..75dcda7d 100644 --- a/contracts/payment/MCPayment.sol +++ b/contracts/payment/MCPayment.sol @@ -92,7 +92,7 @@ contract MCPayment is Ownable2StepUpgradeable, EIP712Upgradeable { * @dev Valid percent value modifier */ modifier validPercentValue(uint256 percent) { - if (percent < 0 || percent > 100) { + if (percent > 100) { revert InvalidOwnerPercentage("Invalid owner percentage"); } _;