ENS contest - Chom'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: 94/100

Findings: 1

Award: $39.86

🌟 Selected for report: 0

🚀 Solo Findings: 0

Use ERC721 instead of ERC1155

https://github.com/code-423n4/2022-07-ens/blob/main/contracts/wrapper/ERC1155Fuse.sol

ERC721 tend to use less gas than ERC1155

Transfer event doesn't has an extra amount field which save an extra gas.

You are using ERC1155 to act as an ERC721 (Only max balance per id = 1 eg every tokenId is unique)

Which mean you not need the ERC1155 functionality.

Consider using custom errors instead of revert strings

This reduce gas cost as show here https://forum.openzeppelin.com/t/a-collection-of-gas-optimisation-tricks/19966/5

Solidity 0.8.4 introduced custom errors. They are more gas efficient than revert strings, when it comes to deployment cost as well as runtime cost when the revert condition is met. Use custom errors instead of revert strings for gas savings.

Any require statement in your code can be replaced with custom error for example,

https://github.com/code-423n4/2022-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/wrapper/ERC1155Fuse.sol#L199

require(to != address(0), "ERC1155: transfer to the zero address");

Can be replaced with

// declare error before contract declaration error TransferToZeroAddress(); if (to == address(0)) revert TransferToZeroAddress();

#0 - jefflau

2022-07-26T08:12:34Z

Use ERC721 instead of ERC1155

ERC1155 is more gas efficient than ERC721

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