Submitted by Jeiwan, also found by Koolex, Ruhum, and rotcivegaf
Users will lose collateral NFTs when they are transferred to PaprController by an approved address or an operator.
The PaprController allows users to deposit NFTs as collateral to borrow Papr tokens. One way of depositing is by transferring an NFT to the contract directly via a call to safeTransferFrom: the contract implements the onERC721Received hook that will handle accounting of the transferred NFT (PaprController.sol#L159). However, the hook implementation uses a wrong argument to identify token owner: the first argument, which is used by the contract to identify token owner, is the address of the safeTransferFrom function caller, which may be an approved address or an operator. The actual owner address is the second argument (ERC721.sol#L436):
Thus, when an NFT is sent by an approved address or an operator, itll be deposited to the vault of the approved address or operator:
Consider this change:
wilsoncusack (Backed) confirmed
