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



# Class: ContractWrapperBase


Abstract base class for all Arc contract wrapper classes

Example of how to define a wrapper:

    import { ContractWrapperBase } from "../contractWrapperBase";
    import { ContractWrapperFactory } from "../contractWrapperFactory";

    export class AbsoluteVoteWrapper extends ContractWrapperBase {
      [ wrapper properties and methods ]
    }

    export const AbsoluteVote = new ContractWrapperFactory(
     "AbsoluteVote",
     AbsoluteVoteWrapper,
     new Web3EventService());

## Hierarchy

**ContractWrapperBase**

↳  [StandardTokenWrapper](StandardTokenWrapper.md)




↳  [ReputationWrapper](ReputationWrapper.md)




↳  [IntVoteInterfaceWrapper](IntVoteInterfaceWrapper.md)




↳  [ProposalGeneratorBase](ProposalGeneratorBase.md)




↳  [RedeemerWrapper](RedeemerWrapper.md)




↳  [TokenCapGCWrapper](TokenCapGCWrapper.md)




↳  [DaoCreatorWrapper](DaoCreatorWrapper.md)








## Implements

* [IContractWrapperBase](../interfaces/IContractWrapperBase.md)

## Index

### Constructors

* [constructor](ContractWrapperBase.md#constructor)


### Properties

* [contract](ContractWrapperBase.md#contract)
* [factory](ContractWrapperBase.md#factory)
* [friendlyName](ContractWrapperBase.md#friendlyName)
* [name](ContractWrapperBase.md#name)


### Accessors

* [address](ContractWrapperBase.md#address)


### Methods

* [estimateGas](ContractWrapperBase.md#estimateGas)
* [getController](ContractWrapperBase.md#getController)
* [getParameters](ContractWrapperBase.md#getParameters)
* [getParametersArray](ContractWrapperBase.md#getParametersArray)
* [getParametersHash](ContractWrapperBase.md#getParametersHash)
* [getSchemeParametersHash](ContractWrapperBase.md#getSchemeParametersHash)
* [hydrateFromAt](ContractWrapperBase.md#hydrateFromAt)
* [hydrateFromDeployed](ContractWrapperBase.md#hydrateFromDeployed)
* [hydrateFromNew](ContractWrapperBase.md#hydrateFromNew)
* [setParameters](ContractWrapperBase.md#setParameters)



---
## Constructors
<a id="constructor"></a>


### ⊕ **new ContractWrapperBase**(solidityContract: *`any`*, web3EventService: *[Web3EventService](Web3EventService.md)*): [ContractWrapperBase](ContractWrapperBase.md)


*Defined in [contractWrapperBase.ts:62](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L62)*



ContractWrapperFactory constructs this


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| solidityContract | `any`   |  The json contract truffle artifact |
| web3EventService | [Web3EventService](Web3EventService.md)   |  - |





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

---


## Properties
<a id="contract"></a>

###  contract

**●  contract**:  *`any`* 

*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[contract](../interfaces/IContractWrapperBase.md#contract)*

*Defined in [contractWrapperBase.ts:62](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L62)*



The underlying truffle contract object. Use this to access parts of the contract that aren't accessible via the wrapper.




___

<a id="factory"></a>

### «Abstract» factory

**●  factory**:  *[IContractWrapperFactory](../interfaces/IContractWrapperFactory.md)`any`* 

*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[factory](../interfaces/IContractWrapperBase.md#factory)*

*Defined in [contractWrapperBase.ts:45](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L45)*



The wrapper factor class providing static methods `at(someAddress)`, `new()` and `deployed()`.




___

<a id="friendlyName"></a>

### «Abstract» friendlyName

**●  friendlyName**:  *`string`* 

*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[friendlyName](../interfaces/IContractWrapperBase.md#friendlyName)*

*Defined in [contractWrapperBase.ts:53](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L53)*



A more friendly name for the contract.




___

<a id="name"></a>

### «Abstract» name

**●  name**:  *`string`* 

*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[name](../interfaces/IContractWrapperBase.md#name)*

*Defined in [contractWrapperBase.ts:49](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L49)*



The name of the contract.




___


## Accessors
<a id="address"></a>

###  address


getaddress(): [Address](../#Address)

*Defined in [contractWrapperBase.ts:57](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L57)*



The address of the contract




**Returns:** [Address](../#Address)



___


## Methods
<a id="estimateGas"></a>

###  estimateGas

► **estimateGas**(func: *[ITruffleContractFunction](../interfaces/ITruffleContractFunction.md)*, params: *`Array`.<`any`>*, web3Params?: *`any`*): `Promise`.<`number`>



*Defined in [contractWrapperBase.ts:192](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L192)*



Estimate conservatively the amount of gas required to execute the given function with the given parameters. Adds 21000 to the estimate computed by web3.


**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| func | [ITruffleContractFunction](../interfaces/ITruffleContractFunction.md)  | - |   The function |
| params | `Array`.<`any`>  | - |   The parameters to send to the function |
| web3Params | `any`  |  {} |   The web3 parameters (like "from", for example). If it contains "gas"then that value is returned, effectively a no-op. |





**Returns:** `Promise`.<`number`>





___

<a id="getController"></a>

###  getController

► **getController**(avatarAddress: *[Address](../#Address)*): `Promise`.<`any`>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[getController](../interfaces/IContractWrapperBase.md#getController)*

*Defined in [contractWrapperBase.ts:178](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L178)*



Returns the controller associated with the given avatar


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| avatarAddress | [Address](../#Address)   |  - |





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





___

<a id="getParameters"></a>

###  getParameters

► **getParameters**(paramsHash: *[Hash](../#Hash)*): `Promise`.<`any`>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[getParameters](../interfaces/IContractWrapperBase.md#getParameters)*

*Defined in [contractWrapperBase.ts:142](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L142)*



Given a hash, returns the associated parameters as an object.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| paramsHash | [Hash](../#Hash)   |  - |





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





___

<a id="getParametersArray"></a>

###  getParametersArray

► **getParametersArray**(paramsHash: *[Hash](../#Hash)*): `Promise`.<`Array`.<`any`>>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[getParametersArray](../interfaces/IContractWrapperBase.md#getParametersArray)*

*Defined in [contractWrapperBase.ts:170](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L170)*



Given a hash, returns the associated parameters as an array, ordered by the order in which the parameters appear in the contract's Parameters struct.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| paramsHash | [Hash](../#Hash)   |  - |





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





___

<a id="getParametersHash"></a>

###  getParametersHash

► **getParametersHash**(params: *`any`*): `Promise`.<[Hash](../#Hash)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[getParametersHash](../interfaces/IContractWrapperBase.md#getParametersHash)*

*Defined in [contractWrapperBase.ts:152](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L152)*



Given an object containing the contract's parameters, return the hash that would be used to represent them in Arc. Note this doesn't indicate whether the parameters have been registered with the contract.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| params | `any`   |  - |





**Returns:** `Promise`.<[Hash](../#Hash)>





___

<a id="getSchemeParametersHash"></a>

###  getSchemeParametersHash

► **getSchemeParametersHash**(avatarAddress: *[Address](../#Address)*): `Promise`.<[Hash](../#Hash)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[getSchemeParametersHash](../interfaces/IContractWrapperBase.md#getSchemeParametersHash)*

*Defined in [contractWrapperBase.ts:160](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L160)*



Given an avatar address, returns the schemes parameters hash


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| avatarAddress | [Address](../#Address)   |  - |





**Returns:** `Promise`.<[Hash](../#Hash)>





___

<a id="hydrateFromAt"></a>

###  hydrateFromAt

► **hydrateFromAt**(address: *`string`*): `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[hydrateFromAt](../interfaces/IContractWrapperBase.md#hydrateFromAt)*

*Defined in [contractWrapperBase.ts:96](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L96)*



Initialize from a given address on the current network.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| address | `string`   |  of the deployed contract |





**Returns:** `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>
this or undefined if not found






___

<a id="hydrateFromDeployed"></a>

###  hydrateFromDeployed

► **hydrateFromDeployed**(): `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[hydrateFromDeployed](../interfaces/IContractWrapperBase.md#hydrateFromDeployed)*

*Defined in [contractWrapperBase.ts:114](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L114)*



Initialize as it was migrated by Arc.js on the current network.




**Returns:** `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>
this or undefined if not found






___

<a id="hydrateFromNew"></a>

###  hydrateFromNew

► **hydrateFromNew**(...rest: *`Array`.<`any`>*): `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[hydrateFromNew](../interfaces/IContractWrapperBase.md#hydrateFromNew)*

*Defined in [contractWrapperBase.ts:77](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L77)*



Initialize from a newly-migrated instance. This will migrate a new instance of the contract to the net.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| rest | `Array`.<`any`>   |  - |





**Returns:** `Promise`.<[IContractWrapperBase](../interfaces/IContractWrapperBase.md)>
this






___

<a id="setParameters"></a>

###  setParameters

► **setParameters**(...params: *`Array`.<`any`>*): `Promise`.<[ArcTransactionDataResult](ArcTransactionDataResult.md)[Hash](../#Hash)>



*Implementation of [IContractWrapperBase](../interfaces/IContractWrapperBase.md).[setParameters](../interfaces/IContractWrapperBase.md#setParameters)*

*Defined in [contractWrapperBase.ts:134](https://github.com/daostack/arc.js/blob/9063ecdf/lib/contractWrapperBase.ts#L134)*



Call setParameters on this.contract. Returns promise of ArcTransactionDataResult <hash>where Result is the parameters hash.</hash>


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| params | `Array`.<`any`>   |  -- parameters as the contract.setParameters function expects them. |





**Returns:** `Promise`.<[ArcTransactionDataResult](ArcTransactionDataResult.md)[Hash](../#Hash)>





___


