The contract contains a low-severity vulnerability related to the use of a require statement with a string message in the nonReentrant modifier. While the current implementation functions correctly, it is not gas-optimized and does not follow modern Solidity best practices, which advocate for custom errors instead of string-based require messages.
The nonReentrant modifier uses the following line of code to check and enforce a reentrancy lock:
Using a string message in require increases gas consumption since the string must be stored in the transaction’s revert data when the condition fails.
The impact of this vulnerability is low since it does not affect the security or functionality of the contract. However, in high-volume deployments, the extra gas cost from string-based require statements could accumulate and increase the overall cost of using the contract.
Manual Code Review: The vulnerability was identified by analyzing the code's structure and evaluating its compliance with Solidity best practices.
require Statement with a Custom Error:Define a custom error and use it in the nonReentrant modifier to optimize gas consumption:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.