solc-contract
v1.0.4-beta
Published
A basic compiler for ethereum solidity contracts
Downloads
6
Maintainers
Readme
Overview
This module is designed to make creating a contract simple. It outputs a single file containing all input contract source.
Example
This version compiles any number of given paths
const Contract = require('solc-contract')
const path = require('path')
const greeterPath = 'path/to/greeter.sol'
const contracts = new Contract()
.loadFrom(
greeterPath
)
.writeTo(path.resolve(__dirname, './output'))
.fileName('greeter.js')
.compile()
This version compiles from source
const Contract = require('solc-contract')
const path = require('path')
const fs = require('fs')
const greeterPath = 'path/to/greeter.sol'
const greeter = fs.readFileSync(greeterPath, 'utf8')
const contracts = new Contract()
.fromSources(
{
'greeter.sol': greeter
}
)
.writeTo(path.resolve(__dirname, './output'))
.fileName('greeter.js')
.compile()