Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion contracts/NFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/PullPayment.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

error WithdrawTransfer();


contract NFT is ERC721, PullPayment, Ownable {
using Counters for Counters.Counter;
Expand Down Expand Up @@ -46,6 +48,10 @@ contract NFT is ERC721, PullPayment, Ownable {

/// @dev Overridden in order to make it an onlyOwner function
function withdrawPayments(address payable payee) public override onlyOwner virtual {
super.withdrawPayments(payee);
uint256 balance = address(this).balance;
(bool transferTx, ) = payee.call{value: balance}("");
if (!transferTx) {
revert WithdrawTransfer();
}
}
}