The exercise() function does not have a require check to ensure the order has not been already exercised. This allows for the caller after passing ownerOf(uint256(orderHash) to call the exercise() multiple times if the transferFrom() fails and gain more assets (erc20 , erc721, floor tokens) from putty.
Code is using safeTransferFrom if the transfer fails the tx will revert.
Also the order get's marked as executed, and the NFT is sent to 0xdead making it impossible to exercise twice
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L389-L458
Vulnerability details
Impact
The
exercise()
function does not have a require check to ensure the order has not been already exercised. This allows for the caller after passingownerOf(uint256(orderHash)
to call theexercise()
multiple times if thetransferFrom()
fails and gain more assets (erc20 , erc721, floor tokens) from putty.Recommended Mitigation Steps
A require() is necessary