1.1.3 • Published 6 years ago

contract-support v1.1.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

#ETHEREUM CONTRACT SUPPORT


##Install my package

const contractSup = require('contract-support')

###Get contract interface (abi)

contractName : name file contract, example : HelloWorld.sol

link : link to contract file

subContractName : name of contract you want to get interface

let interface = contractSup.getContractInterface(contractName, link, subContractName);

###Get contract bytecode

contractName : name file contract, example : HelloWorld.sol

link : link to contract file

subContractName : name of contract you want to get byte code

let interface = contractSup.getContractBytecode(contractName, link, subContractName);

###Get deploy data of new contract

web3Instance : instance of web3

from : address of sender

abi : abi of contract

byteCode : byte code of contract

to get web3Instance, you can use (ether-transaction) npm package, for example:

const et = require('ether-transaction')
let ts = new et.TransactionService('wss://rinkeby.infura.io/ws')
let web3Instance = ts.getWeb3Instance()
let newContractData = contractSup.getDeployData(web3Instance, from, abi, byteCode);

###Get estimate gas when deploy new contract

web3Instance : instance of web3

from : address of sender

abi : abi of contract

byteCode : byte code of contract

let gasLimit = await contractSup.getEstimateDeployGas(web3Instance, from, abi, byte)
1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago