File Diamond.Proxy.sol 29
File Diamond.sol: 126, 135, 150, 170, 278
File AllowList.sol: 33
File DiamondCut.sol: 27-29, 68, 83-85, 98, 109, 114
File Executor.sol 164, 173, 202, 215, 270, 341, 343
File DiamondCut.sol: 29
s.totalBlocksVerified
should be cached
File Executor.sol 340, 345
if (newTotalBlocksCommitted < s.totalBlocksVerified) { // 1 SLOAD
s.totalBlocksVerified = newTotalBlocksCommitted;
}
s.totalBlocksCommitted = newTotalBlocksCommitted; // 2 SLOAD
emit BlocksRevert(s.totalBlocksCommitted, s.totalBlocksVerified, s.totalBlocksExecuted); // 3 SLOAD
cache s.totalBlocksCommitted
to minimize usage in event
File Executor.sol 345
from
emit BlocksRevert(s.totalBlocksCommitted, s.totalBlocksVerified, s.totalBlocksExecuted);
to
emit BlocksRevert(newTotalBlocksCommitted, s.totalBlocksVerified, s.totalBlocksExecuted);
cache s.totalBlocksExecuted
to minimize usage in event
File Executor.sol 338, 345
File L2ContractHelper.sol: 43, 47
File ExternalDecoder.so: 10, 15
public/external function names and public member variable names can be optimized to save gas. Below are the interfaces/abstract contracts that can be optimized so that the most frequently-called functions use the least amount of gas possible during method lookup. Method IDs that have two leading zero bytes can save 128 gas each during deployment, and renaming functions to have lower method IDs will save 22 gas per call, per sorted position shifted
Files: IDiamondCut, IExecutor.sol, IGetters.sol, IGovernance.sol, IMailbox.sol, IZkSync.sol