contract KeepRandomBeaconServiceUpgradeExample is KeepRandomBeaconServiceImplV1 {

    uint256 internal _newVar;

    constructor() public {
        _initialized["KeepRandomBeaconImplV2"] = true;
    }

    /**
     * @dev Example of overriding existing function.
     * Reference http://solidity.readthedocs.io/en/develop/contracts.html#inheritance
     * >Functions can be overridden by another function with the same name and the
     * same number/types of inputs.
     */
    function initialize(
        uint256 dkgContributionMargin,
        address registry
    )
        public
    {
        require(!initialized(), "Contract is already initialized.");
        require(registry != address(0), "Incorrect registry address");
        _initialized["KeepRandomBeaconImplV2"] = true;
        // Example of adding new data to the existing storage.
        _newVar = 1234;

        // silence solc warnings, it's just an example
        dkgContributionMargin;
        registry;
    }

    /**
     * @dev Example of overriding initialized function.
     */
    function initialized() public view returns (bool) {
        return _initialized["KeepRandomBeaconImplV2"];
    }

    /**
     * @dev Example of adding a new function.
     */
    function getNewVar() public view returns (uint256) {
        return _newVar;
    }

    function version() public pure returns (string memory) {
        return "V2";
    }
}
/**
 * @title KeepRandomBeaconServiceUpgradeExample
 * @dev Example version of a new implementation contract to test upgradability
 * under Keep Random Beacon proxy.
 */
function getNewVar() public view returns (uint256) {
    return _newVar;
}

/**
 * @dev Example of adding a new function.
 */