Foundation Drop contest - hakerbaya's results

Foundation is a web3 destination.

General Information

Platform: Code4rena

Start Date: 11/08/2022

Pot Size: $40,000 USDC

Total HM: 8

Participants: 108

Period: 4 days

Judge: hickuphh3

Total Solo HM: 2

Id: 152

League: ETH

Foundation

Findings Distribution

Researcher Performance

Rank: 105/108

Findings: 1

Award: $20.60

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Summary

Change string to byteX if possible

Fix Gas Optimization in this smart contract function

https://github.com/code-423n4/2022-08-foundation/blob/main/contracts/NFTCollectionFactory.sol#L258

Explanation

The string type is basically equal to bytes so that we can use bytesX as alternative of string. Itโ€™s better to covert string to bytesX from efficiency perspective, as long as the string length is less than 32.

Please see the bellow comparison. When we convert the string โ€œhello world!โ€ to bytes, the gas cost becomes nearly 3 times chipper than using string.

Fix

change from string to byteX

#0 - HardlyDifficult

2022-08-19T16:23:49Z

Valid suggestion... but for flexibility we are currently leaning towards keeping them as strings just in case a creator would like to use a long value here. Will consider this suggestion.

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