Pausing capabilities sanity check approach

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:


    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        override(ERC721, ERC721Pausable, ERC721Enumerable) {
        super._beforeTokenTransfer(from, to, tokenId);


    function testingIfPaused() view public {
        require(paused(), "contract not paused");
    function runIfNotPaused() public whenNotPaused {
    function pause() public whenNotPaused onlyOwner {
    function unpause() public whenPaused onlyOwner {

is that correct way to use the ERC721pausable library? Just a sanity check more than anything else... thx

You have a couple of errors.

You don't need to include the whenPaused and whenNotPaused modifiers in these functions. They're already included in _pause and _unpause.

You also shouldn't use super._pause, just _pause (same for unpause).

Please see the code generated by Contracts Wizard for reference.