Skip to content

Commit

Permalink
fix: remove not needed buyer parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
BromeRST committed May 9, 2024
1 parent 773deac commit 05272b1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions contracts/facets/GBMFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,21 @@ contract GBMFacet is IGBM, IERC1155TokenReceiver, IERC721TokenReceiver, Modifier
/// @param _auctionID The auctionId of the auction to complete
//No change necessary for this function code, but it use overriden internal and hence need overriding too in the diamond
function buyNow(uint256 _auctionID) public {
_buyNowImplementation(_auctionID, msg.sender, msg.sender);
_buyNowImplementation(_auctionID, msg.sender);
}

/// @notice Attribute a token to a specified recipient and distribute the proceeds to the owner of this contract.
/// @param _auctionID The auctionId of the auction to complete
/// @param _recipient The address of the recipient who will receive the NFT
function buyNowFor(uint256 _auctionID, address _recipient) public {
require(_recipient != address(0), "Invalid recipient address");
_buyNowImplementation(_auctionID, msg.sender, _recipient);
_buyNowImplementation(_auctionID, _recipient);
}

/// @dev Internal function to handle the logic of buying an auction item.
/// @param _auctionID The ID of the auction.
/// @param _buyer The address of the buyer.
/// @param _recipient The address of the recipient of the NFT.
function _buyNowImplementation(uint256 _auctionID, address _buyer, address _recipient) internal {
function _buyNowImplementation(uint256 _auctionID, address _recipient) internal {
_validateAuctionExistence(_auctionID);

Auction storage a = s.auctions[_auctionID];
Expand All @@ -180,7 +179,7 @@ contract GBMFacet is IGBM, IERC1155TokenReceiver, IERC721TokenReceiver, Modifier
a.claimed = true;

// Transfer the money of the buyer to the GBM Diamond
IERC20(s.GHST).transferFrom(_buyer, address(this), ae1bnp);
IERC20(s.GHST).transferFrom(msg.sender, address(this), ae1bnp);

// Refund the highest bidder
if (a.highestBid > 0) {
Expand Down

0 comments on commit 05272b1

Please sign in to comment.