Splitting into separate require()
statements saves gas
require(
callersLength == _targets.length &&
callersLength == _functionSigs.length &&
callersLength == _enables.length,
"yw"
); // The size of arrays should be equal
Recommendation:
require(callersLength == _targets.length, "yw");
require(callersLength == _functionSigs.length, "yw");
require(callersLength == _enables.length,"yw");
// The size of arrays should be equal
require(version == 1 && _bytecodeHash[1] == bytes1(0), "zf"); // Incorrectly formatted bytecodeHash
Recommendation:
require(version == 1, "zf");
require(_bytecodeHash[1] == bytes1(0),"zf");
// Incorrectly formatted bytecodeHash
Underflow/overflow checks are made every time ++i
(or equivalent counter) is called. Such checks are unnecessary since i
is already limited. Therefore, use unchecked {++i}
instead
for (uint256 i = 0; i < facetCutsLength; ++i) {
for (uint256 i = 0; i < selectorsLength; ++i) {
for (uint256 i = 0; i < selectorsLength; ++i) {
for (uint256 i = 0; i < selectorsLength; ++i) {