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

Fix #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions 3.restricted-mint-multisig/imports/multisig.leo
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ program multisig.aleo {
mapping required_signatures: bool => u64;
mapping proposals: Proposal => u64;
mapping signers: address => bool;
mapping signed : Signed => bool;

struct Proposal {
program_address: address,
function_id: field,
args_hash: field,
}

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

record ticket {
owner: address,
program_address: address,
Expand Down Expand Up @@ -41,8 +47,10 @@ program multisig.aleo {

finalize sign(caller: address, proposal: Proposal) {
assert(Mapping::get(signers, caller));
Mapping::get(signed, Signed { signer: caller, proposal: proposal });
let signatures: u64 = Mapping::get_or_use(proposals, proposal, 0u64);
Mapping::set(proposals, proposal, signatures + 1u64);
Mapping::set(signed, Signed { signer: caller, proposal: proposal }, true);
}

transition add_signer(ticket_: ticket, new_signer: address) {
Expand Down
1 change: 1 addition & 0 deletions 4.kyc/src/main.leo
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ program token.aleo {
}

transition register_zpass(identity_: zpass.leo/identity.record) -> kyc {
// Check user is bigger than 17
assert(identity_.age >= 18u8);

if (identity_.nationality == 1field) {
Expand Down