krisbuote / crow

Ethereum smart contracts for staking ether on truthfulness of claims.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crow Truth Staking DApp

A decentralized application that allows the crowd to stake money on the truthfulness of claims made by the media.

Live smart contract: https://etherscan.io/address/0x3c02dac293ec087ef59ee4de0f50354b0b062dd3

--- WORK IN PROGRESS ---

Requirements

Documentation

  1. Install Ganache, truffle, node, metamask

  2. To get working full-stack template: $truffle unbox pet-shop

  3. To compile smart contracts and build the .json: $truffle compile

  4. have ganache open

  5. To launch smart contract, you will be using the javascript files in /migrations/. Adjust code for any new smart contract file names. 4.1 If your contract constructor takes arguments, place them in the deployer

  6. Initial migration of code to blockchain instance (running with Ganache): $truffle migrate

  7. If you change your smart contract code and want to update: $truffle migrate --reset // note this will reset everything

  8. interact with the smart contract from console with: $truffle console

  9. Once in console, enter $contractName.deployed().then(function(i) { app = i; }) // this should return 'undefined'

  10. Call contract functions with app.functionName(x,y,z, { from : 0x123..., value : 10 }) // {} contains metadata for the function

  11. View blockchain stuff with $web3.eth.X . $web3.eth.accounts returns account addresses in Ganache

  12. Use contractname.js in /tests/ to test the contract in action using Mocha and Chai it(...) tests

General troubleshooting

Sample Prototype

crow prototype

About

Ethereum smart contracts for staking ether on truthfulness of claims.


Languages

Language:JavaScript 94.4%Language:Solidity 4.2%Language:HTML 1.4%