Revert string > 32 bytes #185
Labels
bug
Something isn't working
G (Gas Optimization)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
Handle
sirhashalot
Vulnerability details
Impact
Strings are broken into 32 byte chunks for operations. Revert error strings over 32 bytes therefore consume extra gas as documented publicly
Proof of Concept
There are multiple examples of this gas optimization opportunity, including but not limited to:
Recommended Mitigation Steps
Reducing revert error strings to under 32 bytes decreases deployment time gas and runtime gas when the revert condition is met. Alternatively, the code could be modified to use custom errors, introduced in Solidity 0.8.4: https://blog.soliditylang.org/2021/04/21/custom-errors/
The text was updated successfully, but these errors were encountered: