Forgotten Runes Warrior Guild contest - Tadashi's results

16,000 Warrior NFTs sold in a phased Dutch Auction.

General Information

Platform: Code4rena

Start Date: 03/05/2022

Pot Size: $30,000 USDC

Total HM: 6

Participants: 93

Period: 3 days

Judge: gzeon

Id: 118

League: ETH

Forgotten Runes

Findings Distribution

Researcher Performance

Rank: 89/93

Findings: 1

Award: $15.45

🌟 Selected for report: 0

🚀 Solo Findings: 0

Pre-incrementing a variable is cheaper than post-incrementing it

Details: Consider the following changes to save gas:

  1. Change L193 of ForgottenRunesWarriorsMinter.sol to ++numSold;.
  2. Change L248 of ForgottenRunesWarriorsMinter.sol to ++numClaimed;.

Unnecessary zero-address validation

Details: Since the deployer of the contract will never be address(0) and function forwardERC20s uses a onlyOwner modifier, the check in L174 of ForgottenRunesWarriorsGuild.sol is not needed. The same applies to L628 of ForgottenRunesWarriorsMinter.sol.

Unnecessary checked arithmetic in for loop

Details: There is no risk that the loop counters below can overflow:

  1. L162 of ForgottenRunesWarriorsMinter.sol
  2. L220 of ForgottenRunesWarriorsMinter.sol
  3. L259 of ForgottenRunesWarriorsMinter.sol
  4. L355 of ForgottenRunesWarriorsMinter.sol

Thus, it is recommended to use unchecked keyword to disable checked arithmetic when iterating the loop counter — see G011 for more information.

Remark: Pre-incrementing a variable is cheaper than post-incrementing it, so consider replacing i++ by ++i when doing this change.

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