2

How are truffle artifacts different from ABI? Do Truffle artifacts include fields that are different from ABI that is generated using remix?

2 Answers 2

7

A Truffle artifact is a JSON bundle that contains a lot of useful information related to a contract like the ABI, the contract bytecode, the deployment details, compiler version, etc...

Examples:

{
  "contractName": "Migrations",
  "abi": [],
  "bytecode": "0x...",
  "sourceMap": "",
  "deployedSourceMap": "",
  "sourcePath": "/project/contracts/Migrations.sol",
  "ast": {},
  "legacyAST": {},
  "compiler": {
    "name": "solc",
    "version": "0.5.0+commit.1d4f565a.Emscripten.clang"
  },
  "networks": {
    "17": {
      "events": {},
      "links": {},
      "address": "0x42a8d8ba55faAA734Ee07eD3179047169be5419e",
      "transactionHash": "0x4e5fc578b9ea44401047fc010dd1ee20cd899b8091fe4304ce0f955dc1d4db5b"
    }
  },
  "schemaVersion": "3.0.0",
  "updatedAt": "2018-12-19T17:59:54.615Z",
  "devdoc": {},
  "userdoc": {}
}

The ABI generated by Remix and the ABI generated by Truffle (field abi) should be the exact same.

2

To add to Greg's answer, this documentation provides background on what Truffle artifact's are: https://trufflesuite.github.io/artifact-updates/background.html#what-are-artifacts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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