1.1.3 • Published 5 years ago

contract-support v1.1.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 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

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago