Skip to content

claudiohermida/Metis-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metis workshop 05-2023

Think & Dev & Metis Workshop.

Contracts

  1. MetisSBT.sol: SBT token to allow voting and register votes in MetisVote contract

  2. Voting.sol: Voting contract with only MetisSBTs.

Diagram-part-one Diagram-part-two Diagram-part-three Diagram-part-four

Stack

  • yarn
  • Node js v18
  • Typescript
  • Hardhat

Commands

  • Install:
cd contracts && yarn
  • Compile contracts:
yarn compile
  • Deploy locally:
yarn deploy
  • Deploy to metis testnet: For this step you would need to provide your MNEMONIC inside .envrc file
export MNEMONIC='YOUR MNEMONIC'

direnv allow .envrc

And then run:

yarn deploy:network metis
  • Run Test:
yarn test
  • Run coverage:
yarn coverage
  • Generate abis:
yarn abis
yarn size

Tasks

  • Set MetisVote contrat in MetisSBT
npx hardhat set-metis-vote --address <metis-vote-address> --network metis
  • Set default token uri
npx hardhat set-default-token-uri --uri <uri> --network metis
  • Lazy mint batch
npx hardhat lazy-mint-batch --quantity -<quantity> --network metis

-- Create Election

npx hardhat create-election --position <position> --start-time <startTime> --end-time <endTime> --network metis

-- Election Info

npx hardhat election-info --election-id <electionId> --network metis

-- Set new start time election

npx hardhat set-new-start-time --election-id <electionId> --new-start-time <newStartTime> --network metis

-- Set new end time election

npx hardhat set-new-end-time --election-id <electionId> --new-end-time <newEndTime>  --network metis

-- Add candidate

npx hardhat add-candidate --election-id <electionId> --party <party> --person <person> --network metis

Dapp

Stack

  • yarn
  • Next js
  • Tailwind css

Commands

  • Run dev
yarn dev
  • Run build
yarn build
  • Run linter
yarn lint

Authors

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.9%
  • Solidity 17.9%
  • Other 1.2%