1.1.2 • Published 7 years ago
deploy-monster v1.1.2
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
.
opts
- ADeployOpts
object.
#####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 aDeployOpts
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
stringtxParams
[TxParams
]args
Array - (optional, default[]
)web3Provider
string - (optional, defaulthttp://localhost:8545
)web3
object - (optional, default derived fromweb3Provider
)
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 usingweb3.eth.getTransactionCount
on the address of thesigningKey
specified in theDeployOpts
) The nonce with which to send the deployment transaction.gas
number - (optional, default1000000
)gasPrice
number - (optional, default1
)value
number - (optional, default0
)