> For the complete documentation index, see [llms.txt](https://ryan-44.gitbook.io/portrait/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ryan-44.gitbook.io/portrait/portrait-sdk/collective-portraits/write/setportraithashasdelegate.md).

# setPortraitHashAsDelegate()

```typescript
/**
   * Set the Collective Portrait's hash as a delegate.
   *
   * @remarks
   * Setting the Collective Portrait's hash as a delegate will update the Collective Portrait's hash to the new hash.
   * A delegate wallet can set the Collective Portrait's hash as a delegate if the delegate wallet has the minimum number of shares required to control the Collective Portrait.
   *
   * @param {CollectivePortraitName} portraitName - The name of the Collective Portrait that the user would like to set the hash for.
   * @param {number} portraitId - The id of the Collective Portrait that the user would like to set the hash for.
   * @param {UserPortraitAddress} shareholder - The address of the shareholder that the user would like to set the hash for.
   * @param {string} hash - The new hash to set the Collective Portrait's hash to.
   * @param {number} blockNumber - The block number of the transaction that the user would like to set the hash for.
   * @param {string} signature - The signature of the transaction that the user would like to set the hash for.
   * @returns {ethers.ContractTransaction} - The transaction object of the transaction that sets the Collective Portrait's hash.
   * @beta
   * @async
   */
  setPortraitHashAsDelegate(
    portraitName: CollectivePortraitName,
    portraitId: number,
    shareholder: UserPortraitAddress,
    hash: string,
    blockNumber: number,
    signature: string,
  ): ethers.ContractTransaction {
    return this.portrait.portraitCollectiveContract.setPortraitHashAsDelegate(
      portraitName,
      portraitId,
      shareholder,
      hash,
      blockNumber,
      signature,
    );
  }
```
