Skip to content

Commit

Permalink
Remove masterMint address from editionDrop cli
Browse files Browse the repository at this point in the history
  • Loading branch information
RustySol committed Aug 8, 2022
1 parent 00acb6c commit 5df103b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions core/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CandyShop, CandyShopError, CandyShopErrorType } from '@liqnft/candy-shop-sdk';
import * as anchor from '@project-serum/anchor';
import { getAccount } from '@solana/spl-token';
import { PublicKey } from '@solana/web3.js';
import { Command } from 'commander';
import {
Expand Down Expand Up @@ -519,7 +520,6 @@ programCommand('settleAndDistribute')
programCommand('commitEditionDropNft')
.description('commit a master edition NFT for edition drop')
.requiredOption('-ota, --nft-owner-token-account <string>', 'NFT token account address')
.requiredOption('-mm, --master-mint <string>', 'Master mint address')
.requiredOption('-tm, --treasury-mint <string>', 'Candy Shop treasury mint')
.requiredOption('-sc, --shop-creator <string>', 'Candy Shop creator address')
.requiredOption('-p, --price <string>', 'price in token decimals')
Expand All @@ -535,7 +535,6 @@ programCommand('commitEditionDropNft')
keypair,
env,
nftOwnerTokenAccount,
masterMint,
treasuryMint,
rpcUrl,
shopCreator,
Expand Down Expand Up @@ -568,9 +567,11 @@ programCommand('commitEditionDropNft')
isEnterprise: isEnterprise ? true : false
});

const tokenAccountInfo = await getAccount(candyShop.connection(), new PublicKey(nftOwnerTokenAccount), 'finalized');

const txHash = await candyShop.commitMasterNft({
nftOwnerTokenAccount: new anchor.web3.PublicKey(nftOwnerTokenAccount),
masterMint: new anchor.web3.PublicKey(masterMint),
masterMint: tokenAccountInfo.mint,
nftOwner: wallet,
price: new anchor.BN(price),
startTime: new anchor.BN(startTime),
Expand All @@ -585,7 +586,6 @@ programCommand('commitEditionDropNft')
programCommand('mintPrint')
.description('mint an editioned NFT from the master edition')
.requiredOption('-ota, --nft-owner-token-account <string>', 'NFT token account address')
.requiredOption('-mm, --master-mint <string>', 'Master mint address')
.requiredOption('-tm, --treasury-mint <string>', 'Candy Shop treasury mint')
.requiredOption('-sc, --shop-creator <string>', 'Candy Shop creator address')
.option('-wtm, --whitelist-mint <string>', 'whitelist mint')
Expand All @@ -597,7 +597,6 @@ programCommand('mintPrint')
keypair,
env,
nftOwnerTokenAccount,
masterMint,
treasuryMint,
whitelistMint,
rpcUrl,
Expand Down Expand Up @@ -626,9 +625,11 @@ programCommand('mintPrint')
isEnterprise: isEnterprise ? true : false
});

const tokenAccountInfo = await getAccount(candyShop.connection(), new PublicKey(nftOwnerTokenAccount), 'finalized');

const txHash = await candyShop.mintNewPrint({
nftOwnerTokenAccount: new PublicKey(nftOwnerTokenAccount),
masterMint: new PublicKey(masterMint),
masterMint: tokenAccountInfo.mint,
whitelistMint: whitelistMint ? new PublicKey(whitelistMint) : undefined,
editionBuyer: wallet
});
Expand Down
2 changes: 1 addition & 1 deletion core/sdk/src/CandyShopDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export abstract class CandyShopDrop {
const [vaultAccount] = await getEditionVaultAccount(candyShop, nftOwnerTokenAccount);

const editionNumber = await generateEditionNumber(vaultAccount, connection);
console.log('editionNumber ', editionNumber.toString());

const program = this.getProgram(connection, editionBuyer);

Expand Down Expand Up @@ -177,7 +178,6 @@ async function generateEditionNumber(vaultAccount: PublicKey, connection: Connec
}
editionArray = editionArray.slice(0, vaultMaxSupply);
editionArray = editionArray.map((v, i) => (v === '1' ? '-1' : String(i + 1))).filter((i) => i !== '-1');

const edition = new BN(editionArray[Math.floor(Math.random() * editionArray.length)]);
return edition;
}

0 comments on commit 5df103b

Please sign in to comment.