📌deployContract

Description

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

Parameters

blockchain

string

Takes a string 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

Expects the name of the token (ERC721)

symbol

string

Requires the symbol of the token (ERC721)

Response

Property
Type
Description

Promise<Object>

object

Returns the transaction receipt object.

Example Request and Response

Prerequisites

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

You can install NEST® SDK using either npm or yarn. Use the following commands to install NEST® 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 NEST® SDK:

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

// create a new instance of the ERC721 class
const erc721 = new ERC721();

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

    // 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

Contract deployed at 0x6e94C8C4AE6DaE35dAA4f51B448Dbbf03C70890a. Transaction hash: 0xc9824dd43296e500cdd09aecb6e0cb85eac0255bbb3505856a31a9da2b394a60

Use Cases

  • Collectibles: ERC721 tokens can be used to create unique collectible items such as digital art, trading cards, and rare items.

  • Identity verification: ERC721 tokens can be used to represent a unique identity, such as digital certificates, diplomas, and other official documents.

Last updated