Skip to content

Transfer curcuits do not update balances/nonces #4

@Van0k

Description

@Van0k

Transfer curcuits in this repository do not update accounts in the new merkle leaves. Compare curcuit code from this repository:

    // accounts updates
    new_hash_from[i] = MultiMiMC7(4,91);
    new_hash_from[i].in[0] <== pubkey[i][0];
    new_hash_from[i].in[1] <== token_balance_from[i];
    new_hash_from[i].in[2] <== nonce_from[i];
    new_hash_from[i].in[3] <== token_type_from[i] ;

to code in the original circom tutorial with a single transfer:

    // accounts updates
    component new_hash_from = MultiMiMC7(4,91);
    new_hash_from.in[0] <== pubkey_x;
    new_hash_from.in[1] <== token_balance_from-amount;
    new_hash_from.in[2] <== nonce_from+1;
    new_hash_from.in[3] <== token_type_from; 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions