Skip to content

Instantly share code, notes, and snippets.

View akshar07's full-sized avatar

Akshar Takle akshar07

View GitHub Profile
table, th, td {
border: 1px solid #ccc;
margin: 0 auto;
padding:3px;
}
import React, { Component } from 'react';
import './ShowMovies.css'
export class ShowMovies extends Component{
handleChange=(movie)=>{
let _movie=movie;
this.props.vote(_movie)
}
render(){
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={
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
module.exports = {
networks:{
development:{
host:"localhost",
port:8545,
network_id:'*'
}
}
};
var Ratings = artifacts.require("./Rating.sol");
module.exports = function(deployer) {
deployer.deploy(Ratings,['Star Wars', 'Avatar', 'Inception'], {gas: 6700000});
};