Skip to content

Hotfix- How to get transaction hash when deploying smart contract #225

Closed
@legiarung

Description

@legiarung

I check and see here you only return contract address.
My code:

let params = {
			name: name,
			symbol: symbol || "",
			fee_recipient: recipient || currentAddress,
			primary_sale_recipient: recipient || currentAddress,
			platform_fee_recipient: recipient || currentAddress,
			seller_fee_basis_points: fee || 0,
			platform_fee_basis_points: fee || 0,
			description: `hazbase:${currentProjectId}`
		}

contractId = await sdk.deployer.deployNFTCollection(params)
 contractId = await sdk.deployer.deployEditionDrop(params)
contractId = await sdk.deployer.deployNFTDrop(params)
contractId = await sdk.deployer.deployToken(params)

You code :

deployNFTCollection(metadata: NFTContractDeployMetadata): Promise<string>;

Issues:

When many of my users use gasless, I want to save the information for customers to pay through Openzeplin. I don't see this function returning txHash but returning address.

But I see other functions like MintToken, SendToken, ... that return txid, like below.

My code get txid :

switch (contractType) {
		case 'edition-drop':
			contract = sdk.getEditionDrop(currentContractId)
			return txid = await contract.createBatch(Array.isArray(data)? data: [data])
		case 'nft-collection':
			contract = sdk.getNFTCollection(currentContractId)
			return txid = await contract.mintBatch(Array.isArray(data)? data: [data])
		case 'nft-drop':
			contract = sdk.getNFTDrop(currentContractId)
			return txid = await contract.createBatch(Array.isArray(data)? data: [data])
		case 'token':
			contract = sdk.getToken(currentContractId)
			return txid = await contract.mintTo(params.mintto, params.amount)
		default:
			break;
	}

YouCode return txid:

mintBatch(metadata: NFTMetadataOrUri[]): Promise<TransactionResultWithId<NFTMetadataOwner>[]>;

Can you help me pay extra txID when deploying contract .
Thanks!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions