📔Create an SmartContract

For creating an SmartContract, first of all you need to login in the Minteandome SDK.

import { MinteandomeSDK } from "minteandome-sdk";

const sdk = await MinteandomeSDK.login('36ff14e1-2bd9-4563-b752-d830d6b8eb0c');

Second, you need to call the method generateSmartContract.

const sc = await sdk.generateSmartContract({
    name: 'Test SDK',
    blockchain: 4,
    standard: 'ERC-1155',
    symbol: 'SDK',
    maxNFTs: 100,
    description: 'description',
    configuration: {
        mintPrice: 10
    }
});

This will create an instance of a SmartContract, for more information about which fields you have in that model, please check SmartContract info.

As stated in Scheduler, by default this method will create an order in the Scheduler for deploying your SmartContract in the future. This is an automatic process, you don't need any extra operation. Once the SmartContract is deployed, the information will be updated.

If you want to manage the deployment of the SmartContract on your own. You can provide an extra param:

const sc = await sdk.generateSmartContract({
    name: 'Test SDK',
    blockchain: 4,
    standard: 'ERC-1155',
    symbol: 'SDK',
    maxNFTs: 100,
    description: 'description',
    configuration: {
        mintPrice: 10
    }
}, {
    selfDeployed: true
});

Take on consider that this SmartContract will not be deployed and will not be on the blockchain until you do it by yourself.

Take a look about how to deploy it.

Last updated