/ vote / run.sh
run.sh
 1  #!/bin/bash
 2  # First check that Leo is installed.
 3  if ! command -v leo &> /dev/null
 4  then
 5      echo "leo is not installed."
 6      exit
 7  fi
 8  
 9  echo "
10  ###############################################################################
11  ########                                                               ########
12  ########                 STEP 1: Propose a new ballot                  ########
13  ########                                                               ########
14  ########                  ---------------------------                  ########
15  ########                  |         |  Yes  |   No  |                  ########
16  ########                  ---------------------------                  ########
17  ########                  |  Votes  |       |       |                  ########
18  ########                  ---------------------------                  ########
19  ########                                                               ########
20  ###############################################################################
21  "
22  # Run the `propose` program function
23  leo run propose "{
24    title: 2077160157502449938194577302446444field,
25    content: 1452374294790018907888397545906607852827800436field,
26    proposer: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
27  }" || exit
28  
29  echo "
30  ###############################################################################
31  ########                                                               ########
32  ########               STEP 2: Issue a new ballot ticket               ########
33  ########                                                               ########
34  ########                  ---------------------------                  ########
35  ########                  |         |  Yes  |   No  |                  ########
36  ########                  ---------------------------                  ########
37  ########                  |  Votes  |   0   |   0   |                  ########
38  ########                  ---------------------------                  ########
39  ########                                                               ########
40  ###############################################################################
41  "
42  # Run the `new_ticket` program function
43  leo run new_ticket 2264670486490520844857553240576860973319410481267184439818180411609250173817field aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px || exit
44  
45  echo "
46  ###############################################################################
47  ########                                                               ########
48  ########            STEP 3: Vote 'Yes' on the ballot ticket            ########
49  ########                                                               ########
50  ########                  ---------------------------                  ########
51  ########                  |         |  Yes  |   No  |                  ########
52  ########                  ---------------------------                  ########
53  ########                  |  Votes  |   1   |   0   |                  ########
54  ########                  ---------------------------                  ########
55  ########                                                               ########
56  ###############################################################################
57  "
58  # Run the `agree` or `disagree` program function
59  leo run agree "{
60    owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
61    pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field.private,
62    _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group.public
63  }" || exit
64  #cat ./inputs/disagree.in | xargs leo run disagree || exit