JSPM

  • Created
  • Published
  • Downloads 96
  • Score
    100M100P100Q66466F
  • License MIT

A plugin making smart contract compilation, deployment and interaction easier

Package Exports

  • contract3

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (contract3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installation

Go to the project directory and type

npm install --save easy-web3

Requirements

Tested with Node 8.0 and web3 version 1.0

Usage

` var Web3 = require('web3');

const config = { host: 'localhost', port: 8545 };

var web3 = new Web3(new Web3.providers.HttpProvider('http://'+config.host+":"+config.port));

async function deployAndTest() { const defaultAccount = await web3.eth.getCoinbase(); const contractInstances = await contracts.instance(web3, input); const AssetInstance = contractInstances['Asset']; const ContractObject = await AssetInstance.deployContract( ["table",defaultAccount,100], defaultAccount, 0); console.log(ContractObject.options.address) const result = await AssetInstance.get('getValue',[],defaultAccount); const result2 = await contracts.set(ContractObject,'set', [134],defaultAccount); if (result2) { const result = await contracts.get(ContractObject,'get',[],defaultAccount); console.log(result) } }