[Ethereum] How are truffle artifacts different from ABI

dappssoliditytruffleweb3js

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

Best Answer

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.