SKALE contest - d4rk's results

The only Ethereum native multichain scaling network.

General Information

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

SKALE

Findings Distribution

Researcher Performance

Rank: 24/24

Findings: 1

Award: $178.49

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Findings Information

๐ŸŒŸ Selected for report: IllIllI

Also found by: 0x1f8b, CertoraInc, TerrierLover, Tomio, WatchPug, d4rk, gzeon, kenta, kyliek, m_smirnova2020, rfa, robee, saian, ye0lde

Labels

bug
G (Gas Optimization)

Awards

178.4876 USDC - $178.49

External Links

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

Initializing i with its default value isnโ€™t needed and costs extra gas.

3 gas saved

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:

Myth that has been busted in multiple occasions

3 gas saved in total

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax ยฉ 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter