Skip to content

Commit

Permalink
Resolved issue iiitl#3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dishant-garg committed Mar 16, 2024
1 parent 9e64e07 commit 63de5f0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contracts/Contract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ contract Contract {

function bought(uint256 _nftID, uint256 _tokenID) public payable onlyBuyer(_nftID) {
require(msg.value == purchasePrice[_nftID], "Incorrect purchase price");

address payable userAddress = payable(address(this));
address payable userAddress = payable(seller);
userAddress.transfer(msg.value);
(bool success, ) = seller.call{value: msg.value}("");
require(success, "Payment failed");
(bool success, ) = userAddress.call{value: address(this).balance}("");
require(success,"Transfer failed.");
isListed[_nftID] = false;
IERC721(nftaddress).transferFrom(address(this), buyer[_nftID], _tokenID);
}
Expand Down

0 comments on commit 63de5f0

Please sign in to comment.