GithubHelp home page GithubHelp logo

orgblock2018's Introduction

OrgBlock2018 (Crowdfunding platform)

UCI Blockathon 2018

Start truffle console

truffle console
migrate --reset

Create the app instance

OrgBlock.deployed().then(function(instance){app = instance})

Create users

Alt text

app.addUser("Organization", 0, 0, 0) [3 organizations]
app.addUser("Vendor", 0, 0, 0) [3 vendors]
app.addUser("Donor", 0, 0, 0) [4 donors]

Consider,
0 - PaymentGateway

1 - Wikimedia, 2 - Americare, 3 - Republicans

4 - AWS, 5 - Walmart, 6 - Bren Event mgmt.

7 - Batman



app.getUsers()

Simulate donation

app.addDonation(org_id, don_id, , amount, sender_address)
app.addDonation(1, 7, "Because I am batman", 5000, {from: web3.eth.accounts[3]})

fails! only PaymentGateway can create the transaction block

app.addDonation(1, 7, "Because I am batman", 5000, {from: web3.eth.accounts[0]})

transaction with id=1 created.

Participants validate the transaction block

(validity is to ensure the block integrity. v = 3. PGateway, Sender, Reciever)

app.getDonValidity( t_id )
app.getDonValidity( 1 )

transaction_id = 1, validity must be = 1

app.validateDonation(org_id, t_id)
app.validateDonation(1, 1)

Wikipedia acknowledges the transaction.

app.validateDonation(don_id, t_id)
app.validateDonation(7, 1)

Batman acknowledges the transaction.

app.getDonValidity( t_id )
app.getDonValidity( 1 )

must be 3!

Check the balance

app.getAmountRecieved( org_id )
app.getAmountRecieved( 1 )

app.getAmountRecieved( org_id )
app.getAmountRemaining( 1 )

Simulate expense

app.addExpense(org_id, vend_id, message, amount)
app.addExpense(1, 4, "Wikipedia is yet to decentralize :/ ", 2000)

Participants validate the transaction block

(validity must be 3! PGateway, Sender, Reciever)

app.validateExpense(org_id, t_id)
app.validateExpense(1, 1)

app.validateExpense(don_id, t_id)
app.validateExpense(4, 1)

app.getDonValidity( t_id )
app.getExpValidity( 1 )

must be 3!

Check the balance

app.getAmountRemaining( org_id )
app.getAmountRemaining( 1 )

Why would one join OrgBlock(Because it is a win-win! strategy)

Easy to integrate
Decentralized and automated rating for the Non-profits.
Donors are encouraged to donate (it's transparent).
Everyone in chain gets incentivized for participating.

orgblock2018's People

Contributors

shreyas-badiger avatar

Stargazers

 avatar

Watchers

 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.