# deployContract

## Description

The **`deployContract`** function returns a Promise that resolves to a newly deployed ERC721 contract on the specified blockchain network.

The function takes in the blockchain type, a private key, and a base URI for the contract's metadata. The returned contract object can then be used to interact with the deployed contract on the blockchain

## Parameters

| Parameter    | Type   | Description                                                                                                               |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `privateKey` | string | Requires a private key corresponding to the account that will be used to deploy the contract.                             |
| `baseURI`    | string | Expects a string that represent the Token's base URI                                                                      |

## Response

| Property          | Type   | Description                                                            |
| ----------------- | ------ | ---------------------------------------------------------------------- |
| `Promise<Object>` | object | Returns an object containing the transaction hash and contract address |

## 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:

<br>

```sh
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:

<br>

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

// create a new instance of the SDK
const bulkNFT = new BulkNft();
// call the deployContract method
const main = async () => {
    // deploy a contract on the Polygon network
    const contract = await bulkNFT.deployContract(
        'polygon',
        'dd2cfa6243af4e467dcfe1b45402bfe2bca32acc6d27565b3791db5de1c9dd49',
        'bingo',
    );
    // print the contract address
    console.log(contract.address);
    expect(contract).toHaveProperty('address');
};
// call the main function
main();
```

### Response

```
Transaction Hash: 0xa81b67ec1e80d5d6c6c6bdc59201437a9be7174108dbfe71b6348f44645f5264, Contract Address: 0x5aAB360f4eEC9C823175711d22D7D0C920D4481a
```

### Use Cases

* **Contract deployment:** The primary use case for the **`deployContract`** function is to deploy an ERC721 contract on a specified blockchain network. This allows users to create and deploy their unique tokens on a blockchain.
* **Token metadata**: The **`deployContract`** function takes in a base URI parameter, which can be used to specify the metadata for the token contract. This can include information such as token name, description, and image, and is commonly used to provide additional context about a token.
* **Automated token deployment:** The **`deployContract`** function can be integrated into automated deployment workflows, allowing developers to automatically deploy new token contracts as part of their continuous integration and deployment process.


---

# 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/bulknft/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.
