contract WalletFactory is HasNoEther, CloneFactory {
    /// @dev Pointer to a pre-deployed instance of the Wallet contract. This
    ///  deployment contains all the Wallet code.
    address public cloneWalletAddress;

    /// @notice Emitted whenever a wallet is created
    /// @param wallet The address of the wallet created
    /// @param authorizedAddress The initial authorized address of the wallet
    /// @param full `true` if the deployed wallet was a full, self
    ///  contained wallet; `false` if the wallet is a clone wallet
    event WalletCreated(address wallet, address authorizedAddress, bool full);

    constructor(address _cloneWalletAddress) public {
        cloneWalletAddress = _cloneWalletAddress;
    }

    /// @notice Sets the cloneable address in case you want to change it after
    /// @dev No checks are done to see if this is a valid cloneable wallet
    /// @param _newCloneWalletAddress the new clone source
    function setCloneWalletAddress(address _newCloneWalletAddress) public onlyOwner {
        cloneWalletAddress = _newCloneWalletAddress;
    }

    /// @notice Used to deploy a wallet clone
    /// @dev Reasonably cheap to run (~100K gas)
    /// @param _recoveryAddress the initial recovery address for the wallet
    /// @param _authorizedAddress an initial authorized address for the wallet
    /// @param _cosigner the cosigning address for the initial `_authorizedAddress`
    function deployCloneWallet(
        address _recoveryAddress,
        address _authorizedAddress,
        uint256 _cosigner
    )
        public 
    {
        address clone = createClone(cloneWalletAddress);
        CloneableWallet(clone).init(_authorizedAddress, _cosigner, _recoveryAddress);
        emit WalletCreated(clone, _authorizedAddress, false);
    }

    /// @notice Used to deploy a full wallet
    /// @dev This is potentially very gas intensive!
    /// @param _recoveryAddress The initial recovery address for the wallet
    /// @param _authorizedAddress An initial authorized address for the wallet
    /// @param _cosigner The cosigning address for the initial `_authorizedAddress`
    function deployFullWallet(
        address _recoveryAddress,
        address _authorizedAddress,
        uint256 _cosigner
    )
        public 
    {
        address full = new FullWallet(_authorizedAddress, _cosigner, _recoveryAddress);
        emit WalletCreated(full, _authorizedAddress, true);
    }
}
/// @title WalletFactory
/// @dev A contract for creating wallets. 
function setCloneWalletAddress(address _newCloneWalletAddress) public onlyOwner {
    cloneWalletAddress = _newCloneWalletAddress;
}

/// @notice Sets the cloneable address in case you want to change it after
/// @dev No checks are done to see if this is a valid cloneable wallet
/// @param _newCloneWalletAddress the new clone source