Infinity NFT Marketplace contest - 0xAsm0d3us's results

The world's most advanced NFT marketplace.

General Information

Platform: Code4rena

Start Date: 14/06/2022

Pot Size: $50,000 USDC

Total HM: 19

Participants: 99

Period: 5 days

Judge: HardlyDifficult

Total Solo HM: 4

Id: 136

League: ETH

Infinity NFT Marketplace

Findings Distribution

Researcher Performance

Rank: 97/99

Findings: 1

Award: $31.22

🌟 Selected for report: 0

🚀 Solo Findings: 0

Infinity NFT Marketplace contest

Gas Optimizations:

1- No need to set the counter unit var to 0 in for loops, as the default value for them is already zero.

If the variable is not set/initialized, it is assumed to have a default value (0, false, 0x0, etc., depending on the data type). If you explicitly initialize it with its default value, you are just wasting gas.

It has been observed that the initial point in for loops (the counter) is set to zero. Which is a redundant step, all such occurences can be changed in the following way:

Before:

for (uint256 i = 0; i < ordersLength; ) {
    //stuf here
}

After

for (uint256 i; i < ordersLength; ) {
    //stuf here
}

2- Use of Multiple require(s)

Context: InfinityExchange.sol#L264

Using mutiple require statements is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.

Before:

require(numSells == buys.length && numSells == constructs.length, 'mismatched lengths');

After:

require(numSells == buys.length, 'mismatched lengths');
require(numSells == constructs.length, 'mismatched lengths');
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