Hi, small question on pausing a smart contract (NFT mint) using import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
To pause/unpause the contract I am trying to make sure I have got it right in terms of what I need to over ride so the contract owner can pause/unpause the contract when they want to:
overiding:
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
override(ERC721, ERC721Pausable, ERC721Enumerable) {
super._beforeTokenTransfer(from, to, tokenId);
}
implementing:
function testingIfPaused() view public {
require(paused(), "contract not paused");
}
function runIfNotPaused() public whenNotPaused {
}
function pause() public whenNotPaused onlyOwner {
super._pause();
}
function unpause() public whenPaused onlyOwner {
super._unpause();
}
is that correct way to use the ERC721pausable library? Just a sanity check more than anything else... thx