Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 3.restricted-mint-multisig/imports/multisig.leo
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ program multisig.aleo {

mapping required_signatures: bool => u64;
mapping proposals: Proposal => u64;
mapping block: ProposalSigner => bool;

struct ProposalSigner {
proposal: Proposal,
signer: address,
}

mapping signers: address => bool;

struct Proposal {
Expand Down Expand Up @@ -40,9 +47,17 @@ program multisig.aleo {
}

finalize sign(caller: address, proposal: Proposal) {
let aux: ProposalSigner = ProposalSigner {
proposal: proposal,
signer: caller,
};
let is_blocked: bool = Mapping::get_or_use(block, aux, false);
assert_eq(is_blocked, false);

assert(Mapping::get(signers, caller));
let signatures: u64 = Mapping::get_or_use(proposals, proposal, 0u64);
Mapping::set(proposals, proposal, signatures + 1u64);
Mapping::set(block, aux, true);
}

transition add_signer(ticket_: ticket, new_signer: address) {
Expand Down