Recommendation: use transfer function for transferring owners fee.
L02 - withdraw() may run out of gas if contracts code of underliying assets would changed in future
Internal functions that withdraw assets _transferERC20sOut, _transferERC721sOut, _transferFloorsOut could only run through all transferring assets in one cycle. If some contracts of transferring assets were updated in future and their transfer would cost more gas, this could lead to inability to withdraw user assets.
Recommendation:
Add functionality that allows withdrawing specific assets apart from a batch.
L03 - msg.value could be locked
fillOrder() and exercise() functions should check if msg.value == 0 in case if order.baseAsset != weth. Otherwise user's ether could stuck on contract.
If the wrong address was used to transfer ownership (for which the private key is unknown) by accident, then it permanently prevents all onlyOwner() functions from being used, including changing various critical parameters.
L01 - Malicious owner() could block withdraw
Transfer of
feeAmount
inwithdraw()
function could be reverted by malicious contract onowner
address, which would lead to withdrawing block:Recommendation: use
transfer
function for transferring owners fee.L02 - withdraw() may run out of gas if contracts code of underliying assets would changed in future
Internal functions that withdraw assets
_transferERC20sOut
,_transferERC721sOut
,_transferFloorsOut
could only run through all transferring assets in one cycle. If some contracts of transferring assets were updated in future and their transfer would cost more gas, this could lead to inability to withdraw user assets.Recommendation: Add functionality that allows withdrawing specific assets apart from a batch.
L03 -
msg.value
could be lockedfillOrder()
andexercise()
functions should check ifmsg.value
== 0 in case iforder.baseAsset != weth
. Otherwise user's ether could stuck on contract.N01 - Missing two-step changing ownership procedure
If the wrong address was used to transfer ownership (for which the private key is unknown) by accident, then it permanently prevents all
onlyOwner()
functions from being used, including changing various critical parameters.N02 - Not used import
https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2Nft.sol#L5
N03 - Missing NatSpec
All functions in PuttyV2Nft.sol