Putty contest - fatherOfBlocks's results

An order-book based american options market for NFTs and ERC20s.

General Information

Platform: Code4rena

Start Date: 29/06/2022

Pot Size: $50,000 USDC

Total HM: 20

Participants: 133

Period: 5 days

Judge: hickuphh3

Total Solo HM: 1

Id: 142

League: ETH

Putty

Findings Distribution

Researcher Performance

Rank: 76/133

Findings: 2

Award: $68.30

🌟 Selected for report: 0

🚀 Solo Findings: 0

PuttyV2Nft

  • L5 - Strings is imported and are not used in any part of the code, therefore it is an unnecessary waste of gas in the deploy.

PuttyV2

  • L657 - The _transferFloorsOut() function does not validate that floorTokens and floorTokenIds have the same length, therefore it could generate a revert without showing an indicated message. This is because the for loop uses the internal counter to choose the token and tokenId to transfer.

PuttyV2Nft

  • L12/13/26/27/28/41 - The require could generate a lower gas cost, if instead of require an if with a custom error is used.

PuttyV2

  • L293/327/351/427/498/598/599 - Instead of variable > 0 it is less expensive to make variable != 0

  • L306/307 - It is not necessary to create a variable in memory if it is only going to be used once in the function.

  • L297/298 - Gas could be saved in the for loop by creating a variable in memory for floorAssetTokenIds.length

  • L497/556/594/611/627/637/647/658/670/728/742 - It is not necessary to set a variable with its default value, since this value already has it and in any case it generates an extra gas expense.

  • L551/554/556/594/611/627/637/647/658/670/728/742- As array.length is used so many times, a variable could be generated in memory, in this way less gas would be spent.

  • L556/594/611/627/637/647/658/670/728/742 - Instead of i++, unchecked{++i;} could be used, this is because it is not possible to reach type(uint).max

  • L214/241/278/281/284/287/287/290/293/297/298- The require could generate a lower gas cost, if instead of require an if with a custom error is used.

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