ton-blockchain / token-contract

Fungible, Non-Fungible, Semi-Fungible Tokens Smart Contracts
Other
299 stars 158 forks source link

Fail with generating upgradable NFTs #4

Open sepezho opened 2 years ago

sepezho commented 2 years ago

So, as i understand i should use nft-item-editable-DRAFT.fc contract for minting editable NFTs. After setup everything and compile this code i had "B5EE9C724102****00CB5C98" HEX output. When i tried to create NFT collection with this contract and mint NFTs via this stuff i get just kinda broken tokens. If i will go to the testnet.tonscan.org and find those addresses i will see just not initialized contracts

Code that i use to create nft collection:

const nftCollection = new NftCollection(tonweb.provider, {
ownerAddress: walletAddress,
royalty: 0.05,
royaltyAddress: rwalletAddress,
collectionContentUri: "https://gateway.pinata.cloud/ipfs/QmcdLkYQAUTnwvN1*******ByQVs",
nftItemContentBaseUri: "https://gateway.pinata.cloud/ipfs/QmWpqAmKt3zkejfrUBFBT******HLy/",
nftItemCodeHex: "B5EE9C724102********00CB5C98",
});

Code for NFTs mint:

const item = await nftCollection.createMintBody({
    amount,
    itemIndex: itemNumber,
    itemOwnerAddress: wallet2add,
    itemContentUri: metaHash,
});

const nftCollectionAddress = await nftCollection.getAddress();

console.log(
    await wallet.methods
        .transfer({
            secretKey: mintSecretKey,
            toAddress: nftCollectionAddress.toString(true, true, true),
            amount: amount,
            seqno: seqno,
            payload: item,
            sendMode: 3,
        })
        .send()
);