A contract packager for Ethereum and Javascript
Last updated 7 months ago by liuis .
MIT · Original npm · Tarball · package.json
$ cnpm install valve-artifactor 
SYNC missed versions from official npm registry.


This package saves contract artifacts into JSON files

const Artifactor = require("truffle-conflux-artifactor");
const artifactor = new Artifactor(__dirname);{/*...*/}); // => a promise saving MyContract.json to a given destination



  • Manages contract ABIs, binaries and deployed addresses, so you don't have to.
  • Packages up build artifacts into .json files, which can then be included in your project with a simple require.
  • Manages library addresses for linked libraries.

The artifactor can be used with truffle-conflux-contract, which provides features above and beyond web3:

  • Synchronized transactions for better control flow: transactions won't be considered finished until you're guaranteed they've been mined.
  • Promises. No more callback hell. Works well with ES6 and async/await.
  • Default values for transactions, like from address or gas.
  • Returning logs, transaction receipt and transaction hash of every synchronized transaction.


$ npm install truffle-conflux-artifactor


Here, we'll generate a .json files given a JSON object like truffle-conflux-contract-schema. This will give us a file which we can later require into other projects and contexts.

const Artifactor = require("truffle-conflux-artifactor");
const artifactor = new Artifactor(__dirname);

// See truffle-schema for more info:
const contractData = {
  contractName: "...",        // String; optional.
  abi: ...,                   // Array; required.
  metadata: "...",            // String; optional.
  bytecode: "...",            // String; optional.
  "x-some-dependency": ...    // String, Number, Object, or Array: optional.
// The file ./MyContract.json now exists, which you can
// import into your project like any other Javascript file.


Save contract data as a .json file. Returns a Promise.

  • contractData: Object. Data that represents this contract:

      contractName: "MyContract",   // String; optional. Defaults to "Contract".
      abi: ...,                     // Array; required.  Application binary interface.
      metadata: "...",              // String; optional. Contract metadata.
      bytecode: "...",              // String; optional. Contract-creation binary without resolve library links.
      deployedBytecode: "...",      // String; optional. On-chain deployed binary without resolve library links.
      sourceMap: "...",             // String; optional. Source mapping for bytecode.
      deployedSourceMap: "...",     // String; optional. Source mapping for deployedBytecode.
      source: "...",                // String; optional. Uncompiled source code for contract.
      sourcePath: "...",            // String; optional. File path for uncompiled source code.
      ast: ...,                     // Object; optional. JSON representation of contract source code, as output by compiler.
      legacyAST: ...,               // Object; optional. Legacy JSON representation of contract source code, as output by compiler.
      compiler: ...,                // Object; optional. Compiler "type" and "properties".
      networks: ...,                // Object; optional. Mapping of network ID keys to network object values (address information, links to other contract instances, and/or contract event logs).
      schemaVersion: "...",         // String; optional. Schema version used by contract object representation.
      updatedAt: "...",             // String; optional. Time contract object representation was generated/most recently updated.
      devdoc: "...",                // String; optional. Developer documentation.
      userdoc: "...",               // String; optional. User documentation.
      "x-custom-property": ...      // String, Number, Object, or Array: optional. Custom property. Keys must be prefixed with "x-".


Save many contracts to the filesystem at once. Returns a Promise.

  • contracts: Object. Keys are the contract names and the values are contractData objects, as in the save() function above:

      "MyContract": {
        "abi": ...,
        "bytecode": "..."
      "AnotherContract": {
        // ...

Running Tests

$ npm test



Current Tags

  • 0.0.1-y.4                                ...           latest (7 months ago)

2 Versions

  • 0.0.1-y.4                                ...           7 months ago
  • 0.0.1-y.1                                ...           7 months ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (8)
Dependents (0)

Copyright 2014 - 2016 © |