Putty contest - 0x29A'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: 87/133

Findings: 2

Award: $52.65

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

5.5216 USDC - $5.52

Labels

bug
duplicate
2 (Med Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L561-L584 https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L259-L380 https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L382-L458

Vulnerability details

Impact

In the fillOrder, exercise or acceptCounterOffer functions there are some paths where an user can send value by mistake and the contract dont't use this value and will stuck in the contract

Proof of Concept

In exercise function, exercising a put option order and the sender send value There are others paths with the same effect the the three functions

Tools Used

Review

Revert the transaction if send mistakenly value:

} else {
+       require(msg.value == 0, "The ETH amount sent should be 0");
    ERC20(order.baseAsset).safeTransferFrom(msg.sender, order.maker, order.premium);
}
} else {
+       require(msg.value == 0, "The ETH amount sent should be 0");
    ERC20(order.baseAsset).safeTransferFrom(msg.sender, address(this), order.strike);
}
} else {
+       require(msg.value == 0, "The ETH amount sent should be 0");
    ERC20(order.baseAsset).safeTransferFrom(msg.sender, address(this), order.strike);
}

#0 - rotcivegaf

2022-07-04T23:26:26Z

Duplicate of #226

#1 - outdoteth

2022-07-06T19:25:09Z

Duplicate: Native ETH can be lost if it’s not utilised in exercise and fillOrder: https://github.com/code-423n4/2022-06-putty-findings/issues/226

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