# deployContract

## Description

The **`deployContract`** function deploys an ERC-1155 token contract on a specified blockchain network with a specified **`baseUri`** and returns the deployed contract.

## Parameters

| Parameter    | Type   | Description                                                                                                                                           |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Specifies the name of the blockchain network on which the contract will be deployed (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)                |
| `privateKey` | string | The private key of the account used to deploy the contract                                                                                            |
| `baseUri`    | string | The base URI for the contract metadata. This is used to retrieve additional information about the contract such as the name, symbol, and description. |

## Response

| Property          | Type   | Description                           |
| ----------------- | ------ | ------------------------------------- |
| `Promise<Object>` | object | Returns the deployed contract object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC1155 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC1155 class
const erc1155 = new ERC1155();

// define the main function
const main = async () => {
    // deploy the contract
    const contract = await erc1155.deployContract(
        'klay',
        'your-private-key',
        'baseUri',
    );

    // print the contract address and transaction hash
    console.log(`Contract deployed at ${contract.address}. Transaction hash: ${contract.deployTransaction.hash}`);
};
// call the main function
main();
```

### Response

```jsx
Contract deployed at 0xe6811ffc22D567A0267B5260211C34074e091022. Transaction hash: 0x99916877816ce81f0091a5107282b077d9f637824bf9291c355762bee4b13713
```

## Use Cases

* **Contract deployment:** The primary use case for the **`deployContract`** function is to deploy a new smart contract on a specified blockchain network, using the provided **`erc11155Abi`** and **`erc11155ByteCode`** to generate the contract code.
* **Token issuance:** The deployed contract can be used to issue new tokens on the specified blockchain network, which can be used for various purposes such as rewards, governance, or utility tokens.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/evm-chains-sdk/contracts/erc1155/deploycontract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
