divine-comedian / Capstone-Project

1 stars 3 forks source link

[SOL][CONTRACT] Capture log data from transaction receipt to update sale information #9

Open divine-comedian opened 1 year ago

divine-comedian commented 1 year ago

e.g.

const mintTx = await NFTContract.safeMint(recipientAddress, 'QmPrXKWKzNofkgZ236iufwxk3wt9L7hh6DUhihsfMZvpcC');
 await mintTx.wait();

    const mintTxReceipt = await provider.getTransactionReceipt(mintTx.hash)
    const mintTxLog =   mintTxReceipt.logs[0].topics[3]
    console.log(parseInt(mintTxLog));

 console.log(`my 1st NFT was minted to ${recipientAddress} with ID of ${parseInt(mintTxLog)} \n`)