Transaction hashes of a NFT

Hello!

I’m having a hard time trying to figure out how to get the transaction details after I mint an NFT.

The best scenario fo me would be to store it on the contract, right after the mint Transfer(), but as far as I know there’s no transaction details yet.

I know there are the events that can be catched on JavaScript, but I don’t want to store anything off-chain.

Second best would be to get the transaction hash using the token ID, but I can’t find anything in the ERC721 implementation linking the two.

I guess there should be a way to query the blockchain for the contract’s transactions…???
Couldn’t find it yet…

Any help is appreciated.
Thanks!

1 Like

Hi @rsodre,

Taking a step back, why do you need/want the transaction details for the NFT?
Can you explain your use case a bit more.

When you mint, you can see the transactions in Etherscan.

You could have a look at the following tutorial: Create an NFT and deploy to a public testnet, using Truffle

Hi!
It’s just for some randomization.
I understand now that transactions are stored on the log, not available to the contract, so I’m using the block hash for that purpose.
Thanks,
Roger

1 Like

Hi @rsodre,

Please note, we can’t get randomization onchain unless we use an offchain source.

Sorry to reopen the question again, I need to know whether transaction details are associated with NFT token or not?

The use-case is very simple:

  1. I have minted an NFT
  2. I want to do something with this NFT, for example transfer it to someone. The transfer requires contract id which I know and ID.

Has there ever been a real answer on this one?

We are looking to get the transaction hash as well for identification purposes.. Is it possible to get the TransactionHash from the _safemint call while in the contract function?

we can catch it in our client/web3 after the transaction but we ideally would want to process it for our needs in the contract at the time of minting..