Snippets

chromawallet rell question

Created by Riccardo Sibani
class foo {
    pubkey;
}

class bar {
    foo;
    mutable counter: integer;
}

operation hello_world(){
    print("HELLO");
}

operation create_bar(pubkey) {
    create foo(pubkey);
    create bar(foo@{pubkey}, counter = 0);
}

//// OPTION 1
operation update_bar(foo: pubkey) {
    update bar@{
        foo@{pubkey = foo}
    } (
        counter = 1
    );
}

//// OPTION 2
operation update_bar(foo_p: pubkey) {
    update bar@{
        foo@{pubkey = foo_p}
    } (
        counter = 1
    );
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.