I have create this test:

const { expectEvent } = require('@openzeppelin/test-helpers');

const MyContract = artifacts.require('MyContract');

contract('MyContract', function (accounts) {
    const [owner] = accounts;

    beforeEach(async function () {
        this.myContract = await MyContract.new({from: owner});

    describe('construction', function () {
        let txHash = this.myContract.transactionHash


txHash contains the hash of the deployment transaction. How can i access to all transaction fields (especially "from" field)



Once you have the transaction hash, you can do this:

You can specify the network you want to debug on with the --network option:

$ truffle debug [<transaction hash>] --network <network>

Reference from: debugging-your-contracts

  • Thanks a lot but i want to do that in javascript...
    – Bob5421
    Apr 5 '21 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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