contract Governed {
 
    address private governor;
    address public pendingGovernor;

    event newPendingOwnership(address indexed from, address indexed to);
    event newOwnership(address indexed from, address indexed to);

    /**
     * @dev Check if the caller is the governor.
     */
    modifier onlyGovernor {
        require(msg.sender == governor, "Only Governor can call");
        _;
    }

    /**
     * @dev Initialize the governor to the contract caller.
     */
    function _initialize(address _initGovernor) internal {
        governor = _initGovernor;
    }

    /**
     * @dev Admin function to begin change of governor. The `_newGovernor` must call
     * `newOwnershipAccept` to finalize the transfer.
     * @param _newGovernor Address of new `governor`
     */
    function transferOwnership(address _newGovernor) external onlyGovernor {
        require(_newGovernor != address(0), "Governor must be set");

        address oldPendingGovernor = pendingGovernor;
        pendingGovernor = _newGovernor;

        emit newPendingOwnership(oldPendingGovernor, pendingGovernor);
    }

    /**
     * @dev Admin function for pending governor to accept role and update governor.
     * This function must called by the pending governor.
     */
    function newOwnershipAccept() external {
        require(
            pendingGovernor != address(0) && msg.sender == pendingGovernor,
            "Caller must be pending governor"
        );

        address oldGovernor = governor;
        address oldPendingGovernor = pendingGovernor;

        governor = pendingGovernor;
        pendingGovernor = address(0);

        emit newOwnership(oldGovernor, governor);
        emit newPendingOwnership(oldPendingGovernor, pendingGovernor);
    }
}
/**
 * @dev All contracts that will be owned by a Governor entity should extend this contract.
 */
function _initialize(address _initGovernor) internal {
    governor = _initGovernor;
}

/**
 * @dev Initialize the governor to the contract caller.
 */