ENS contest - rokinot's results

Decentralised naming for wallets, websites, & more.

General Information

Platform: Code4rena

Start Date: 12/07/2022

Pot Size: $75,000 USDC

Total HM: 16

Participants: 100

Period: 7 days

Judge: LSDan

Total Solo HM: 7

Id: 145

League: ETH

ENS

Findings Distribution

Researcher Performance

Rank: 59/100

Findings: 2

Award: $118.90

🌟 Selected for report: 0

🚀 Solo Findings: 0

Non-critical

Multiple require() statements do not have a revert message

ETHRegistrarController.sol RRUtils.sol BytesUtils.sol

ABIEncoderV2 is deprecated, as it's activated on Solidity v0.8 by default

#L3

Incomplete comment

#L267

Unused function

#L219

Add private constants instead of using magic numbers for improved readability

SHA1.sol

Consider providing a SPDX license identifier before publishing contracts

ETHRegistrarController.sol RRUtils.sol

now declarations shadows the built-in now keyword (which is synonymous to block.timestamp)

DNSSECImpl.sol

x = x + y is more efficient than x += y, same for x = x - y and x -= y

RRUtils.sol BytesUtils.sol

variables that are assigned as zero should be left unitialized

RRUtils.sol DNSSECImpl.sol BytesUtils.sol

Potencies of 2 (and multiples of 2) i.e. 2**(number) can be converted into left-shift minus one 2<<(number - 1) for a more efficient operation

#L219 #L69

Multiplications by multiples of 2 can be turned into a left shift which uses cheaper opcodes

#L316

require() statements using && operators should be split into two different require() operations.

#L268

Use a more recent version of Solidity

NameWrapper.sol

This is an important mention because not only v0.8.15 has introduced better heuristics for yul optimization, relevant for the assembly codes in here, but also because the developers have compiled this very project and found a decrease in 4.89% in deployment costs and 0.29% in runtime gas. Source

++i iterators are more efficient than i++ iterators.

RRUtils.sol DNSSECImpl.sol ETHRegistrarController.sol

uint256 iterators should be left unchecked {} as there's no risk of overflow

RRUtils.sol DNSSECImpl.sol ETHRegistrarController.sol

<array>.length loop comparisons being iterated one by one can use the != operator instead of <

RRUtils.sol DNSSECImpl.sol ETHRegistrarController.sol

#L93

!= 0 comparisons are more efficient than > 0 for unsigned integers

#L245 #L93

require() statements will consume less gas if the revert string contains less than 32 characters

ETHRegistrarController.sol

Using unsigned integers other than uint256 incurs overhead costs

#L47

Remove unused error message

#L25

Functions that necessarily revert when called by normal users can be set as payable

DNSSECImpl.sol

Use calldata for read-only arguments for external functions

DNSSECImpl.sol

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