Coder Social home page Coder Social logo

crowdfund-starter's Introduction

CrowdFund

Overview

Steps

  1. Deploy contracts to ganache-cli

    a) Use the mneumonic (seed phrase) from MetaMask ganache-cli -m "<mneumonic>" (make sure to use quotes!). This will mean that the accounts provided by ganache are the same as the ones in MetaMask

    b) Once Ganache is running, inside of solidity/ run truffle deploy

    c) Make note of the addresses the contracts are deployed to (Factory: 0x1234... and Dashboard: 0x1234...)

  2. Connect MetaMask to Ganache (choose Private Network)

  3. Run client

    a) First, update client/src/constants/constants.js. Set DASHBOARD_ADDRESS and FACTORY_ADDRESS to the addresses truffle gave us above.

    b) Inside of client/ run:

    • npm install
    • npm run start
  4. Implement web3 funtionality (see // TODO: ...)

    • Get all campaigns and display them on the home page (client/src/components/Capaigns.jsx)
    • Add new campaigns on the /new page (client/src/components/newCampaign.jsx)
    • Ability to donate to campaigns (client/src/components/DonateModal.jsx)

Troubleshooting & Tips

Web3

  • Make sure to use Web3 v0.x not v1.x
  • You can access the MetaMask web3 instance via window.web3
  • Interacting with a contract might look like this:
const ContractA = window.web3.eth.contract(CONTRACT_ABI)
let ContractAInstance = ContractA.at(CONRACT_ADDRESS)
ContractA.functionA(<params>, <options>, <callback>)

Interacting With Contract

  • You can use truffle console to interact with deployed contracts for testing
  • eg: ContractA.at('<address>').funtion1(<params>)

MetaMask

  • Connect MetaMask to Private Network (ie. Ganache-cli)
  • Try switching networks if you don't see correct balances
  • Make sure Ganache display the same account addresses as you see in MetaMask

Documentation

crowdfund-starter's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.