Use of require(condition, "error string")
pattern is gas inefficient because the "error string" parameter, which is a descriptive error message, requires additional gas to encode and store on the blockchain. Specifically, the compiler converts this string into a 32-byte string, adding to the overall gas cost, even if the string is shorter.
The require
statement with an inline string message causes increased gas consumption due to the need to store the string data in the contract bytecode and during execution
The gas cost of failed transactions is unnecessarily increased, especially in functions where there are more require-statements. This can discourage user interaction with the contract and increase the operational cost of using the protocol. In large-scale deployments, the cumulative gas overhead from descriptive string errors can become significant.
Manual Review
Declare all errors e.g. error BetAmountTooSmall()
Use if/revert
notation:-
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.