> For the complete documentation index, see [llms.txt](https://yuga.gitbook.io/zkyuga-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuga.gitbook.io/zkyuga-whitepaper/developer-guide/erc1155/transferownership.md).

# transferOwnership

The `transferOwnership` method is a pivotal function that allows for the transfer of contract ownership from the current owner to a new Ethereum address. Ownership of a contract often grants extensive control over the contract's operations and may include permissions like updating contract parameters, minting tokens, or pausing the contract. This method is embedded within the contract's instance, accessible through the relevant method of the `ZkyugaClient` or a corresponding library.

## Method Signature

```javascript
async transferOwnership(
    to: string,
    signer: WalletSigner
): Promise<TransactionResponse>
```

### Parameters

<table><thead><tr><th width="142">Parameter</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td>to</td><td>string</td><td>The Ethereum address that will become the new owner of the contract.</td></tr><tr><td>signer</td><td>WalletSigner</td><td>The wallet signer instance, corresponding to the current owner, responsible for signing the transfer transaction.</td></tr></tbody></table>

### Returns

* A `Promise` resolving to a `TransactionResponse`, which provides details about the ownership transfer transaction.

## Usage Example

First, instantiate the contract:

```javascript
const contractInstance = zkyugaClient.getContractInstance("your contract address here");
```

Then, use the `transferOwnership` method to transfer ownership to the desired address:

```javascript
const newOwnerAddress = "0x315cbb881Ac891D28F78FFd47A9fe6b0D5a23D86";
const signer = zkyugaClient.createWalletSigner("current owner's private key");

const ownershipTransferTransaction = await contractInstance.transferOwnership(newOwnerAddress, signer);
console.log(`Ownership Transfer Transaction Hash: ${ownershipTransferTransaction.hash}`);
```

## Notes

* The `transferOwnership` method is a powerful operation that transfers comprehensive control of the contract. Ensure the destination address (`to`) is trustworthy and capable of managing the contract responsibly.
* Always double-check the Ethereum address to which you're transferring ownership. Mistakes in this operation can lead to irreversible loss of control over the contract.

***
