Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update multisig.leo - signature problem fix #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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 @@ -6,6 +6,14 @@ program multisig.aleo {
mapping proposals: Proposal => u64;
mapping signers: address => bool;

//signed addresses
mapping signed_addresses: Signed => bool;

struct Signed {
signer: address,
proposal: Proposal
}

struct Proposal {
program_address: address,
function_id: field,
Expand Down Expand Up @@ -40,9 +48,16 @@ program multisig.aleo {
}

finalize sign(caller: address, proposal: Proposal) {

assert(Mapping::get(signers, caller));

//signed addresses
Mapping::get(signed_addresses, Signed { signer: caller, proposal: proposal });


let signatures: u64 = Mapping::get_or_use(proposals, proposal, 0u64);
Mapping::set(proposals, proposal, signatures + 1u64);
Mapping::set(signed_addresses, Signed { signer: caller, proposal: proposal }, true);
}

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