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 ---
-
Install Ganache, truffle, node, metamask
-
To get working full-stack template: $truffle unbox pet-shop
-
To compile smart contracts and build the .json: $truffle compile
-
have ganache open
-
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
-
Initial migration of code to blockchain instance (running with Ganache): $truffle migrate
-
If you change your smart contract code and want to update: $truffle migrate --reset // note this will reset everything
-
interact with the smart contract from console with: $truffle console
-
Once in console, enter $contractName.deployed().then(function(i) { app = i; }) // this should return 'undefined'
-
Call contract functions with app.functionName(x,y,z, { from : 0x123..., value : 10 }) // {} contains metadata for the function
-
View blockchain stuff with $web3.eth.X . $web3.eth.accounts returns account addresses in Ganache
-
Use contractname.js in /tests/ to test the contract in action using Mocha and Chai it(...) tests
- if making a transaction with metamask and tx nonce is mismatched from ganache network's tx nonce, reset your account in metamask: https://consensys.zendesk.com/hc/en-us/articles/360004177531-Resetting-an-Account-New-UI-