Infinity NFT Marketplace contest - rfa'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: 46/99

Findings: 3

Award: $91.28

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

11.084 USDC - $11.08

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

External Links

Lines of code

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L1230

Vulnerability details

Impact

Owner can't rescuing exchange fees paid of the contract

Proof of Concept

The function using msg.value as the value that intended to be transferred to destination. By doing this way, if owner want to rescue 10 ETH from the contract, he need to send 10 eth to make msg.value == 10. Therefore, The function is useless and the ETH will stuck in the contract.

Tools Used

Manual review

Replace msg.value with address(this).balance:

(bool sent, ) = destination.call{value: address(this).balance}('');

or make new parameter to send certain amount of ETH:

function rescueETH(address destination, uint amount) external onlyOwner { (bool sent, ) = destination.call{value: amount}(''); require(sent, 'failed'); }

then remove the payable

#0 - nneverlander

2022-06-22T18:30:54Z

Duplicate

#2 - HardlyDifficult

2022-07-09T16:51:14Z

LOW

Title: Useless receive() function

https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#L121 https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L57

The InfinityExchange.sol contract already has fallback() function which can receive data and ether (receive can only receive eth). We can just remove receive() function

Title: Using constructor() in InfinityStaker.sol

https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L33-L42

The vars are not constant and can set anytime through function. Therefore, setting the initial value via constructor can increase readability of the code (since the hardcoded value won't have the same value as the value in the future). And also it can save gas

Title: Using delete statement

https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L299-L312

Using delete to set value == 0 can save 4 gas per execution

#0 - nneverlander

2022-06-22T14:21:53Z

Thanks

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