Putty contest - ACai'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: 41/133

Findings: 2

Award: $131.53

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: codexploder

Also found by: ACai, Critical, cccz, horsefacts, ignacio, shenwilly, unforgiven, xiaoming90

Labels

bug
duplicate
2 (Med Risk)
old-submission-method

Awards

110.3615 USDC - $110.36

External Links

PuttyV2.fillOrder

It should add require(order.duration > 0); into the fillOrder function. Because while order.duration == 0 , the order is meaningless.

#0 - outdoteth

2022-07-07T19:16:24Z

It should add require(order.duration > 0); into the fillOrder function. Because while order.duration == 0 , the order is meaningless.

Duplicate: Orders with low durations can be easily DOS’d and prevent possibility of exercise: https://github.com/code-423n4/2022-06-putty-findings/issues/265

#1 - HickupHH3

2022-07-15T02:54:56Z

dup of #107

Reduce the gas cost of for loop

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L556-L559

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L594-L602

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L611-L613

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L627-L629

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L637-L639

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L647-L649

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L647-L649

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L647-L649

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L728-L733

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L742-L747

change

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

into

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

public functions that are never called by the contract should be declared external to save gas.

PuttyV2

exercise, withdraw, batchFillOrder, acceptCounterOffer, domainSeparatorV4, tokenURI

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