Platform: Code4rena
Start Date: 18/02/2022
Pot Size: $125,000 USDC
Total HM: 13
Participants: 24
Period: 14 days
Judge: GalloDaSballo
Total Solo HM: 6
Id: 88
League: ETH
Rank: 24/24
Findings: 1
Award: $178.49
๐ Selected for report: 0
๐ Solo Findings: 0
๐ Selected for report: IllIllI
Also found by: 0x1f8b, CertoraInc, TerrierLover, Tomio, WatchPug, d4rk, gzeon, kenta, kyliek, m_smirnova2020, rfa, robee, saian, ye0lde
Initializing i with its default value isnโt needed and costs extra gas. MessageProxy.sol::515 - for (uint256 i = 0; i < messages.length; i++) {
Reading the array length for each iteration spends more gas in comparison to caching the len outside of the loop: MessageProxy.sol::515 - for (uint256 i = 0; i < messages.length; i++) {
Changing "constant" to "immutable" will result in computing the hash once during deployment thus saving gas rather than with the constant, where the computation of keccak256 operation occurs each time the following roles are used: MessageProxy.sol::50 - bytes32 public constant MAINNET_HASH = keccak256(abi.encodePacked("Mainnet")); MessageProxy.sol::51 - bytes32 public constant CHAIN_CONNECTOR_ROLE = keccak256("CHAIN_CONNECTOR_ROLE"); MessageProxy.sol::52 - bytes32 public constant EXTRA_CONTRACT_REGISTRAR_ROLE = keccak256("EXTRA_CONTRACT_REGISTRAR_ROLE"); MessageProxy.sol::53 - bytes32 public constant CONSTANT_SETTER_ROLE = keccak256("CONSTANT_SETTER_ROLE");
#0 - yavrsky
2022-03-14T14:28:24Z
Only marginal gas improvements.
#1 - GalloDaSballo
2022-04-28T16:38:13Z
3 gas saved
Myth that has been busted in multiple occasions
3 gas saved in total