Infinity NFT Marketplace contest - 8olidity'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: 83/99

Findings: 1

Award: $48.98

🌟 Selected for report: 0

🚀 Solo Findings: 0

Unused receive() function will lock Ether in contract

If the intention is for the Ether to be used, the function should call another function, otherwise it should revert

File: contracts\core\InfinityExchange.sol: 120 121: receive() external payable {} 122 File: contracts\staking\InfinityStaker.sol: 56 57: receive() external payable {} 58

> 0 is less efficient than != 0 for unsigned integers (with proof)

!= 0 costs less gas compared to > 0 for unsigned integers in require statements with the optimizer enabled (6 gas)

Proof: While it may seem that > 0 is cheaper than !=, this is only true without the optimizer enabled and outside a require statement. If you enable the optimizer at 10k AND you're in a require statement, this will save gas. You can see this tweet for more proofs: https://twitter.com/gzeon/status/1485428085885640706

I suggest changing > 0 with != 0 here:

File: contracts\core\InfinityExchange.sol: 391 uint256 numNonces = orderNonces.length; 392: require(numNonces > 0, 'cannot be empty'); 393 for (uint256 i = 0; i < numNonces; ) {

#0 - nneverlander

2022-06-23T12:26:03Z

Duplicate

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