setLenderManager may cause some Lenders to lose their assets
If the contract's lenderManager changes, repaid assets will be sent to the old lenderManager\\nsetLenderManager is used to change the lenderManager address of the contract\\n```\\n    function setLenderManager(address _lenderManager)\\n        external\\n        reinitializer(8)\\n        onlyOwner\\n    {\\n        _setLenderManager(_lenderManager);\\n    }\\n\\n    function _setLenderManager(address _lenderManager)\\n        internal\\n        onlyInitializing\\n    {\\n        require(\\n            _lenderManager.isContract(),\\n            "LenderManager must be a contract"\\n        );\\n        lenderManager = ILenderManager(_lenderManager);\\n    }\\n```\\n\\nclaimLoanNFT will change the bid.lender to the current lenderManager\\n```\\n    function claimLoanNFT(uint256 _bidId)\\n        external\\n        acceptedLoan(_bidId, "claimLoanNFT")\\n        whenNotPaused\\n    {\\n        // Retrieve bid\\n        Bid storage bid = bids[_bidId];\\n\\n        address sender = _msgSenderForMarket(bid.marketplaceId);\\n        require(sender == bid.lender, "only lender can claim NFT");\\n        // mint an NFT with the lender manager\\n        lenderManager.registerLoan(_bidId, sender);\\n        // set lender address to the lender manager so we know to check the owner of the NFT for the true lender\\n        bid.lender = address(lenderManager);\\n    }\\n```\\n\\nIn getLoanLender, if the bid.lender is the current lenderManager, the owner of the NFT will be returned as the lender, and the repaid assets will be sent to the lender.\\n```\\n    function getLoanLender(uint256 _bidId)\\n        public\\n        view\\n        returns (address lender_)\\n    {\\n        lender_ = bids[_bidId].lender;\\n\\n        if (lender_ == address(lenderManager)) {\\n            return lenderManager.ownerOf(_bidId);\\n        }\\n    }\\n// rest of code\\n        address lender = getLoanLender(_bidId);\\n\\n        // Send payment to the lender\\n        bid.loanDetails.lendingToken.safeTransferFrom(\\n            _msgSenderForMarket(bid.marketplaceId),\\n            lender,\\n            paymentAmount\\n        );\\n```\\n\\nIf setLenderManager is called to change the lenderManager, in getLoanLender, since the bid.lender is not the current lenderManager, the old lenderManager address will be returned as the lender, and the repaid assets will be sent to the old lenderManager, resulting in the loss of the lender's assets
Consider using MAGIC_NUMBER as bid.lender in claimLoanNFT and using that MAGIC_NUMBER in getLoanLender to do the comparison.\\n```\\n// Add the line below\\n  address MAGIC_NUMBER = 0x// rest of code;\\n    function claimLoanNFT(uint256 _bidId)\\n        external\\n        acceptedLoan(_bidId, "claimLoanNFT")\\n        whenNotPaused\\n    {\\n        // Retrieve bid\\n        Bid storage bid = bids[_bidId];\\n\\n        address sender = _msgSenderForMarket(bid.marketplaceId);\\n        require(sender == bid.lender, "only lender can claim NFT");\\n        // mint an NFT with the lender manager\\n        lenderManager.registerLoan(_bidId, sender);\\n        // set lender address to the lender manager so we know to check the owner of the NFT for the true lender\\n// Remove the line below\\n       bid.lender = address(lenderManager);\\n// Add the line below\\n       bid.lender = MAGIC_NUMBER;\\n    }\\n// rest of code\\n    function getLoanLender(uint256 _bidId)\\n        public\\n        view\\n        returns (address lender_)\\n    {\\n        lender_ = bids[_bidId].lender;\\n\\n// Remove the line below\\n       if (lender_ == address(lenderManager)) {\\n// Add the line below\\n       if (lender_ == MAGIC_NUMBER) {\\n            return lenderManager.ownerOf(_bidId);\\n        }\\n    }\\n```\\n
It may cause some Lenders to lose their assets
```\\n    function setLenderManager(address _lenderManager)\\n        external\\n        reinitializer(8)\\n        onlyOwner\\n    {\\n        _setLenderManager(_lenderManager);\\n    }\\n\\n    function _setLenderManager(address _lenderManager)\\n        internal\\n        onlyInitializing\\n    {\\n        require(\\n            _lenderManager.isContract(),\\n            "LenderManager must be a contract"\\n        );\\n        lenderManager = ILenderManager(_lenderManager);\\n    }\\n```\\n