# deployContract

## Description

The `deployContract` function deploys an ERC20 token contract on a specified blockchain network with the given name and symbol and returns the contract.

## Parameters

| Parameter    | Type   | Description                                                                                                       |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Takes a parameter specifying the name of the blockchain network(For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `privateKey` | string | The private key of the account to sign the transaction                                                            |
| `name`       | string | The name of the ERC20 token to be deployed                                                                        |
| `symbol`     | string | The symbol of the ERC20 token to be deployed                                                                      |

## Response

|                   |        |                                         |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt 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:

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

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

// create a new instance of the ERC20 class
const erc20 = new ERC20();

// define the main function
const main = async () => {
    // call the deployContract method
    const contract = await erc20.deployContract('klay','your-private-key',"testErc20","TEST");

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

### Response

```
Contract deployed at 0xCE9d9f032587f6680A061896e28d51641a155E9B. Transaction hash: 0x0a1619c524cd447b19957c31862b6e4a397ccce03588712e28bb37619d26c86e
```

## Use Cases

* **Creating a new ERC20 token:** The primary use case for the **`deployContract`** function is to create a new ERC20 token contract on a specified blockchain network, with the specified name and symbol.
* **Custom token configuration:** The **`deployContract`** function allows for custom configuration of the ERC20 token contract, such as the total supply and decimal places.


---

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