Program vote.aleo
Program ID
vote.aleo
Deployment transaction
Times called
1
Similar programs
Program Structure
Imports
-
Mappings
proposals
tickets
agree_votes
disagree_votes
tickets
agree_votes
disagree_votes
Structs
ProposalInfo
Records
Proposal
Ticket
Ticket
Functions
-
Transitions
propose(public ProposalInfo) -> Proposal finalize(field)
new_ticket(public field, public address) -> Ticket finalize(field)
agree(Ticket) -> () finalize(field)
disagree(Ticket) -> () finalize(field)
new_ticket(public field, public address) -> Ticket finalize(field)
agree(Ticket) -> () finalize(field)
disagree(Ticket) -> () finalize(field)
Source code (Aleo instructions)
program vote.aleo; mapping proposals: key left as field.public; value right as ProposalInfo.public; mapping tickets: key left as field.public; value right as u64.public; mapping agree_votes: key left as field.public; value right as u64.public; mapping disagree_votes: key left as field.public; value right as u64.public; struct ProposalInfo: title as field; content as field; proposer as address; record Proposal: owner as address.private; gates as u64.private; id as field.private; info as ProposalInfo.private; record Ticket: owner as address.private; gates as u64.private; pid as field.private; function propose: input r0 as ProposalInfo.public; assert_eq self.caller r0.proposer; BHP256::hash r0.title into r1; cast self.caller 0u64 r1 r0 into r2 as Proposal.record; output r2 as Proposal.record; finalize r1; finalize propose: input r0 as field.public; increment tickets[r0] by 0u64; function new_ticket: input r0 as field.public; input r1 as address.public; cast r1 0u64 r0 into r2 as Ticket.record; output r2 as Ticket.record; finalize r0; finalize new_ticket: input r0 as field.public; increment tickets[r0] by 1u64; function agree: input r0 as Ticket.record; finalize r0.pid; finalize agree: input r0 as field.public; increment agree_votes[r0] by 1u64; function disagree: input r0 as Ticket.record; finalize r0.pid; finalize disagree: input r0 as field.public; increment disagree_votes[r0] by 1u64;
Recent calls
Block height | Timestamp | Transition ID | Function call |
706537 | 2023-03-05 13:57:41 | as1dy0larmdfx0uuj4lur2aa5ltfg58hclqga8jlyyjj7gmtelzng8qr42w47 | disagree |
706408 | 2023-03-05 13:27:54 | as1r8duj3jzu3jcqcgjeg634yyemh7ve5v27c3jsywyuc6pv79qdqxqeflg5n | new_ticket |
706348 | 2023-03-05 13:14:26 | as10p73uc5m4hkl4jt9tlhrftetpsj7hhwf80qlw273q7n6c5qn7szsjhj5p5 | agree |
706222 | 2023-03-05 12:45:51 | as1nqz7902zy3l5v65j6pf596pj6qtaufpwru7f7ghczrnz4lkejuysu5rftd | new_ticket |
705827 | 2023-03-05 11:14:17 | as1y8rgdwxcq40yve90fyvnf3v0jyuqeyfedddx0xe7gzmyxvn9zvys45m359 | propose |