Skip to content

Commit

Permalink
fix: remove redundant check in validPercentValue modifier
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yushihang committed Feb 3, 2025
1 parent 39beaf4 commit 31b57b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/payment/MCPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
_;
Expand Down

0 comments on commit 31b57b6

Please sign in to comment.