This app aims to solve food controversial topics by allowing users to create voting ballots regarding controversial topics on food. Each ballot has title and description, setting ground for a topic that can be either accepted or rejected. For instance, "Does 🍍 pineapple belong in 🍕 pizza?". Users can create as many ballots as they wish (assuming they have the funds to do so), but only one vote is allowed to be cast per user. Votes can be either "accept" or "reject". After 7 days, the ballot is closed, and we have final results.
- Make sure to have MetaMask Wallet extension installed in your browser.
- In your browser, make sure to select Polygon Amoy Testnet in your
MetaMask
wallet, by clicking atMetaMask
icon, then click at the top left to chose network, and insert:
Name: Polygon Amoy Testnet New RPC URL: https://rpc-amoy.polygon.technology/ Chain ID: 80002 Currency symbol: MATIC Block Explorer URL: https://amoy.polygonscan.com/ then save.
- In order to create ballots and cast votes, make sure to have funds in your wallet. Funds can be easily and freely obtrained via this faucet. Make sure, in that page, to select
Polygon PoS (Amoy)
network, and to provide your wallet correct address inWallet Address
field.
- Go to the root folder and run:
$ npm run prod
-
Connect to the App.
-
Connect your
MetaMask
wallet in order to create ballots and cast votes.
- Install Foundry Suite and NodeJs.
- Change directory to ```forge`` directory and start local Anvil node (keep this terminal running);
$ cd forge;
$ anvil
Store any private key provided by Anvil.
-
In another terminal, but same folder, add a .env file according to
.env_template
, and set the storedprivate key
. -
In the same folder, in order to deploy
BallotsManager
contract via:
$ forge script TestDeployBallotsManagerScript --rpc-url http://127.0.0.1:8545 --broadcast;
Store deployed contract address.
-
Now, back to root directory, create a
.env.development
file following.env_template
template, providing as an env var the address from contract deployed in step above. -
Start a local instance of React by running
npm run local
. Don't forget to runnpm install
to install dependencies. -
In app tab, connect to Local RPC Anvil node using Metamask, by clicking at Metamask icon, then click at the top left to chose network, and insert:
Name: Anvil local node New RPC URL: http://127.0.0.1:8545 Chain ID: 31337 Currency symbol: GO
then save.
-
Connect to the App and start creating ballots and casting votes.
-
Connect your
MetaMask
wallet in order to create ballots and cast votes.
- At
forge
directory, simply run
$ forge test
- Pagination for User's Contracts;
- Verification when a new Ballot is created;
- Callback for updating Ballot State when Ballot finishes.