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 31b57b6 commit 1bff1b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/payment/VCPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract VCPayment is Ownable2StepUpgradeable {
* @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 1bff1b7

Please sign in to comment.