How to use the web3-eth.givenProvider function in web3-eth

To help you get started, we’ve selected a few web3-eth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sirin-labs / crowdsale-smart-contract / scripts / crowdsale_deployer.js View on Github external
//general:
const DAY = 86400;
const OWNER = "0xcbc7efe0bf2664198176defb7f2cfbc9675dc60e";

//SirinCrowdsale constructor params:
const startTime         = 1513080000; //(Tue, 12 Dec 2017 12:00:00 GMT)
const endTime           = startTime + 14 * DAY;
const wallet            = "0x0012A1A4619bFdC0535Ab50E7c51D64d5C768d79";
const walletFounder     = "0x0012A1A4619bFdC0535Ab50E7c51D64d5C768d79";
const walletOEM         = "0x0012A1A4619bFdC0535Ab50E7c51D64d5C768d79";
const walletBounties    = "0x0012A1A4619bFdC0535Ab50E7c51D64d5C768d79";
const walletReserve     = "0x0012A1A4619bFdC0535Ab50E7c51D64d5C768d79";


var eth = new Eth(Eth.givenProvider || 'http://127.0.0.1:8545');
var SirinCrowdsaleCompiled;

processContract(process.argv[2])
    .then(deployContract());

/*
*/
async function processContract(contractFilePAth) {

    console.log("\nProcessing " + "\n----------\n" + CONTRACT_NAME + " (" + contractFilePAth + ")\n");

    var copmiled = SOLC.compile(FS.readFileSync(contractFilePAth, 'utf8'), 1)
    SirinCrowdsaleCompiled = copmiled.contracts[":" + CONTRACT_NAME];
    var bytecode = SirinCrowdsaleCompiled.bytecode
    var abi = SirinCrowdsaleCompiled.interface;
    var ctorParamsEncoded = getCtorParams();
github adibas03 / online-ethereum-abi-encoder-decoder / src / pages / index.js View on Github external
constructor(props) {
    super(props);

    try {
      if (window.ethereum) {
        this.eth = new Eth(window.ethereum);
      } else {
        this.eth = new Eth(Eth.givenProvider || "http://localhost:8545");
      }
    } catch (e) {
      this.eth = new Eth("wss://mainnet.infura.io/ws");
    }

    //Hanle binds
    this.handleActionChange = this.handleActionChange.bind(this);
    this.handleChange = this.handleChange.bind(this);

    const history = createBrowserHistory();
    const hash = history.location.hash;
    const action = hash && hash.substring(hash.indexOf("/")+1, hash.length);

    if (hash !== "#/" && allowedActions.includes(action)) {
      this.state = {
          action

web3-eth

Web3 module to interact with the Ethereum blockchain and smart contracts.

LGPL-3.0
Latest version published 17 days ago

Package Health Score

98 / 100
Full package analysis

Similar packages