contract DigitalDollarRetainerFactory {

// **index of created contracts**
mapping (address => bool) public validContracts;
address[] public contracts;

// **useful to know the row count in contracts index**
function getContractCount()
public
view
returns(uint contractCount)
{
return contracts.length;
}

// **get all contracts**
function getDeployedContracts() public view returns (address[])
{
return contracts;
}

// **deploy a new contract**
function newDigitalDollarRetainer(address _client, address _provider, string _deliverable, string _governingLawandForum, uint256 _retainerDurationinDays, uint256 _deliverableRate, uint256 _payCap)
public
returns(address)
{
DigitalDollarRetainer c = new DigitalDollarRetainer(_client, _provider, _deliverable, _governingLawandForum, _retainerDurationinDays, _deliverableRate, _payCap);
validContracts[c] = true;
contracts.push(c);
return c;
}
}
/***************
 FACTORY CONTRACT
 ***************/
function getDeployedContracts() public view returns (address[])
{
return contracts;
}

// **get all contracts**