contract ERC20FixedSupply is ERC20, ERC20Detailed, ERC20Pausable, Ownable {
    constructor(
        uint256 initialSupply,
        string memory name,
        string memory symbol,
        uint8 decimals // This contract cannot be instantiated. It needs to be inherited.
    ) internal ERC20Detailed(name, symbol, decimals) {
        require(initialSupply > 0, "ERC20FixedSupply: Invalid initialSupply");
        require(bytes(name).length > 0, "ERC20FixedSupply: Token name cannot be empty");
        require(bytes(symbol).length > 0, "ERC20FixedSupply: Token symbol cannot be empty");
        _mint(_msgSender(), initialSupply);
    }

    /**
    * @notice Transfers ownership of the contract to a new account (`newOwner`).
    * Grants Pauser Role to `newOwner` and revokes Pauser Role from `old owner`.
    * @dev Overrides {Ownable.sol} to assign Pauser Role to the new owner and revoke privileges
    * from old owner (msg.sender).
    */
    function _transferOwnership(address newOwner) internal {
        super._transferOwnership(newOwner);
        _addPauser(newOwner); // Grants new owner ability to pause the contract.
        _removePauser(_msgSender()); // Revokes Pauser Role from current owner (msg.sender).
    }
}
/**
 * @title ERC20 Token with Fixed Supply.
 * @notice Total supply is defined in the contract's constructor. It won't be possible to mint more tokens.
 * @dev This contract has the following properties:
 * - Basic ERC20 functionality (https://eips.ethereum.org/EIPS/eip-20)
 * - Pausable (circuit breaker pattern) - transfers can be paused
 * - Ownable (access control pattern) - sets an owner who can pause the token.
 *   Ownership can be transfer anytime by current owner
 */
function _transferOwnership(address newOwner) internal {
    super._transferOwnership(newOwner);
    _addPauser(newOwner); // Grants new owner ability to pause the contract.
    _removePauser(_msgSender()); // Revokes Pauser Role from current owner (msg.sender).
}

/**
 * @notice Transfers ownership of the contract to a new account (`newOwner`).
 * Grants Pauser Role to `newOwner` and revokes Pauser Role from `old owner`.
 * @dev Overrides {Ownable.sol} to assign Pauser Role to the new owner and revoke privileges
 * from old owner (msg.sender).
 */