What is the use of absolutePath on JSON artifact of a Smart Contract? Does this mean we need the .sol file on the same server where web3.js apis are running?

    "absolutePath": "/home/hashcode01/HashCode/Github Project/AegisCoinGitHub/contracts/BusinessAcc.sol",
    "file": "./BusinessAcc.sol",
    "id": 9,
    "nodeType": "ImportDirective",
    "scope": 720,
    "sourceUnit": 793,
    "src": "367:27:0",
    "symbolAliases": [],
    "unitAlias": ""
  • I think it's just produced as part of the build process, if you wanted to, since the JSON artifact is JSON, you could access it and display in your dapp. – GrandFleet Jan 8 at 15:15
  • Do we need those sol files mentioned in absolute path on same location where web3 apis are hosted? – Amit Modi Jan 8 at 15:55
  • don't think so, generally speaking in my experience, all you need is the path to the file, and perhaps the contract address if you are deploying to multiple networks (ropsten, kovan and/or mainnet) – GrandFleet Jan 8 at 16:40
  • 1
    It's included by default, I'm not sure why it's there, but I guess it's useful to have. – GrandFleet Jan 8 at 18:58
  • 1
    @AmitModi Some tools like Truffle, Remix or Solc will generate JSON artifacts with extra information for debuging purposes. But I do not think it is a closed format and tools can customize for it. What tool are you using that produces such format? – Ismael Jan 9 at 16:02

Your Answer

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

Browse other questions tagged or ask your own question.