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
Rank: 87/133
Findings: 2
Award: $52.65
π Selected for report: 0
π Solo Findings: 0
π Selected for report: IllIllI
Also found by: 0x29A, 0xDjango, 0xc0ffEE, AmitN, BowTiedWardens, StErMi, auditor0517, berndartmueller, cccz, danb, dipp, dirk_y, hansfriese, horsefacts, hyh, kirk-baird, oyc_109, peritoflores, rfa, sseefried, swit, xiaoming90, zzzitron
5.5216 USDC - $5.52
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
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
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
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
π Selected for report: xiaoming90
Also found by: 0x1f8b, 0x29A, 0x52, 0xDjango, 0xNazgul, 0xNineDec, 0xSolus, 0xf15ers, 0xsanson, AmitN, Bnke0x0, BowTiedWardens, Chom, David_, ElKu, Funen, GalloDaSballo, GimelSec, Hawkeye, IllIllI, JC, JohnSmith, Kaiziron, Kenshin, Lambda, Limbooo, MadWookie, Metatron, MiloTruck, Nethermind, Picodes, ReyAdmirado, Sneakyninja0129, StErMi, TomJ, Treasure-Seeker, TrungOre, Waze, Yiko, _Adam, __141345__, antonttc, async, aysha, catchup, cccz, cryptphi, csanuragjain, danb, datapunk, defsec, delfin454000, dirk_y, doddle0x, durianSausage, exd0tpy, fatherOfBlocks, gogo, hake, hansfriese, horsefacts, hubble, itsmeSTYJ, joestakey, oyc_109, pedroais, peritoflores, rajatbeladiya, reassor, robee, rokinot, samruna, saneryee, sashik_eth, shenwilly, shung, simon135, sseefried, unforgiven, zer0dot, zzzitron
47.1336 USDC - $47.13
./contracts/src/PuttyV2Nft.sol L5: The import "openzeppelin/utils/Strings.sol";
is unused