The explorer is out of sync. The last synced block is 524 hours ago. Current block height: explorer: 2206528 / node: 2541178 / ref: 2492275

Program coffer_v003.aleo

Program ID
coffer_v003.aleo
Owner signature
sign1lzvy246zzmrfrqhk54c6xvavzy7zp0dahgxvqkz56kxk0slwwcq467m83vxmmhz69csduxj6wf3jv33z2lsxpda7n6zyss0fcwjyzpqvsqt8vlnqhwhfhz6k8lydp3m3tczq34g7aargtflukm8zm8ytq8qsu0etry0zvcnl22hfa2f2682zqccyf25c6yusgcrxyx5cvumscaq6juu
Times called
42
Similar programs
0
Imports
-
Mappings
wallet_exists (field -> boolean)
wallet_balances (field -> u128)
transfers (field -> TransferStatus)
registered_tokens (u64 -> TokenInfo)
Structs
WalletInfo
WalletBalanceKey
TransferStatus
TokenInfo
Records
WalletHolder
PendingTransfer
SignedTransfer
Token
Functions
-
Transitions
create_wallet3(address, address, address, u8, field) -> (WalletHolder, WalletHolder, WalletHolder) finalize(field)
create_transfer3(WalletHolder, u64, u128, address, field, field) -> (WalletHolder, PendingTransfer, PendingTransfer, PendingTransfer) finalize(field)
confirm_transfer(PendingTransfer) -> SignedTransfer finalize(field)
reject_transfer(PendingTransfer) -> SignedTransfer finalize(field)
execute_confirmed_transfer(SignedTransfer) -> (SignedTransfer, Token) finalize(field, u8, field, u128, field)
deposit(Token, u128, field) -> Token finalize(field, field, u128)
create_token(u64, u8, u128) -> () finalize(TokenInfo)
mint_private(address, u64, u128) -> Token finalize(u64)
Program Source Code (Aleo Instruction) Upload Leo source

program coffer_v003.aleo;

struct WalletInfo:
    wallet_id as field;
    holder1 as address;
    holder2 as address;
    holder3 as address;
    holder4 as address;
    holder5 as address;
    holder6 as address;
    holder7 as address;
    holder8 as address;
    holder9 as address;
    holder_count as u8;
    threshold as u8;

record WalletHolder:
    owner as address.private;
    owner_id as u8.private;
    wallet as WalletInfo.private;

record PendingTransfer:
    owner as address.private;
    transfer_id as field.private;
    creator as address.private;
    wallet as WalletInfo.private;
    token_id as u64.private;
    amount as u128.private;
    to_address as address.private;
    to_wallet_id as field.private;

record SignedTransfer:
    owner as address.private;
    transfer_id as field.private;
    creator as address.private;
    wallet as WalletInfo.private;
    token_id as u64.private;
    amount as u128.private;
    to_address as address.private;
    to_wallet_id as field.private;
    confirmed as boolean.private;

struct WalletBalanceKey:
    wallet_id as field;
    token_id as u64;

struct TransferStatus:
    confirmation_count as u8;
    rejection_count as u8;
    status as u8;

record Token:
    owner as address.private;
    amount as u128.private;
    token_id as u64.private;

struct TokenInfo:
    token_id as u64;
    max_supply as u128;
    decimals as u8;

mapping wallet_exists:
    key as field.public;
    value as boolean.public;

mapping wallet_balances:
    key as field.public;
    value as u128.public;

mapping transfers:
    key as field.public;
    value as TransferStatus.public;

mapping registered_tokens:
    key as u64.public;
    value as TokenInfo.public;

function create_wallet3:
    input r0 as address.private;
    input r1 as address.private;
    input r2 as address.private;
    input r3 as u8.private;
    input r4 as field.private;
    gt r3 0u8 into r5;
    lte r3 3u8 into r6;
    and r5 r6 into r7;
    assert.eq r7 true;
    is.neq r0 r1 into r8;
    assert.eq r8 true;
    cast r4 r0 r1 r2 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc 3u8 r3 into r9 as WalletInfo;
    cast r0 1u8 r9 into r10 as WalletHolder.record;
    cast r1 2u8 r9 into r11 as WalletHolder.record;
    cast r2 3u8 r9 into r12 as WalletHolder.record;
    async create_wallet3 r4 into r13;
    output r10 as WalletHolder.record;
    output r11 as WalletHolder.record;
    output r12 as WalletHolder.record;
    output r13 as coffer_v003.aleo/create_wallet3.future;
finalize create_wallet3:
    input r0 as field.public;
    get.or_use wallet_exists[r0] false into r1;
    not r1 into r2;
    assert.eq r2 true;
    set true into wallet_exists[r0];

function create_transfer3:
    input r0 as WalletHolder.record;
    input r1 as u64.private;
    input r2 as u128.private;
    input r3 as address.private;
    input r4 as field.private;
    input r5 as field.private;
    is.eq r0.wallet.holder_count 3u8 into r6;
    assert.eq r6 true;
    is.eq r3 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r7;
    is.eq r4 0field into r8;
    or r7 r8 into r9;
    assert.eq r9 true;
    cast r0.wallet.holder1 r5 r0.owner r0.wallet r1 r2 r3 r4 into r10 as PendingTransfer.record;
    cast r0.wallet.holder2 r5 r0.owner r0.wallet r1 r2 r3 r4 into r11 as PendingTransfer.record;
    cast r0.wallet.holder3 r5 r0.owner r0.wallet r1 r2 r3 r4 into r12 as PendingTransfer.record;
    cast r0.owner r0.owner_id r0.wallet into r13 as WalletHolder.record;
    async create_transfer3 r5 into r14;
    output r13 as WalletHolder.record;
    output r10 as PendingTransfer.record;
    output r11 as PendingTransfer.record;
    output r12 as PendingTransfer.record;
    output r14 as coffer_v003.aleo/create_transfer3.future;
finalize create_transfer3:
    input r0 as field.public;
    contains transfers[r0] into r1;
    not r1 into r2;
    assert.eq r2 true;
    cast 1u8 0u8 0u8 into r3 as TransferStatus;
    set r3 into transfers[r0];

function confirm_transfer:
    input r0 as PendingTransfer.record;
    cast r0.owner r0.transfer_id r0.creator r0.wallet r0.token_id r0.amount r0.to_address r0.to_wallet_id true into r1 as SignedTransfer.record;
    async confirm_transfer r0.transfer_id into r2;
    output r1 as SignedTransfer.record;
    output r2 as coffer_v003.aleo/confirm_transfer.future;
finalize confirm_transfer:
    input r0 as field.public;
    get transfers[r0] into r1;
    add r1.confirmation_count 1u8 into r2;
    cast r2 r1.rejection_count r1.status into r3 as TransferStatus;
    set r3 into transfers[r0];

function reject_transfer:
    input r0 as PendingTransfer.record;
    cast r0.owner r0.transfer_id r0.creator r0.wallet r0.token_id r0.amount r0.to_address r0.to_wallet_id false into r1 as SignedTransfer.record;
    async reject_transfer r0.transfer_id into r2;
    output r1 as SignedTransfer.record;
    output r2 as coffer_v003.aleo/reject_transfer.future;
finalize reject_transfer:
    input r0 as field.public;
    get transfers[r0] into r1;
    add r1.rejection_count 1u8 into r2;
    cast r1.confirmation_count r2 r1.status into r3 as TransferStatus;
    set r3 into transfers[r0];

function execute_confirmed_transfer:
    input r0 as SignedTransfer.record;
    is.eq r0.to_wallet_id 0field into r1;
    is.eq r0.to_address aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r2;
    or r1 r2 into r3;
    assert.eq r3 true;
    is.eq r0.to_wallet_id 0field into r4;
    ternary r4 r0.amount 0u128 into r5;
    cast r0.to_address r5 r0.token_id into r6 as Token.record;
    is.eq r0.to_wallet_id 0field into r7;
    cast r0.to_wallet_id r6.token_id into r8 as WalletBalanceKey;
    hash.bhp256 r8 into r9 as field;
    ternary r7 0field r9 into r10;
    cast r0.owner r0.transfer_id r0.creator r0.wallet r0.token_id r0.amount r0.to_address r0.to_wallet_id r0.confirmed into r11 as SignedTransfer.record;
    cast r0.wallet.wallet_id r6.token_id into r12 as WalletBalanceKey;
    hash.bhp256 r12 into r13 as field;
    async execute_confirmed_transfer r0.transfer_id r0.wallet.threshold r13 r0.amount r10 into r14;
    output r11 as SignedTransfer.record;
    output r6 as Token.record;
    output r14 as coffer_v003.aleo/execute_confirmed_transfer.future;
finalize execute_confirmed_transfer:
    input r0 as field.public;
    input r1 as u8.public;
    input r2 as field.public;
    input r3 as u128.public;
    input r4 as field.public;
    get transfers[r0] into r5;
    is.eq r5.status 0u8 into r6;
    assert.eq r6 true;
    gte r5.confirmation_count r1 into r7;
    assert.eq r7 true;
    get wallet_balances[r2] into r8;
    sub r8 r3 into r9;
    set r9 into wallet_balances[r2];
    is.eq r4 0field into r10;
    get.or_use wallet_balances[r4] 0u128 into r11;
    add r11 r3 into r12;
    set r12 into wallet_balances[r4];
    cast r5.confirmation_count r5.rejection_count 1u8 into r13 as TransferStatus;
    set r13 into transfers[r0];

function deposit:
    input r0 as Token.record;
    input r1 as u128.private;
    input r2 as field.private;
    sub r0.amount r1 into r3;
    cast r0.owner r3 r0.token_id into r4 as Token.record;
    cast r2 r0.token_id into r5 as WalletBalanceKey;
    hash.bhp256 r5 into r6 as field;
    async deposit r2 r6 r1 into r7;
    output r4 as Token.record;
    output r7 as coffer_v003.aleo/deposit.future;
finalize deposit:
    input r0 as field.public;
    input r1 as field.public;
    input r2 as u128.public;
    contains wallet_exists[r0] into r3;
    assert.eq r3 true;
    get.or_use wallet_balances[r1] 0u128 into r4;
    add r4 r2 into r5;
    set r5 into wallet_balances[r1];

function create_token:
    input r0 as u64.private;
    input r1 as u8.private;
    input r2 as u128.private;
    cast r0 r2 r1 into r3 as TokenInfo;
    async create_token r3 into r4;
    output r4 as coffer_v003.aleo/create_token.future;
finalize create_token:
    input r0 as TokenInfo.public;
    contains registered_tokens[r0.token_id] into r1;
    not r1 into r2;
    assert.eq r2 true;
    set r0 into registered_tokens[r0.token_id];

function mint_private:
    input r0 as address.private;
    input r1 as u64.private;
    input r2 as u128.private;
    pow 10u128 6u8 into r3;
    mul 1000u128 r3 into r4;
    lte r2 r4 into r5;
    assert.eq r5 true;
    cast r0 r2 r1 into r6 as Token.record;
    async mint_private r1 into r7;
    output r6 as Token.record;
    output r7 as coffer_v003.aleo/mint_private.future;
finalize mint_private:
    input r0 as u64.public;
    get registered_tokens[r0] into r1;

Block heightTimestampTransition IDFunction callState
1,210,9642024-01-19 17:17:33au1eyaaxh8rfw5p6lwvk7fz8h8ylgvjlz6dz7keeujldwzekw2n6grqk8lt7rexecute_confirmed_transferAccepted
1,210,9522024-01-19 17:14:51au10mhm5nju4dw7w58dpl53f987xm3v4y3s0xgu59stxdkpa0rwrvqsymdsjqconfirm_transferAccepted
1,210,9412024-01-19 17:12:28au1yyttc4l8qrmysjh2qtqplu2g2mhdjephl6nt0glwrdw8us3essqsfeq4guconfirm_transferAccepted
1,210,9302024-01-19 17:09:55au17mcev55rdfyngxxpjqw3wmyd2yf8japv8mpnryc0s3sn9edqssysw3hfaecreate_transfer3Accepted
1,210,7712024-01-19 16:32:49au1473w67vnzcqlfgy7mnkjfass4hezn5yyrwa9xvkqf4whklsmhu8s3ta3p3execute_confirmed_transferRejected
1,210,7572024-01-19 16:29:37au1cmlpksush2huf795ux3zfea2rtxqqwkv0f9vt3t6d7rqzkql0upsp8gatdexecute_confirmed_transferAccepted
1,210,7382024-01-19 16:25:24au12yqqzq70y93509k4amm8v6vy3c5nrmwpsgy24kterjdva0g2rvrsah7vyvconfirm_transferAccepted
1,210,7282024-01-19 16:23:11au1eta2gx9pnnw7qpxejjsn59anxqpptna4xyhff2fyqar2ksgn4uyqrsdnddconfirm_transferAccepted
1,210,7182024-01-19 16:21:08au1pf00qx7ux46m207pkd4evt4cfrxen5jkvk6d7vuhvr38gngrsvpsx9fv9screate_transfer3Accepted
1,210,6942024-01-19 16:15:42au15c4xx7qlfk4s9hwrdr8y54w2stwa63ngg6lsdgk5ssq5k2qyf58qxurvpadepositAccepted
1,210,6542024-01-19 16:06:15au19e3cyqqwj9383lkdtj0v62vxjgj5ty33v84qkc7weqfrlevfgc8sdgcn3tmint_privateAccepted
1,210,6492024-01-19 16:05:10au1wkp92mlrclwm8zrtdwscr089nev49a97u6dpxnr9e76ccqzhh5rs75ghtccreate_wallet3Accepted
1,208,4302024-01-19 07:28:27au1kmgqsd4reqtgmx8tve6mfyve7fkve6dnrgd4n8c89qtmtatz4cxshpv6nuexecute_confirmed_transferRejected
1,205,7322024-01-18 21:14:04au17as8x8hnunyxrg4cp58tzx3p8yuwu54qfhcaaz3w5q3fwmc4hcysknd8k5confirm_transferAccepted
1,205,7182024-01-18 21:11:00au1teg0uerzw5ld5uc3v8x7c4f8vgrctnu8729896v595z9r88heyrq4x2qmncreate_transfer3Accepted
1,205,7012024-01-18 21:07:18au15gy32y0wpdr0caxgtun53s6gq3rln4d443u0fnm0rpet5r4x95gsczfr6qconfirm_transferAccepted
1,205,6822024-01-18 21:02:36au1cvs8gwppqs9sjzpz5vg9l2qzkqhlklywh3y4ay4gtkf4ygztqsrqzzrdjmconfirm_transferAccepted
1,205,5712024-01-18 20:37:19au1yzwh6re2agyxwzqk3gwrs6gt0sypq7ucn2a6xn69ukstqkvjqszqved8mycreate_transfer3Accepted
1,205,5002024-01-18 20:21:10au1uvrz00jenhe88mjyja0ggc7z2hwtlvrj27ajlv4tz2v40pvxds8stz058gdepositAccepted
1,204,3502024-01-18 16:00:14au12lfk53yl2me5sfv203zvth8tf2rqdszv2hzkd4a7kg9rze725uxqr80tz4mint_privateAccepted
1,204,3462024-01-18 15:59:14au17qn97z68qt5c4d8txg7t0vy3wxtujsfsw0kdhy90lvgdqrfcxvzskxg4vsmint_privateAccepted
1,204,3222024-01-18 15:53:47au1dx4ne80ywpf9xml0cupf260cd2786avhj7zltysepgzjuutx4qrq9a986ccreate_tokenAccepted
1,204,2452024-01-18 15:36:15au1xanxc7duwd5lqgme50hgrp7tejngturkwfnqrl3d3nmy6yzfguyqhjj60zcreate_wallet3Accepted
1,202,7362024-01-18 09:51:09au184pa6qnuyn8uax3nxvgpwzn372fjnaqgqdr0jrh0x0aw33cl05ysukgs9wcreate_transfer3Accepted
1,189,7552024-01-16 08:58:44au1dmnxawa5eqc5hcwa2f5vyj3wm2yjegfdt5mymy3wklj9r2cwxy9sz7g6r2create_wallet3Accepted
1,021,4122023-12-22 17:37:33au12g8hc273n0wg8hdw52rjgknrl63pvgxt5c8cfpkcn2t02s52juxsxsesghcreate_wallet3Accepted
1,013,6072023-12-21 15:37:20au1ans5xc3xds7nngeen6gnz54ug5sjc70733x3xd24z8sm7k29gu8q47kjeaconfirm_transferAccepted
1,013,2762023-12-21 14:32:48au1vycdsey8xguxszmtquv4tjsdyv6xa5dyetxddf7d5nve023m3ugsmfqmfhcreate_transfer3Accepted
1,013,1282023-12-21 14:03:57au1mnh62259h76jvuvwr26wy8v2v4vt9hn7lnesym8zpk5lk6ek8cps52wkp6create_wallet3Accepted
1,012,3422023-12-21 11:31:25au1w69ddetrc58psyz28fd3rqfcx2r279jny00vylmplv67fhs4hyrsgaqg2ycreate_transfer3Accepted








Not implemented