Module ethcontract_generate::source[][src]

Expand description

Allows loading serialized artifacts from various sources.

This module does not provide means for parsing artifacts. For that, use facilities in ethcontract_common::artifact.

Examples

Load artifact from local file:

let json = Source::local("build/contracts/IERC20.json")
    .artifact_json()
    .expect("failed to load an artifact");

Load artifact from an NPM package:

let json = Source::npm("npm:@openzeppelin/contracts@2.5.0/build/contracts/IERC20.json")
    .artifact_json()
    .expect("failed to load an artifact");

Enums

A source of an artifact JSON.