1

I have implemented a function call in truffle(web3js):

await this.token1.transferFrom(holder1, holder2, transferAmount, {from: holder1});

and now I want to get the tx hash for that specific function. Any ideas, I'm quite new with truffle so I don't really know.

2

Try this:

const response = await this.token1.transferFrom(holder1, holder2, transferAmount, {from: holder1});
const hash = response.tx;

You can print the response and see every piece of data available:

console.log(JSON.stringify(response, null, 4));

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.