EthCC Workshop

During this workshop, we will build a smart contract that handles voting with multiple users calling the contract to vote. This demo is DAO-esque, demonstrating many of features that would be used in a full DAO voting contract.

We are writing a smart contract for a group of people who love numbers! They want to be able to keep track of the group's current favorite number and vote on new favorite numbers. The contract will use a governance token to allocate votes, and will allow users to deposit tokens, withdraw tokens, vote on a new favorite number, and execute the contract to count the votes and set a new favorite number.

Steps:

  1. Download this repo
  2. Get set up
  3. Set up your editor
  4. Check out the Sway primer (optional, but recommended)
  5. Build the Asset contract
  6. Build the Fundraiser contract

Getting Started

  1. Install cargo using rustup

    Mac and Linux:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Check for correct setup:

    $ cargo --version
    cargo 1.62.0
  3. Install forc using fuelup

    Mac and Linux:

    curl --proto '=https' --tlsv1.2 -sSf \
    https://fuellabs.github.io/fuelup/fuelup-init.sh | sh
  4. Check for correct setup:

    $ forc --version
    forc 0.18.1

    if that doesn't work

    open system preferences click allow

Editor

You are welcome to use your editor of choice.