Foundation Drop contest - 0xackermann'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: 79/108

Findings: 1

Award: $41.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Returned Parameter Is Not Found

Location

NFTDropCollection#L303

Impact

Should not affect much since there is return in the function.

Proof of concept

Let us look at the function tokenURI:

function tokenURI(uint256 tokenId) public view override returns (string memory uri) {
  _requireMinted(tokenId);

  return string.concat(baseURI, tokenId.toString(), ".json");
}

Return parameter is declared but the variable is not found. uri is declared as returned parameter but no uri variable is found.

How to fix

Use assignment instead of return

uri = string.concat(baseURI, tokenId.toString(), ".json");

#0 - HardlyDifficult

2022-08-18T19:50:05Z

Agree, will fix. We have opted to use the named returns instead of return ... This is more consistent with other code in our repo and saves a bit of on the contract size. We also like named returns as a way of improving natspec, and typechain (particularly when a tuple is returned).

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