contract Minter is Ownable {
    address payable public mintingowner;
    address payable internal newMintingOwner;

    event MintingOwnershipTransferred(address indexed _from, address indexed _to);

    constructor() {
        mintingowner = payable(msg.sender);
        emit MintingOwnershipTransferred(address(0), mintingowner);
    }

    modifier onlyMintingOwner {
        require(msg.sender == mintingowner);
        _;
    }

    function transferMintingOwnership(address payable _newMintingOwner) public onlyOwner {
        newMintingOwner = _newMintingOwner;
    }

    //this flow is to prevent transferring ownership to wrong wallet by mistake
    function acceptMintingOwnership() public {
        require(msg.sender == newMintingOwner);
        emit MintingOwnershipTransferred(mintingowner, newMintingOwner);
        mintingowner = newMintingOwner;
        newMintingOwner = payable(address(0));
    }
}
/*
 SPDX-License-Identifier: MIT
 */
function acceptMintingOwnership() public {
    require(msg.sender == newMintingOwner);
    emit MintingOwnershipTransferred(mintingowner, newMintingOwner);
    mintingowner = newMintingOwner;
    newMintingOwner = payable(address(0));
}

//this flow is to prevent transferring ownership to wrong wallet by mistake