Putty contest - zeesaw'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: 122/133

Findings: 1

Award: $21.17

🌟 Selected for report: 0

🚀 Solo Findings: 0

Gas optimization

  1. i++ costs more gas than ++i, there are 10 instances of this issues.
for (uint256 i = 0; i < orders.length; i++) {
  1. <array>.length should not be looked up in every loop of a for-loop
require(orders.length == signatures.length, "Length mismatch in input");
require(signatures.length == floorAssetTokenIds.length, "Length mismatch in input");

positionIds = new uint256[](orders.length);
for (uint256 i = 0; i < orders.length; i++) {
    positionIds[i] = fillOrder(orders[i], signatures[i], floorAssetTokenIds[i]);
}

orders.length is used more than once that costs more gas

  1. public functions not called by the contract should be declared external instead, that can save more gas
function domainSeparatorV4() public view returns (bytes32) { return _domainSeparatorV4(); }
  1. Incorrect natspec comment
  1. Using > 0 costs more gas than != 0 when used on a uint in a require() statement
require(tokenAmount > 0, "ERC20: Amount too small");
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