📌deployContract

Description

The deployContract function is used to deploy a Soulbound contract on a specified blockchain network.

Parameters

NameTypeDescription

blockchain

string

The blockchain network on which the contract will be deployed.

privateKey

string

The private key of the wallet used to deploy the contract.

name

string

The name of the Soulbound contract to be deployed.

symbol

string

The symbol of the Soulbound contract to be deployed.

Response

NameTypeDescription

code

number

A code indicating the success or failure of the function. 1 indicates success, while 0 indicates failure.

contract

object

An object containing information about the deployed contract, including the contract address and transaction hash.

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:

const {SOULBOUND} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const soul = new SOULBOUND();
const privateKey = "your private key here"

const main = async () => {
    // deploy soulbound contract
    const contract = await soul.deployContract(
        'optimism',
        privateKey,
        "SulBoundbyHarshInSDK",
        "SDDK");
    // print contract address
    console.log(contract.address);
}
main()

Response

Contract deployed at 0xe6811ffc22D567A0267B5260211C34074e091022. Transaction hash: 0x99916877816ce81f0091a5107282b077d9f637824bf9291c355762bee4b13713

Use Cases

  • NFT marketplaces: They can use this function to deploy Soulbound contracts for their non-fungible tokens, which can restrict their transfer to only certain whitelisted addresses.

  • Gaming: Companies can use this function to deploy Soulbound contracts for in-game assets, which can restrict their transfer to only certain authorized players.

Last updated