Skip to content

shreyas-badiger/OrgBlock2018

Repository files navigation

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.

About

UCI Blockathon 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published