Git Product home page Git Product logo

fundsplitter_web3jsraw's Introduction

fundsplitter_web3jsraw

Sample DApp to illustrate how to use web3js-raw package to interact with a Smart Contract.

Primary Infrastructrure Setup

  • Install and setup Browserify

  • Create accounts and get ether

    • https://metamask.io/
    • Create few accounts and identify one account as the primary account (Acc: PRIMARY_ACC, Private Key:PRIMARY_ACC_PVTKEY)
    • Use Ether faucet https://faucet.metamask.io/ to get Ether for the PRIMARY_ACC
    • Assign the PRIMARY_ACC to CONTRACT_OWNER in fund_splitter_dapp.js
    • Assign the PRIMARY_ACC_PVTKEY to PVT_KEY in fund_splitter_dapp.js
  • Setup application from source

    git clone https://github.com/fidenz-chim/fundsplitter_web3jsraw.git
    npm install
    
  • Create an account in infura.io

    • Obtain the token ans assign that to INFURAIO_TOKEN in fund_splitter_dapp.js
  • Bundle all Javascript so you could run this app locally from browser (withot a web server)

    • browserify fund_splitter_dapp.js -o main.js
  • Open index.html project folder

How to use the app

  • To interact with already diployed contract
    • Members->Get Count => Number of members in the contract

    • Members->Get Member At => Return address of the member for the list index specified above

    • Members->Add New => Specify a new member address to add that member to list (only contract owner could do this) (increase the Members Count)

    • Funds->Get Count => Number of undistributed funds in the contract

    • Funds->Get Fund At => Return amount in Wei of the fund for the list index specified above

    • Funds->Add Funds => Add new funds entry to the contract (increase the Funds Count)

    • Disperse Funds => distribute funds eaqually to members in the list. Any remainder will be added to contract's balance

fundsplitter_web3jsraw's People

Contributors

fidenz-chim avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.