Bnke0x0
medium
the transferFrom keyword is used instead of safeTransferFrom. The sent tokens could be locked if any winner is in a contract and is unaware of incoming ERC721 tokens.
IERC721Upgradeable(collateralInfo._collateralAddress).transferFrom(
borrower,
address(this),
collateralInfo._tokenId
);
IERC721Upgradeable(_collateralAddress).transferFrom(
_msgSender(),
address(this),
_tokenId
);
IERC721Upgradeable(_collateralAddress).transferFrom(
address(this),
_recipient,
_collateral._tokenId
);
Manual Review
Consider changing transferFrom
to safeTransferFrom
. However, it could introduce a DoS attack vector if any user maliciously rejects the received ERC721 tokens to make the others unable to get their awards. Possible mitigations are to use a try/catch statement to handle error cases separately or provide a function for the pool owner to remove malicious winners manually if this happens.