[API Reference](../README.md) > [ContractWrapperFactory](../classes/ContractWrapperFactory.md)

# Class: ContractWrapperFactory

Generic class factory for all of the contract wrapper classes.

## Type parameters
#### TWrapper :  [IContractWrapper](../interfaces/IContractWrapper.md)
## Hierarchy

**ContractWrapperFactory**

↳  [StandardTokenFactoryType](StandardTokenFactoryType.md)

↳  [MintableTokenFactoryType](MintableTokenFactoryType.md)

↳  [DaoTokenFactoryType](DaoTokenFactoryType.md)

↳  [ReputationFactoryType](ReputationFactoryType.md)

↳  [IntVoteInterfaceFactoryType](IntVoteInterfaceFactoryType.md)

↳  [Auction4ReputationType](Auction4ReputationType.md)

↳  [ExternalLocking4ReputationType](ExternalLocking4ReputationType.md)

↳  [FixedReputationAllocationType](FixedReputationAllocationType.md)

↳  [GenesisProtocolFactoryType](GenesisProtocolFactoryType.md)

↳  [LockingEth4ReputationType](LockingEth4ReputationType.md)

↳  [LockingToken4ReputationType](LockingToken4ReputationType.md)

↳  [RedeemerFactoryType](RedeemerFactoryType.md)

↳  [DaoCreatorFactoryType](DaoCreatorFactoryType.md)

## Implements

* [IContractWrapperFactory](../interfaces/IContractWrapperFactory.md)<`TWrapper`>

## Index

### Constructors

* [constructor](ContractWrapperFactory.md#constructor)

### Methods

* [at](ContractWrapperFactory.md#at)
* [deployed](ContractWrapperFactory.md#deployed)
* [ensureSolidityContract](ContractWrapperFactory.md#ensureSolidityContract)
* [new](ContractWrapperFactory.md#new)
* [clearContractCache](ContractWrapperFactory.md#clearContractCache)
* [setConfigService](ContractWrapperFactory.md#setConfigService)

---

## Constructors

<a id="constructor"></a>

###  constructor

⊕ **new ContractWrapperFactory**(solidityContractName: *`string`*, wrapper: *`object`*, web3EventService: *[Web3EventService](Web3EventService.md)*): [ContractWrapperFactory](ContractWrapperFactory.md)

*Defined in [contractWrapperFactory.ts:33](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L33)*

Connstructor to create a contract wrapper factory for the given Arc contract name and wrapper class.

**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| solidityContractName | `string` |
| wrapper | `object` |  Class of the contract |
| web3EventService | [Web3EventService](Web3EventService.md) |

**Returns:** [ContractWrapperFactory](ContractWrapperFactory.md)

___

## Methods

<a id="at"></a>

###  at

▸ **at**(address: *`string`*): `Promise`<`TWrapper`>

*Defined in [contractWrapperFactory.ts:80](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L80)*

Return a wrapper around the contract, hydrated from the given address. Returns undefined if not found.

**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| address | `string` |   |

**Returns:** `Promise`<`TWrapper`>

___
<a id="deployed"></a>

###  deployed

▸ **deployed**(): `Promise`<`TWrapper`>

*Defined in [contractWrapperFactory.ts:97](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L97)*

Return a wrapper around the contract as deployed by the current version of Arc.js. Note this is usually not needed as the WrapperService provides these wrappers already hydrated. Returns undefined if not found.

**Returns:** `Promise`<`TWrapper`>

___
<a id="ensureSolidityContract"></a>

###  ensureSolidityContract

▸ **ensureSolidityContract**(): `Promise`<`any`>

*Implementation of [IContractWrapperFactory](../interfaces/IContractWrapperFactory.md).[ensureSolidityContract](../interfaces/IContractWrapperFactory.md#ensureSolidityContract)*

*Defined in [contractWrapperFactory.ts:110](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L110)*

**Returns:** `Promise`<`any`>

___
<a id="new"></a>

###  new

▸ **new**(...rest: *`Array`<`any`>*): `Promise`<`TWrapper`>

*Defined in [contractWrapperFactory.ts:51](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L51)*

Deploy a new instance of the contract and return a wrapper around it.

**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| `Rest` rest | `Array`<`any`> |  Optional arguments to the Arc contracts constructor. |

**Returns:** `Promise`<`TWrapper`>

___
<a id="clearContractCache"></a>

### `<Static>` clearContractCache

▸ **clearContractCache**(): `void`

*Defined in [contractWrapperFactory.ts:21](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L21)*

**Returns:** `void`

___
<a id="setConfigService"></a>

### `<Static>` setConfigService

▸ **setConfigService**(configService: *[IConfigService](../interfaces/IConfigService.md)*): `void`

*Defined in [contractWrapperFactory.ts:17](https://github.com/daostack/arc.js/blob/6f704389/lib/contractWrapperFactory.ts#L17)*

**Parameters:**

| Param | Type |
| ------ | ------ |
| configService | [IConfigService](../interfaces/IConfigService.md) |

**Returns:** `void`

___

