This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table, th, td { | |
| border: 1px solid #ccc; | |
| margin: 0 auto; | |
| padding:3px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import './ShowMovies.css' | |
| export class ShowMovies extends Component{ | |
| handleChange=(movie)=>{ | |
| let _movie=movie; | |
| this.props.vote(_movie) | |
| } | |
| render(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import { ratingContract } from "./EthereumSetup"; | |
| import {ShowMovies } from "./ShowMovies"; | |
| class App extends Component { | |
| constructor(props){ | |
| super(props) | |
| this.state={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Web3 from 'web3'; | |
| const web3=new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); | |
| let ratingABI=[{"constant":true,"inputs":[{"name":"movie","type":"bytes32"}],"name":"totalVotesFor","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ratingsReceived","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"movie","type":"bytes32"}],"name":"voteForMovie","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"movieList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"movieNames","type":"bytes32[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}] | |
| let ratingAddress='0x42b9991505950cc5ac38a6557d8efcdc40235de6'; | |
| web3.eth.de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| networks:{ | |
| development:{ | |
| host:"localhost", | |
| port:8545, | |
| network_id:'*' | |
| } | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Ratings = artifacts.require("./Rating.sol"); | |
| module.exports = function(deployer) { | |
| deployer.deploy(Ratings,['Star Wars', 'Avatar', 'Inception'], {gas: 6700000}); | |
| }; |
NewerOlder