1.1.2 • Published 7 years ago

deploy-monster v1.1.2

Weekly downloads
12
License
-
Repository
-
Last release
7 years ago

Codeship Status for skmgoldin/deploy-monster

SYNOPSIS

A module for deploying Ethereum smart contracts.

INSTALL

npm install deploy-monster

API

Functions

compileAndDeploy(opts: DeployOpts)

Compile and deploy a contract from the values specified in opts.

#####Returns:

An Output object.

compileAndDeployFromConfig(configPath: string)

Compile and deploy a contract from the values specified in a JSON config file.

  • configPath - An absolute or relative path from the process current working directory to a JSON config file which can be parsed as a DeployOpts object.

#####Returns:

An Output object.

Types

DeployOpts

A nested object keyed by the names (as in the Solidity contract <Name> { shared by the contracts' constructor functions) where the inner objects have the following properties:

  • file string - An absolute or relative path from the process current working directory to the contract to be compiled.
  • signingKey string
  • txParams [TxParams]
  • args Array - (optional, default [])
  • web3Provider string - (optional, default http://localhost:8545)
  • web3 object - (optional, default derived from web3Provider)

See the exampleConf, for instance.

Output

An object with the following properties:

  • name string - The name of the contract.
  • abi string - The contract's ABI.
  • address string - The address at which the contract was deployed.
  • txHash string - The transaction hash of the contract deployment.
  • bytecode string - The contract's bytecode.

TxParams

A nested object keyed by the names (as in the Solidity contract <Name> { shared by the contracts' constructor functions) where the inner objects have the following properties:

  • nonce number - (optional, default derived using web3.eth.getTransactionCount on the address of the signingKey specified in the DeployOpts) The nonce with which to send the deployment transaction.
  • gas number - (optional, default 1000000)
  • gasPrice number - (optional, default 1)
  • value number - (optional, default 0)