You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 22 require revert strings referenced below should be shortened to 32 characters or fewer to save gas or else consider using custom error codes (which could save even more gas)
Avoid use of default "checked" behavior in a for loop
Underflow/overflow checks are made every time ++i (or i++) is called. Such checks are unnecessary since i is already limited. Therefore, use unchecked{++i}/unchecked{i++} instead
Require
revert string is too longThe 22
require
revert strings referenced below should be shortened to 32 characters or fewer to save gas or else consider using custom error codes (which could save even more gas)Example:
ETHRegistrarController.sol: L99-102
Additional long
require
strings:ETHRegistrarController.sol: L137-140
ETHRegistrarController.sol: L196-199
ETHRegistrarController.sol: L232-235
ETHRegistrarController.sol: L238-241
ETHRegistrarController.sol: L242
ETHRegistrarController.sol: L259-262
ReverseRegistrar.sol: L41-47
ReverseRegistrar.sol: L52-55
ERC1155Fuse.sol: L60-63
ERC1155Fuse.sol: L85-88
ERC1155Fuse.sol: L107-110
ERC1155Fuse.sol: L176
ERC1155Fuse.sol: L177-180
ERC1155Fuse.sol: L195-198
ERC1155Fuse.sol: L199
ERC1155Fuse.sol: L200-203
ERC1155Fuse.sol: L215-218
ERC1155Fuse.sol: L249
ERC1155Fuse.sol: L250-253
ERC1155Fuse.sol: L290-293
Controllable.sol.sol: L17
Revert
error string is too longThe
revert
strings below should be shortened to 32 characters or fewer to save gas, or else consider using custom errorsERC1155Fuse.sol: L322-327
ERC1155Fuse.sol: L354-359
Use of '&&' within a
require
functionSplitting such functions into separate
require()
statements (instead of using&&
) saves gasBytesUtils.sol: L268
Recommendation:
The same require function with embedded
&&
occurs in both sets of lines referenced below:ERC1155Fuse.sol: L215-218
ERC1155Fuse.sol: L290-293
Recommendation:
Array length should not be looked up in every iteration of a
for
loopSince calculating the array length costs gas, it's best to read the length of the array from memory before executing the loop
ERC1155Fuse.sol: L92-94
Suggestion:
Similarly for the following
for
loops:ERC1155Fuse.sol: L205-213
ETHRegistrarController.sol: L256-267
Use
++i
instead ofi++
to increase count in afor
loopSince use of
i++
costs more gas, it is better to use++i
in thefor
loop below:ETHRegistrarController.sol: L256-267
Avoid use of default "checked" behavior in a
for
loopUnderflow/overflow checks are made every time
++i
(ori++
) is called. Such checks are unnecessary sincei
is already limited. Therefore, useunchecked{++i}
/unchecked{i++}
insteadERC1155Fuse.sol: L92-94
Suggestion:
Similarly for the following
for
loops:ERC1155Fuse.sol: L205-213
ETHRegistrarController.sol: L256-267
The text was updated successfully, but these errors were encountered: