These docs are for v2.0. Click to read the latest docs for v3.0.

Create contract

This guide explains how you can create a smart contract for your NFT collection on the blockchain.

What is an NFT Contract?

An NFT contract is essentially a smart contract designed to handle NFTs on a blockchain. It governs how the NFTs are created, transferred, and interacted with. This contract holds all the necessary logic and data structures for minting new NFTs and managing their ownership.

The creation of an NFT contract is the deployment of a new smart contract on a specific blockchain. The concept of a contract can be considered as the creation of an NFT collection.

Let's start by defining your first contract. This contract will represent a collection for the NFTs. We will create a contract on the Polygon (MATIC) testnet chain.

Request Endpoint: reference

 POST /api/v2/contracts/deployments

Request Body:

ParameterDescriptionTypeRequired
nameThe name of your NFT collection/contractString
descriptionThe description of your NFT collection/contractString
imageThe image URL for your NFT collection/contract that will be displayedString
chainThis is the blockchain on which you want to create the contract onString
externalUrlThis can be any link such as a link to your website, landing page, etc.String
{
  "name": "My first collection",
  "description": "Sample description",
  "image": "https://img.freepik.com/free-vector/nft-non-fungible-token-concept-with-neon-light-effect_1017-36944.jpg",
  "chain": "MATIC",
  "externalUrl": "www.venly.io"
}

Response Body:

📘

  • Save the result.id from the response body. This is the deployment ID and it is used to check the status of the contract creation request.
  • The transactionHash that is returned is the transction that created the contract on-chain.
  • The status attribute indicates if the transaction has been mined yet.
{
    "success": true,
    "result": {
        "name": "My first collection",
        "description": "Sample description",
        "id": "4e38e929-fcbc-4a14-a801-4e768f5a1e76",
        "secretType": "MATIC",
        "symbol": "MYFICO",
        "externalUrl": "www.venly.io",
        "image": "https://img.freepik.com/free-vector/nft-non-fungible-token-concept-with-neon-light-effect_1017-36944.jpg",
        "media": [],
        "transactionHash": "0xe87906003cecfa933dcdf8d9679fa6cf7f8013ea248e818d4c15cd28fa684e32",
        "status": "PENDING",
        "storage": {
            "type": "cloud",
            "location": "https://metadata-staging.arkane.network/metadata/contracts/64260"
        },
        "contractUri": "https://metadata-staging.arkane.network/metadata/contracts/64260",
        "external_link": "www.venly.io"
    }
}

What’s Next

For more information on the metadata of an NFT contract please read Collection Info.