Connext Amarok contest - Randyyy's results

The interoperability protocol of L2 Ethereum.

General Information

Platform: Code4rena

Start Date: 08/06/2022

Pot Size: $115,000 USDC

Total HM: 26

Participants: 72

Period: 11 days

Judge: leastwood

Total Solo HM: 14

Id: 132

League: ETH

Connext

Findings Distribution

Researcher Performance

Rank: 71/72

Findings: 1

Award: $84.50

🌟 Selected for report: 0

🚀 Solo Findings: 0

  1. x > 0 ==> x!=0

POC

https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/facets/BridgeFacet.sol#L499

Impact

!=0 is cheaper operation compared to >0, when dealing with uint.

  1. Cached array length.

POC

https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/facets/RelayerFacet.sol#L138 https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/libraries/LibDiamond.sol#L226

Impact

Caching the array length in the stack can save gas.

  1. Custom errors

POC

https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/libraries/LibDiamond.sol#L226 https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/libraries/LibDiamond.sol#L228 https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/libraries/LibDiamond.sol#L230 https://github.com/code-423n4/2022-06-connext/blob/e1b2df1584dcc62dcd32a0bbcfd627fc5a0c4b7b/contracts/contracts/core/connext/libraries/LibDiamond.sol#L238

Impact

Custom errors from solidity 0.8.4 are cheaper than revert strings. Source: https://blog.soliditylang.org/2021/04/21/custom-errors/:

  1. Default 0 for uint.

POC

https://github.com/code-423n4/2022-06-connext/blob/4dd6149748b635f95460d4c3924c7e3fb6716967/contracts/contracts/core/connext/libraries/SwapUtils.sol#L205

Impact

Setting uint256 to 0 is redundant as they default to 0.

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