mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
[FunC] Make all functions impure by default, add "pure" specifier
This commit is contained in:
parent
a3e9e03019
commit
85c60d1263
61 changed files with 3511 additions and 3500 deletions
|
@ -33,7 +33,8 @@
|
|||
|
||||
|
||||
// (April 2024) tact hashes changed, because '__tact_address_eq()' is now inlined as a wrapper
|
||||
["tact-examples/treasure_Treasure.code.fc", 74579212939836529446778705921340099196942507859825095056546203678047252921894]
|
||||
["tact-examples/jetton_SampleJetton.code.fc", 90109697379313597998231209537203822165325184678797680193687781490465875320451]
|
||||
["tact-examples/jetton_JettonDefaultWallet.code.fc", 40972091374757565863193840427121230466303309310521439431197914284004190565629]
|
||||
["tact-examples/maps_MapTestContract.code.fc", 22556550222249123835909180266811414538971143565993192846012583552876721649744]
|
||||
// (May 2024) tact hashes changed, because '__tact_verify_address()' wasn't marked 'impure', its calls were optimized out, but now all functions are impure by default
|
||||
["tact-examples/treasure_Treasure.code.fc", 30910931405335759315065032463773878427855191049444026038533177550379770294016]
|
||||
["tact-examples/jetton_SampleJetton.code.fc", 113366726152288202116967819512003292371082270049030855507946195024152087708689]
|
||||
["tact-examples/jetton_JettonDefaultWallet.code.fc", 51854826936807357767718095298932278700078280434421329524498524733409271908380]
|
||||
["tact-examples/maps_MapTestContract.code.fc", 86004071444084135394990759334664637743689750108042267324839281046456545168857]
|
||||
|
|
|
@ -1,209 +1,209 @@
|
|||
// Standard library for funC
|
||||
//
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
// () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
// () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
// (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
// int preload_int(slice s, int len) asm "PLDIX";
|
||||
// int preload_uint(slice s, int len) asm "PLDUX";
|
||||
// (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
// slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
// (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
// int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
// int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
// (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
// slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
// builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
// builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
// builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
// builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
|
|
|
@ -1,208 +1,208 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
() save_data(cell content, cell nft_item_code) impure inline {
|
||||
() save_data(cell content, cell nft_item_code) inline {
|
||||
set_data(begin_cell()
|
||||
.store_ref(content)
|
||||
.store_ref(nft_item_code)
|
||||
|
@ -39,7 +39,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|||
.begin_parse();
|
||||
}
|
||||
|
||||
() deploy_nft_item(int item_index, cell nft_item_code, cell nft_content) impure {
|
||||
() deploy_nft_item(int item_index, cell nft_item_code, cell nft_content) {
|
||||
cell state_init = calculate_nft_item_state_init(item_index, nft_item_code);
|
||||
slice nft_address = calculate_nft_item_address(workchain(), state_init);
|
||||
var msg = begin_cell()
|
||||
|
@ -52,7 +52,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|||
send_raw_message(msg.end_cell(), 64); ;; carry all the remaining value of the inbound message, fee deducted from amount
|
||||
}
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) {
|
||||
if (in_msg_body.slice_empty?()) { ;; bounce back empty messages
|
||||
throw(0xffff);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
int workchain() asm "0 PUSHINT";
|
||||
|
||||
() force_chain(slice addr) impure {
|
||||
() force_chain(slice addr) {
|
||||
(int wc, _) = parse_std_addr(addr);
|
||||
throw_unless(333, wc == workchain());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,216 +1,216 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
#include "stdlib.fc";
|
||||
|
||||
(slice, cell) loadDict(slice s) { return load_dict(s); }
|
||||
(slice, int) loadGrams(slice s) { return load_grams(s); }
|
||||
(slice, int) loadUint(slice s, int len) { return load_uint(s, len); }
|
||||
() endParse(slice s) impure { return end_parse(s); }
|
||||
builder storeDict(builder b, cell c) { return store_dict(b, c); }
|
||||
builder storeUint(builder b, int x, int len) { return store_uint(b, x, len); }
|
||||
() throwUnless(int excno, int cond) impure { return throw_unless(excno, cond); }
|
||||
cell configParam(int paramNo) { return config_param(paramNo); }
|
||||
forall X -> int isNull(X x) { return null?(x); }
|
||||
(slice, int) tryUDictGet(cell dict, int keyLen, int index) { return udict_get?(dict, keyLen, index); }
|
||||
(slice, cell) loadDict(slice s) pure { return load_dict(s); }
|
||||
(slice, int) loadGrams(slice s) pure { return load_grams(s); }
|
||||
(slice, int) loadUint(slice s, int len) pure { return load_uint(s, len); }
|
||||
() endParse(slice s) { return end_parse(s); }
|
||||
builder storeDict(builder b, cell c) pure { return store_dict(b, c); }
|
||||
builder storeUint(builder b, int x, int len) pure { return store_uint(b, x, len); }
|
||||
() throwUnless(int excno, int cond) { return throw_unless(excno, cond); }
|
||||
cell configParam(int paramNo) pure { return config_param(paramNo); }
|
||||
forall X -> int isNull(X x) pure { return null?(x); }
|
||||
(slice, int) tryUDictGet(cell dict, int keyLen, int index) pure { return udict_get?(dict, keyLen, index); }
|
||||
|
||||
|
||||
;; cur_elect credits past_elections grams active_id active_hash
|
||||
|
@ -23,7 +23,7 @@ forall X -> int isNull(X x) { return null?(x); }
|
|||
}
|
||||
|
||||
;; cur_elect credits past_elections grams active_id active_hash
|
||||
() store_data(elect, credits, past_elections, grams, active_id, active_hash) impure inline_ref {
|
||||
() store_data(elect, credits, past_elections, grams, active_id, active_hash) inline_ref {
|
||||
set_data(begin_cell()
|
||||
.storeDict(elect)
|
||||
.store_dict(credits)
|
||||
|
@ -164,7 +164,7 @@ builder pack_complaint(int validator_pubkey, cell description, int created_at, i
|
|||
return (cs~load_uint(256), cs~load_uint(64));
|
||||
}
|
||||
|
||||
() send_message_back(addr, ans_tag, query_id, body, grams, mode) impure inline_ref {
|
||||
() send_message_back(addr, ans_tag, query_id, body, grams, mode) inline_ref {
|
||||
;; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool src:MsgAddress -> 011000
|
||||
var msg = begin_cell()
|
||||
.store_uint(0x18, 6)
|
||||
|
@ -179,15 +179,15 @@ builder pack_complaint(int validator_pubkey, cell description, int created_at, i
|
|||
send_raw_message(msg.end_cell(), mode);
|
||||
}
|
||||
|
||||
() return_stake(addr, query_id, reason) impure inline_ref {
|
||||
() return_stake(addr, query_id, reason) inline_ref {
|
||||
return send_message_back(addr, 0xee6f454c, query_id, reason, 0, 64);
|
||||
}
|
||||
|
||||
() send_confirmation(addr, query_id, comment) impure inline_ref {
|
||||
() send_confirmation(addr, query_id, comment) inline_ref {
|
||||
return send_message_back(addr, 0xf374484c, query_id, comment, 1000000000, 2);
|
||||
}
|
||||
|
||||
() send_validator_set_to_config(config_addr, vset, query_id) impure inline_ref {
|
||||
() send_validator_set_to_config(config_addr, vset, query_id) inline_ref {
|
||||
var msg = begin_cell()
|
||||
.store_uint(0xc4ff, 17) ;; 0 11000100 0xff
|
||||
.store_uint(config_addr, 256)
|
||||
|
@ -209,7 +209,7 @@ _ ~credit_to(credits, addr, amount) inline_ref {
|
|||
return (credits, ());
|
||||
}
|
||||
|
||||
() process_new_stake(s_addr, msg_value, cs, query_id) impure inline_ref {
|
||||
() process_new_stake(s_addr, msg_value, cs, query_id) inline_ref {
|
||||
var (src_wc, src_addr) = parse_std_addr(s_addr);
|
||||
var ds = get_data().begin_parse();
|
||||
var elect = ds~load_dict();
|
||||
|
@ -359,7 +359,7 @@ _ unfreeze_all(credits, past_elections, elect_id) inline_ref {
|
|||
return (credits, past_elections, unused_prizes);
|
||||
}
|
||||
|
||||
() config_set_confirmed(s_addr, cs, query_id, ok) impure inline_ref {
|
||||
() config_set_confirmed(s_addr, cs, query_id, ok) inline_ref {
|
||||
var (src_wc, src_addr) = parse_std_addr(s_addr);
|
||||
var config_addr = config_param(0).begin_parse().preload_uint(256);
|
||||
var ds = get_data().begin_parse();
|
||||
|
@ -390,7 +390,7 @@ _ unfreeze_all(credits, past_elections, elect_id) inline_ref {
|
|||
;; ... do not remove elect until we see this set as the next elected validator set
|
||||
}
|
||||
|
||||
() process_simple_transfer(s_addr, msg_value) impure inline_ref {
|
||||
() process_simple_transfer(s_addr, msg_value) inline_ref {
|
||||
var (elect, credits, past_elections, grams, active_id, active_hash) = load_data();
|
||||
(int src_wc, int src_addr) = parse_std_addr(s_addr);
|
||||
if (src_addr | (src_wc + 1) | (active_id == 0)) {
|
||||
|
@ -414,7 +414,7 @@ _ unfreeze_all(credits, past_elections, elect_id) inline_ref {
|
|||
return store_data(elect, credits, past_elections, grams, active_id, active_hash);
|
||||
}
|
||||
|
||||
() recover_stake(op, s_addr, cs, query_id) impure inline_ref {
|
||||
() recover_stake(op, s_addr, cs, query_id) inline_ref {
|
||||
(int src_wc, int src_addr) = parse_std_addr(s_addr);
|
||||
if (src_wc + 1) {
|
||||
;; not from masterchain, return error
|
||||
|
@ -442,7 +442,7 @@ _ unfreeze_all(credits, past_elections, elect_id) inline_ref {
|
|||
.end_cell(), 64);
|
||||
}
|
||||
|
||||
() after_code_upgrade(slice s_addr, slice cs, int query_id) impure method_id(1666) {
|
||||
() after_code_upgrade(slice s_addr, slice cs, int query_id) method_id(1666) {
|
||||
var op = 0x4e436f64;
|
||||
return send_message_back(s_addr, 0xce436f64, query_id, op, 0, 64);
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ int register_complaint(s_addr, complaint, msg_value) {
|
|||
return (complaints, complaint, 2);
|
||||
}
|
||||
|
||||
int proceed_register_vote(election_id, chash, idx, weight) impure inline_ref {
|
||||
int proceed_register_vote(election_id, chash, idx, weight) inline_ref {
|
||||
var (elect, credits, past_elections, grams, active_id, active_hash) = load_data();
|
||||
var (fs, f) = past_elections.udict_get?(32, election_id);
|
||||
ifnot (f) { ;; election not found
|
||||
|
@ -613,7 +613,7 @@ int proceed_register_vote(election_id, chash, idx, weight) impure inline_ref {
|
|||
return status;
|
||||
}
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) {
|
||||
;; do nothing for internal messages
|
||||
var cs = in_msg_cell.begin_parse();
|
||||
var flags = cs~load_uint(4); ;; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool
|
||||
|
@ -685,7 +685,7 @@ int proceed_register_vote(election_id, chash, idx, weight) impure inline_ref {
|
|||
return ();
|
||||
}
|
||||
|
||||
int postpone_elections() impure {
|
||||
int postpone_elections() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -813,7 +813,7 @@ _ compute_total_stake(l, n, m_stake) inline_ref {
|
|||
return (credits, vset, tot_weight, frozen, tot_stake, m);
|
||||
}
|
||||
|
||||
int conduct_elections(ds, elect, credits) impure {
|
||||
int conduct_elections(ds, elect, credits) {
|
||||
var (elect_at, elect_close, min_stake, total_stake, members, failed, finished) = elect.unpack_elect();
|
||||
if (now() < elect_close) {
|
||||
;; elections not finished yet
|
||||
|
@ -882,7 +882,7 @@ int conduct_elections(ds, elect, credits) impure {
|
|||
return true;
|
||||
}
|
||||
|
||||
int update_active_vset_id() impure {
|
||||
int update_active_vset_id() {
|
||||
var (elect, credits, past_elections, grams, active_id, active_hash) = load_data();
|
||||
var cur_hash = config_param(34).cell_hash();
|
||||
if (cur_hash == active_hash) {
|
||||
|
@ -940,7 +940,7 @@ int cell_hash_eq?(cell vset, int expected_vset_hash) inline_ref {
|
|||
return vset.null?() ? false : cell_hash(vset) == expected_vset_hash;
|
||||
}
|
||||
|
||||
int validator_set_installed(ds, elect, credits) impure {
|
||||
int validator_set_installed(ds, elect, credits) {
|
||||
var (elect_at, elect_close, min_stake, total_stake, members, failed, finished) = elect.unpack_elect();
|
||||
ifnot (finished) {
|
||||
;; elections not finished yet
|
||||
|
@ -968,7 +968,7 @@ int validator_set_installed(ds, elect, credits) impure {
|
|||
return false;
|
||||
}
|
||||
|
||||
int check_unfreeze() impure {
|
||||
int check_unfreeze() {
|
||||
var (elect, credits, past_elections, grams, active_id, active_hash) = load_data();
|
||||
int id = -1;
|
||||
do {
|
||||
|
@ -1029,7 +1029,7 @@ int announce_new_elections(ds, elect, credits) {
|
|||
return true;
|
||||
}
|
||||
|
||||
() run_ticktock(int is_tock) impure {
|
||||
() run_ticktock(int is_tock) {
|
||||
;; check whether an election is being conducted
|
||||
var ds = get_data().begin_parse();
|
||||
var (elect, credits) = (ds~load_dict(), ds~load_dict());
|
||||
|
|
|
@ -1,208 +1,208 @@
|
|||
// Standard library for funC
|
||||
//
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
// () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
// () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
// (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
// int preload_int(slice s, int len) asm "PLDIX";
|
||||
// int preload_uint(slice s, int len) asm "PLDUX";
|
||||
// (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
// slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
// (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
// int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
// int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
// (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
// slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
// builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
// builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
// builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
// builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
|
|
@ -1,209 +1,209 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
int workchain() asm "0 PUSHINT";
|
||||
|
||||
() force_chain(slice addr) impure {
|
||||
() force_chain(slice addr) {
|
||||
(int wc, _) = parse_std_addr(addr);
|
||||
throw_unless(333, wc == workchain());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
() send_grams(slice address, int amount) impure {
|
||||
() send_grams(slice address, int amount) {
|
||||
cell msg = begin_cell()
|
||||
.store_uint (0x18, 6) ;; bounce
|
||||
.store_slice(address) ;; 267 bit address
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
() save_data(int total_supply, slice admin_address, cell content, cell jetton_wallet_code) impure inline {
|
||||
() save_data(int total_supply, slice admin_address, cell content, cell jetton_wallet_code) inline {
|
||||
set_data(begin_cell()
|
||||
.store_coins(total_supply)
|
||||
.store_slice(admin_address)
|
||||
|
@ -31,7 +31,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
() mint_tokens(slice to_address, cell jetton_wallet_code, int amount, cell master_msg) impure {
|
||||
() mint_tokens(slice to_address, cell jetton_wallet_code, int amount, cell master_msg) {
|
||||
cell state_init = calculate_jetton_wallet_state_init(to_address, my_address(), jetton_wallet_code);
|
||||
slice to_wallet_address = calculate_jetton_wallet_address(state_init);
|
||||
var msg = begin_cell()
|
||||
|
@ -44,7 +44,7 @@
|
|||
send_raw_message(msg.end_cell(), 1); ;; pay transfer fees separately, revert on errors
|
||||
}
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) {
|
||||
if (in_msg_body.slice_empty?()) { ;; ignore empty messages
|
||||
return ();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
int workchain() asm "0 PUSHINT";
|
||||
|
||||
() force_chain(slice addr) impure {
|
||||
() force_chain(slice addr) {
|
||||
(int wc, _) = parse_std_addr(addr);
|
||||
throw_unless(333, wc == workchain());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
() send_grams(slice address, int amount) impure {
|
||||
() send_grams(slice address, int amount) {
|
||||
cell msg = begin_cell()
|
||||
.store_uint (0x18, 6) ;; bounce
|
||||
.store_slice(address) ;; 267 bit address
|
||||
|
|
|
@ -33,7 +33,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
return (ds~load_coins(), ds~load_msg_addr(), ds~load_msg_addr(), ds~load_ref());
|
||||
}
|
||||
|
||||
() save_data (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) impure inline {
|
||||
() save_data (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {
|
||||
set_data(pack_jetton_wallet_data(balance, owner_address, jetton_master_address, jetton_wallet_code));
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
= InternalMsgBody;
|
||||
-}
|
||||
|
||||
() send_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) impure {
|
||||
() send_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) {
|
||||
int query_id = in_msg_body~load_uint(64);
|
||||
int jetton_amount = in_msg_body~load_coins();
|
||||
slice to_owner_address = in_msg_body~load_msg_addr();
|
||||
|
@ -107,7 +107,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
= InternalMsgBody;
|
||||
-}
|
||||
|
||||
() receive_tokens (slice in_msg_body, slice sender_address, int my_ton_balance, int fwd_fee, int msg_value) impure {
|
||||
() receive_tokens (slice in_msg_body, slice sender_address, int my_ton_balance, int fwd_fee, int msg_value) {
|
||||
;; NOTE we can not allow fails in action phase since in that case there will be
|
||||
;; no bounce. Thus check and throw in computation phase.
|
||||
(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_data();
|
||||
|
@ -162,7 +162,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
save_data(balance, owner_address, jetton_master_address, jetton_wallet_code);
|
||||
}
|
||||
|
||||
() burn_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) impure {
|
||||
() burn_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) {
|
||||
;; NOTE we can not allow fails in action phase since in that case there will be
|
||||
;; no bounce. Thus check and throw in computation phase.
|
||||
(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_data();
|
||||
|
@ -196,7 +196,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
save_data(balance, owner_address, jetton_master_address, jetton_wallet_code);
|
||||
}
|
||||
|
||||
() on_bounce (slice in_msg_body) impure {
|
||||
() on_bounce (slice in_msg_body) {
|
||||
in_msg_body~skip_bits(32); ;; 0xFFFFFFFF
|
||||
(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_data();
|
||||
int op = in_msg_body~load_uint(32);
|
||||
|
@ -207,7 +207,7 @@ const gas_consumption = 10000000; ;; 0.01 TON
|
|||
save_data(balance, owner_address, jetton_master_address, jetton_wallet_code);
|
||||
}
|
||||
|
||||
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) {
|
||||
if (in_msg_body.slice_empty?()) { ;; ignore empty messages
|
||||
return ();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
() save_data(slice owner_address, int next_item_index, cell content, cell nft_item_code, cell royalty_params) impure inline {
|
||||
() save_data(slice owner_address, int next_item_index, cell content, cell nft_item_code, cell royalty_params) inline {
|
||||
set_data(begin_cell()
|
||||
.store_slice(owner_address)
|
||||
.store_uint(next_item_index, 64)
|
||||
|
@ -46,7 +46,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|||
.begin_parse();
|
||||
}
|
||||
|
||||
() deploy_nft_item(int item_index, cell nft_item_code, int amount, cell nft_content) impure {
|
||||
() deploy_nft_item(int item_index, cell nft_item_code, int amount, cell nft_content) {
|
||||
cell state_init = calculate_nft_item_state_init(item_index, nft_item_code);
|
||||
slice nft_address = calculate_nft_item_address(workchain(), state_init);
|
||||
var msg = begin_cell()
|
||||
|
@ -59,7 +59,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|||
send_raw_message(msg.end_cell(), 1); ;; pay transfer fees separately, revert on errors
|
||||
}
|
||||
|
||||
() send_royalty_params(slice to_address, int query_id, slice data) impure inline {
|
||||
() send_royalty_params(slice to_address, int query_id, slice data) inline {
|
||||
var msg = begin_cell()
|
||||
.store_uint(0x10, 6) ;; nobounce - int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool packages:MsgAddress -> 011000
|
||||
.store_slice(to_address)
|
||||
|
@ -71,7 +71,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|||
send_raw_message(msg.end_cell(), 64); ;; carry all the remaining value of the inbound message
|
||||
}
|
||||
|
||||
() recv_internal(cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(cell in_msg_full, slice in_msg_body) {
|
||||
if (in_msg_body.slice_empty?()) { ;; ignore empty messages
|
||||
return ();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
int workchain() asm "0 PUSHINT";
|
||||
|
||||
() force_chain(slice addr) impure {
|
||||
() force_chain(slice addr) {
|
||||
(int wc, _) = parse_std_addr(addr);
|
||||
throw_unless(333, wc == workchain());
|
||||
}
|
||||
|
||||
slice null_addr() asm "b{00} PUSHSLICE";
|
||||
int flag::regular() asm "0x10 PUSHINT";
|
||||
int flag::bounce() asm "0x8 PUSHINT";
|
||||
int flag::bounce() asm "0x8 PUSHINT";
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -1,211 +1,211 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
|
|
@ -20,122 +20,122 @@
|
|||
*/
|
||||
|
||||
/// Adds an element to the beginning of lisp-style list.
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
|
||||
/// Extracts the head and the tail of lisp-style list.
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
|
||||
/// Extracts the tail and the head of lisp-style list.
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
|
||||
/// Returns the head of lisp-style list.
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
|
||||
/// Returns the tail of lisp-style list.
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
|
||||
/// Creates tuple with zero elements.
|
||||
tuple empty_tuple() asm "NIL";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
|
||||
/// Appends a value `x` to a `Tuple t = (x1, ..., xn)`, but only if the resulting `Tuple t' = (x1, ..., xn, x)`
|
||||
/// is of length at most 255. Otherwise throws a type check exception.
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
|
||||
/// Creates a tuple of length one with given argument as element.
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
|
||||
/// Unpacks a tuple of length one
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
|
||||
/// Creates a tuple of length two with given arguments as elements.
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
|
||||
/// Unpacks a tuple of length two
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
|
||||
/// Creates a tuple of length three with given arguments as elements.
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
|
||||
/// Unpacks a tuple of length three
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
|
||||
/// Creates a tuple of length four with given arguments as elements.
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
|
||||
/// Unpacks a tuple of length four
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
|
||||
/// Returns the first element of a tuple (with unknown element types).
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a tuple (with unknown element types).
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
|
||||
/// Returns the third element of a tuple (with unknown element types).
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
|
||||
/// Returns the fourth element of a tuple (with unknown element types).
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
|
||||
/// Returns the first element of a pair tuple.
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a pair tuple.
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
|
||||
/// Returns the first element of a triple tuple.
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a triple tuple.
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
|
||||
/// Returns the third element of a triple tuple.
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
|
||||
|
||||
/// Push null element (casted to given type)
|
||||
/// By the TVM type `Null` FunC represents absence of a value of some atomic type.
|
||||
/// So `null` can actually have any atomic type.
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
|
||||
/// Moves a variable [x] to the top of the stack
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
|
||||
|
||||
/// Returns the current Unix time as an Integer
|
||||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
/// Returns the internal address of the current smart contract as a Slice with a `MsgAddressInt`.
|
||||
/// If necessary, it can be parsed further using primitives such as [parse_std_addr].
|
||||
slice my_address() asm "MYADDR";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
|
||||
/// Returns the balance of the smart contract as a tuple consisting of an int
|
||||
/// (balance in nanotoncoins) and a `cell`
|
||||
/// (a dictionary with 32-bit keys representing the balance of "extra currencies")
|
||||
/// at the start of Computation Phase.
|
||||
/// Note that RAW primitives such as [send_raw_message] do not update this field.
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
|
||||
/// Returns the logical time of the current transaction.
|
||||
int cur_lt() asm "LTIME";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
|
||||
/// Returns the starting logical time of the current block.
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
/// Computes the representation hash of a `cell` [c] and returns it as a 256-bit unsigned integer `x`.
|
||||
/// Useful for signing and checking signatures of arbitrary entities represented by a tree of cells.
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
|
||||
/// Computes the hash of a `slice s` and returns it as a 256-bit unsigned integer `x`.
|
||||
/// The result is the same as if an ordinary cell containing only data and references from `s` had been created
|
||||
/// and its hash computed by [cell_hash].
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
|
||||
/// Computes sha256 of the data bits of `slice` [s]. If the bit length of `s` is not divisible by eight,
|
||||
/// throws a cell underflow exception. The hash value is returned as a 256-bit unsigned integer `x`.
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
/*
|
||||
# Signature checks
|
||||
|
@ -148,14 +148,14 @@ int string_hash(slice s) asm "SHA256U";
|
|||
/// Note that `CHKSIGNU` creates a 256-bit slice with the hash and calls `CHKSIGNS`.
|
||||
/// That is, if [hash] is computed as the hash of some data, these data are hashed twice,
|
||||
/// the second hashing occurring inside `CHKSIGNS`.
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
|
||||
/// Checks whether [signature] is a valid Ed25519-signature of the data portion of `slice data` using `public_key`,
|
||||
/// similarly to [check_signature].
|
||||
/// If the bit length of [data] is not divisible by eight, throws a cell underflow exception.
|
||||
/// The verification of Ed25519 signatures is the standard one,
|
||||
/// with sha256 used to reduce [data] to the 256-bit number that is actually signed.
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
/*--
|
||||
# Computation of boc size
|
||||
|
@ -171,54 +171,54 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
|
|||
/// The total count of visited cells `x` cannot exceed non-negative [max_cells];
|
||||
/// otherwise the computation is aborted before visiting the `(max_cells + 1)`-st cell and
|
||||
/// a zero flag is returned to indicate failure. If [c] is `null`, returns `x = y = z = 0`.
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
|
||||
/// Similar to [compute_data_size?], but accepting a `slice` [s] instead of a `cell`.
|
||||
/// The returned value of `x` does not take into account the cell that contains the `slice` [s] itself;
|
||||
/// however, the data bits and the cell references of [s] are accounted for in `y` and `z`.
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
|
||||
/// A non-quiet version of [compute_data_size?] that throws a cell overflow exception (`8`) on failure.
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
/// A non-quiet version of [slice_compute_data_size?] that throws a cell overflow exception (8) on failure.
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
/// Throws an exception with exit_code excno if cond is not 0 (commented since implemented in compilator)
|
||||
// () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
// () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
/*-
|
||||
# Debug primitives
|
||||
Only works for local TVM execution with debug level verbosity
|
||||
*/
|
||||
/// Dumps the stack (at most the top 255 values) and shows the total stack depth.
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
/*
|
||||
# Persistent storage save and load
|
||||
*/
|
||||
|
||||
/// Returns the persistent contract storage cell. It can be parsed or modified with slice and builder primitives later.
|
||||
cell get_data() asm "c4 PUSH";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
|
||||
/// Sets `cell` [c] as persistent contract data. You can update persistent contract storage with this primitive.
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
|
||||
/*
|
||||
# Continuation primitives
|
||||
*/
|
||||
/// Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls.
|
||||
/// The primitive returns the current value of `c3`.
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
|
||||
/// Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time.
|
||||
/// Note that after execution of this primitive the current code
|
||||
/// (and the stack of recursive function calls) won't change,
|
||||
/// but any other function call will use a function from the new code.
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
|
||||
/// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
/*--
|
||||
# Gas related primitives
|
||||
|
@ -230,37 +230,37 @@ cont bless(slice s) asm "BLESS";
|
|||
/// This action is required to process external messages, which bring no value (hence no gas) with themselves.
|
||||
///
|
||||
/// For more details check [accept_message effects](https://ton.org/docs/#/smart-contracts/accept).
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
/// Sets current gas limit `gl` to the minimum of limit and `gm`, and resets the gas credit `gc` to zero.
|
||||
/// If the gas consumed so far (including the present instruction) exceeds the resulting value of `gl`,
|
||||
/// an (unhandled) out of gas exception is thrown before setting new gas limits.
|
||||
/// Notice that [set_gas_limit] with an argument `limit ≥ 2^63 − 1` is equivalent to [accept_message].
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
|
||||
/// Commits the current state of registers `c4` (“persistent data”) and `c5` (“actions”)
|
||||
/// so that the current execution is considered “successful” with the saved values even if an exception
|
||||
/// in Computation Phase is thrown later.
|
||||
() commit() impure asm "COMMIT";
|
||||
() commit() asm "COMMIT";
|
||||
|
||||
/// Not implemented
|
||||
//() buy_gas(int gram) impure asm "BUYGAS";
|
||||
//() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
/// Computes the amount of gas that can be bought for `amount` nanoTONs,
|
||||
/// and sets `gl` accordingly in the same way as [set_gas_limit].
|
||||
() buy_gas(int amount) impure asm "BUYGAS";
|
||||
() buy_gas(int amount) asm "BUYGAS";
|
||||
|
||||
/// Computes the minimum of two integers [x] and [y].
|
||||
int min(int x, int y) asm "MIN";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
|
||||
/// Computes the maximum of two integers [x] and [y].
|
||||
int max(int x, int y) asm "MAX";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
|
||||
/// Sorts two integers.
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
|
||||
/// Computes the absolute value of an integer [x].
|
||||
int abs(int x) asm "ABS";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
/*
|
||||
# Slice primitives
|
||||
|
@ -279,80 +279,80 @@ int abs(int x) asm "ABS";
|
|||
/// Converts a `cell` [c] into a `slice`. Notice that [c] must be either an ordinary cell,
|
||||
/// or an exotic cell (see [TVM.pdf](https://ton-blockchain.github.io/docs/tvm.pdf), 3.1.2)
|
||||
/// which is automatically loaded to yield an ordinary cell `c'`, converted into a `slice` afterwards.
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
|
||||
/// Checks if [s] is empty. If not, throws an exception.
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
|
||||
/// Loads the first reference from the slice.
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
|
||||
/// Preloads the first reference from the slice.
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
|
||||
/* Functions below are commented because are implemented on compilator level for optimisation */
|
||||
|
||||
/// Loads a signed [len]-bit integer from a slice [s].
|
||||
// (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
|
||||
/// Loads an unsigned [len]-bit integer from a slice [s].
|
||||
// (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
// (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
|
||||
/// Preloads a signed [len]-bit integer from a slice [s].
|
||||
// int preload_int(slice s, int len) asm "PLDIX";
|
||||
// int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
|
||||
/// Preloads an unsigned [len]-bit integer from a slice [s].
|
||||
// int preload_uint(slice s, int len) asm "PLDUX";
|
||||
// int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
|
||||
/// Loads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
// (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
// (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
|
||||
/// Preloads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
// slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
// slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
|
||||
/// Loads serialized amount of TonCoins (any unsigned integer up to `2^128 - 1`).
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
|
||||
/// Returns all but the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
|
||||
/// Returns the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
|
||||
/// Returns all but the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
|
||||
/// Returns the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
|
||||
/// Loads a dictionary `D` (HashMapE) from `slice` [s].
|
||||
/// (returns `null` if `nothing` constructor is used).
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
|
||||
/// Preloads a dictionary `D` from `slice` [s].
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
|
||||
/// Loads a dictionary as [load_dict], but returns only the remainder of the slice.
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
/// Loads (Maybe ^Cell) from `slice` [s].
|
||||
/// In other words loads 1 bit and if it is true
|
||||
/// loads first ref and return it with slice remainder
|
||||
/// otherwise returns `null` and slice remainder
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
|
||||
/// Preloads (Maybe ^Cell) from `slice` [s].
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
|
||||
|
||||
/// Returns the depth of `cell` [c].
|
||||
/// If [c] has no references, then return `0`;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [c].
|
||||
/// If [c] is a `null` instead of a cell, returns zero.
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
|
||||
/*
|
||||
|
@ -360,42 +360,42 @@ int cell_depth(cell c) asm "CDEPTH";
|
|||
*/
|
||||
|
||||
/// Returns the number of references in `slice` [s].
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
|
||||
/// Returns the number of data bits in `slice` [s].
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
|
||||
/// Returns both the number of data bits and the number of references in `slice` [s].
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
|
||||
/// Checks whether a `slice` [s] is empty (i.e., contains no bits of data and no cell references).
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
|
||||
/// Checks whether `slice` [s] has no bits of data.
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
|
||||
/// Checks whether `slice` [s] has no references.
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
|
||||
/// Returns the depth of `slice` [s].
|
||||
/// If [s] has no references, then returns `0`;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [s].
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
/*
|
||||
# Builder size primitives
|
||||
*/
|
||||
|
||||
/// Returns the number of cell references already stored in `builder` [b]
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
|
||||
/// Returns the number of data bits already stored in `builder` [b].
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
|
||||
/// Returns the depth of `builder` [b].
|
||||
/// If no cell references are stored in [b], then returns 0;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [b].
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
/*
|
||||
# Builder primitives
|
||||
|
@ -408,23 +408,23 @@ int builder_depth(builder b) asm "BDEPTH";
|
|||
*/
|
||||
|
||||
/// Creates a new empty `builder`.
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
|
||||
/// Converts a `builder` into an ordinary `cell`.
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
/// Stores a reference to `cell` [c] into `builder` [b].
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
|
||||
/// Stores an unsigned [len]-bit integer `x` into `b` for `0 ≤ len ≤ 256`.
|
||||
// builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
// builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
|
||||
/// Stores a signed [len]-bit integer `x` into `b` for` 0 ≤ len ≤ 257`.
|
||||
// builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
// builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
|
||||
|
||||
/// Stores `slice` [s] into `builder` [b]
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
|
||||
/// Stores (serializes) an integer [x] in the range `0..2^128 − 1` into `builder` [b].
|
||||
/// The serialization of [x] consists of a 4-bit unsigned big-endian integer `l`,
|
||||
|
@ -433,17 +433,17 @@ builder store_slice(builder b, slice s) asm "STSLICER";
|
|||
/// If [x] does not belong to the supported range, a range check exception is thrown.
|
||||
///
|
||||
/// Store amounts of TonCoins to the builder as VarUInteger 16
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) asm "STGRAMS";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) pure asm "STGRAMS";
|
||||
|
||||
/// Stores dictionary `D` represented by `cell` [c] or `null` into `builder` [b].
|
||||
/// In other words, stores a `1`-bit and a reference to [c] if [c] is not `null` and `0`-bit otherwise.
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
/// Stores (Maybe ^Cell) to builder:
|
||||
/// if cell is null store 1 zero bit
|
||||
/// otherwise store 1 true bit and ref to cell
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
|
||||
/*
|
||||
|
@ -485,22 +485,22 @@ builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
|||
|
||||
/// Loads from slice [s] the only prefix that is a valid `MsgAddress`,
|
||||
/// and returns both this prefix `s'` and the remainder `s''` of [s] as slices.
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
|
||||
/// Decomposes slice [s] containing a valid `MsgAddress` into a `tuple t` with separate fields of this `MsgAddress`.
|
||||
/// If [s] is not a valid `MsgAddress`, a cell deserialization exception is thrown.
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
|
||||
/// Parses slice [s] containing a valid `MsgAddressInt` (usually a `msg_addr_std`),
|
||||
/// applies rewriting from the anycast (if present) to the same-length prefix of the address,
|
||||
/// and returns both the workchain and the 256-bit address as integers.
|
||||
/// If the address is not 256-bit, or if [s] is not a valid serialization of `MsgAddressInt`,
|
||||
/// throws a cell deserialization exception.
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
|
||||
/// A variant of [parse_std_addr] that returns the (rewritten) address as a slice [s],
|
||||
/// even if it is not exactly 256 bit long (represented by a `msg_addr_var`).
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
/*
|
||||
# Dictionary primitives
|
||||
|
@ -509,117 +509,117 @@ tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
|||
|
||||
/// Sets the value associated with [key_len]-bit key signed index in dictionary [dict] to [value] (cell),
|
||||
/// and returns the resulting dictionary.
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
|
||||
/// Sets the value associated with [key_len]-bit key unsigned index in dictionary [dict] to [value] (cell),
|
||||
/// and returns the resulting dictionary.
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
|
||||
/// Creates an empty dictionary, which is actually a null value. Equivalent to PUSHNULL
|
||||
cell new_dict() asm "NEWDICT";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
/// Checks whether a dictionary is empty. Equivalent to cell_null?.
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
|
||||
/* Prefix dictionary primitives */
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
/// Returns the value of the global configuration parameter with integer index `i` as a `cell` or `null` value.
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
/// Checks whether c is a null. Note, that FunC also has polymorphic null? built-in.
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
/// Creates an output action which would reserve exactly amount nanotoncoins (if mode = 0), at most amount nanotoncoins (if mode = 2), or all but amount nanotoncoins (if mode = 1 or mode = 3), from the remaining balance of the account. It is roughly equivalent to creating an outbound message carrying amount nanotoncoins (or b − amount nanotoncoins, where b is the remaining balance) to oneself, so that the subsequent output actions would not be able to spend more money than the remainder. Bit +2 in mode means that the external action does not fail if the specified amount cannot be reserved; instead, all remaining balance is reserved. Bit +8 in mode means `amount <- -amount` before performing any further actions. Bit +4 in mode means that amount is increased by the original balance of the current account (before the compute phase), including all extra currencies, before performing any other checks and actions. Currently, amount must be a non-negative integer, and mode must be in the range 0..15.
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
/// Similar to raw_reserve, but also accepts a dictionary extra_amount (represented by a cell or null) with extra currencies. In this way currencies other than TonCoin can be reserved.
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
/// Sends a raw message contained in msg, which should contain a correctly serialized object Message X, with the only exception that the source address is allowed to have dummy value addr_none (to be automatically replaced with the current smart contract address), and ihr_fee, fwd_fee, created_lt and created_at fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). Integer parameter mode contains the flags. Currently mode = 0 is used for ordinary messages; mode = 128 is used for messages that are to carry all the remaining balance of the current smart contract (instead of the value originally indicated in the message); mode = 64 is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount); mode' = mode + 1 means that the sender wants to pay transfer fees separately; mode' = mode + 2 means that any errors arising while processing this message during the action phase should be ignored. Finally, mode' = mode + 32 means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with +128.
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
/// Creates an output action that would change this smart contract code to that given by cell new_code. Notice that this change will take effect only after the successful termination of the current run of the smart contract
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
/// Generates a new pseudo-random unsigned 256-bit integer x. The algorithm is as follows: if r is the old value of the random seed, considered as a 32-byte array (by constructing the big-endian representation of an unsigned 256-bit integer), then its sha512(r) is computed; the first 32 bytes of this hash are stored as the new value r' of the random seed, and the remaining 32 bytes are returned as the next random value x.
|
||||
int random() impure asm "RANDU256";
|
||||
int random() asm "RANDU256";
|
||||
/// Generates a new pseudo-random integer z in the range 0..range−1 (or range..−1, if range < 0). More precisely, an unsigned random value x is generated as in random; then z := x * range / 2^256 is computed.
|
||||
int rand(int range) impure asm "RAND";
|
||||
int rand(int range) asm "RAND";
|
||||
/// Returns the current random seed as an unsigned 256-bit Integer.
|
||||
int get_seed() asm "RANDSEED";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
/// Sets the random seed to unsigned 256-bit seed.
|
||||
() set_seed(int) impure asm "SETRAND";
|
||||
() set_seed(int) asm "SETRAND";
|
||||
/// Mixes unsigned 256-bit integer x into the random seed r by setting the random seed to sha256 of the concatenation of two 32-byte strings: the first with the big-endian representation of the old seed r, and the second with the big-endian representation of x.
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
/// Equivalent to randomize(cur_lt());.
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
/// Checks whether the data parts of two slices coinside
|
||||
int equal_slice_bits (slice a, slice b) asm "SDEQ";
|
||||
int equal_slice_bits (slice a, slice b) pure asm "SDEQ";
|
||||
|
||||
/// Concatenates two builders
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ int check_proof(int merkle_hash, int byte_to_proof, int file_size, cell file_dic
|
|||
return false;
|
||||
}
|
||||
|
||||
() add_to_balance(int amount) impure inline_ref {
|
||||
() add_to_balance(int amount) inline_ref {
|
||||
var ds = get_data().begin_parse();
|
||||
var (active, balance, residue) = (ds~load_int(1), ds~load_grams(), ds);
|
||||
balance += amount;
|
||||
|
@ -52,12 +52,12 @@ int check_proof(int merkle_hash, int byte_to_proof, int file_size, cell file_dic
|
|||
.end_cell().set_data();
|
||||
}
|
||||
|
||||
(slice, int) get_client_data(ds) {
|
||||
(slice, int) get_client_data(ds) pure {
|
||||
ds = ds.preload_ref().begin_parse();
|
||||
return (ds~load_msg_addr(), ds~load_uint(256));
|
||||
}
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) {
|
||||
slice cs = in_msg_full.begin_parse();
|
||||
int flags = cs~load_uint(4);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ cell build_storage_contract_stateinit(int merkle_hash, int file_size, int rate_p
|
|||
}
|
||||
|
||||
() deploy_storage_contract (slice client, int query_id, int file_size, int merkle_hash, int torrent_hash,
|
||||
int expected_rate, int expected_max_span) impure {
|
||||
int expected_rate, int expected_max_span) {
|
||||
var ds = get_data().begin_parse();
|
||||
var (wallet_data,
|
||||
accept_new_contracts?,
|
||||
|
@ -74,7 +74,7 @@ cell build_storage_contract_stateinit(int merkle_hash, int file_size, int rate_p
|
|||
send_raw_message(msg, 64);
|
||||
}
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) {
|
||||
slice cs = in_msg_full.begin_parse();
|
||||
int flags = cs~load_uint(4);
|
||||
|
||||
|
@ -156,7 +156,7 @@ cell build_storage_contract_stateinit(int merkle_hash, int file_size, int rate_p
|
|||
}
|
||||
}
|
||||
|
||||
() recv_external(slice in_msg) impure {
|
||||
() recv_external(slice in_msg) {
|
||||
var signature = in_msg~load_bits(512);
|
||||
var cs = in_msg;
|
||||
var (subwallet_id, valid_until, msg_seqno) = (cs~load_uint(32), cs~load_uint(32), cs~load_uint(32));
|
||||
|
|
|
@ -20,122 +20,122 @@
|
|||
-}
|
||||
|
||||
;;; Adds an element to the beginning of lisp-style list.
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
|
||||
;;; Extracts the head and the tail of lisp-style list.
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
|
||||
;;; Extracts the tail and the head of lisp-style list.
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
|
||||
;;; Returns the head of lisp-style list.
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
|
||||
;;; Returns the tail of lisp-style list.
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
|
||||
;;; Creates tuple with zero elements.
|
||||
tuple empty_tuple() asm "NIL";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
|
||||
;;; Appends a value `x` to a `Tuple t = (x1, ..., xn)`, but only if the resulting `Tuple t' = (x1, ..., xn, x)`
|
||||
;;; is of length at most 255. Otherwise throws a type check exception.
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
|
||||
;;; Creates a tuple of length one with given argument as element.
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
|
||||
;;; Unpacks a tuple of length one
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
|
||||
;;; Creates a tuple of length two with given arguments as elements.
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
|
||||
;;; Unpacks a tuple of length two
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
|
||||
;;; Creates a tuple of length three with given arguments as elements.
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
|
||||
;;; Unpacks a tuple of length three
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
|
||||
;;; Creates a tuple of length four with given arguments as elements.
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
|
||||
;;; Unpacks a tuple of length four
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
|
||||
;;; Returns the first element of a tuple (with unknown element types).
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
|
||||
;;; Returns the second element of a tuple (with unknown element types).
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
|
||||
;;; Returns the third element of a tuple (with unknown element types).
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
|
||||
;;; Returns the fourth element of a tuple (with unknown element types).
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
|
||||
;;; Returns the first element of a pair tuple.
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
|
||||
;;; Returns the second element of a pair tuple.
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
|
||||
;;; Returns the first element of a triple tuple.
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
|
||||
;;; Returns the second element of a triple tuple.
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
|
||||
;;; Returns the third element of a triple tuple.
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
|
||||
|
||||
;;; Push null element (casted to given type)
|
||||
;;; By the TVM type `Null` FunC represents absence of a value of some atomic type.
|
||||
;;; So `null` can actually have any atomic type.
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
|
||||
;;; Moves a variable [x] to the top of the stack
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
|
||||
|
||||
;;; Returns the current Unix time as an Integer
|
||||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
;;; Returns the internal address of the current smart contract as a Slice with a `MsgAddressInt`.
|
||||
;;; If necessary, it can be parsed further using primitives such as [parse_std_addr].
|
||||
slice my_address() asm "MYADDR";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
|
||||
;;; Returns the balance of the smart contract as a tuple consisting of an int
|
||||
;;; (balance in nanotoncoins) and a `cell`
|
||||
;;; (a dictionary with 32-bit keys representing the balance of "extra currencies")
|
||||
;;; at the start of Computation Phase.
|
||||
;;; Note that RAW primitives such as [send_raw_message] do not update this field.
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
|
||||
;;; Returns the logical time of the current transaction.
|
||||
int cur_lt() asm "LTIME";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
|
||||
;;; Returns the starting logical time of the current block.
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
;;; Computes the representation hash of a `cell` [c] and returns it as a 256-bit unsigned integer `x`.
|
||||
;;; Useful for signing and checking signatures of arbitrary entities represented by a tree of cells.
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
|
||||
;;; Computes the hash of a `slice s` and returns it as a 256-bit unsigned integer `x`.
|
||||
;;; The result is the same as if an ordinary cell containing only data and references from `s` had been created
|
||||
;;; and its hash computed by [cell_hash].
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
|
||||
;;; Computes sha256 of the data bits of `slice` [s]. If the bit length of `s` is not divisible by eight,
|
||||
;;; throws a cell underflow exception. The hash value is returned as a 256-bit unsigned integer `x`.
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
{-
|
||||
# Signature checks
|
||||
|
@ -148,14 +148,14 @@ int string_hash(slice s) asm "SHA256U";
|
|||
;;; Note that `CHKSIGNU` creates a 256-bit slice with the hash and calls `CHKSIGNS`.
|
||||
;;; That is, if [hash] is computed as the hash of some data, these data are hashed twice,
|
||||
;;; the second hashing occurring inside `CHKSIGNS`.
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
|
||||
;;; Checks whether [signature] is a valid Ed25519-signature of the data portion of `slice data` using `public_key`,
|
||||
;;; similarly to [check_signature].
|
||||
;;; If the bit length of [data] is not divisible by eight, throws a cell underflow exception.
|
||||
;;; The verification of Ed25519 signatures is the standard one,
|
||||
;;; with sha256 used to reduce [data] to the 256-bit number that is actually signed.
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
{---
|
||||
# Computation of boc size
|
||||
|
@ -171,54 +171,54 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
|
|||
;;; The total count of visited cells `x` cannot exceed non-negative [max_cells];
|
||||
;;; otherwise the computation is aborted before visiting the `(max_cells + 1)`-st cell and
|
||||
;;; a zero flag is returned to indicate failure. If [c] is `null`, returns `x = y = z = 0`.
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
|
||||
;;; Similar to [compute_data_size?], but accepting a `slice` [s] instead of a `cell`.
|
||||
;;; The returned value of `x` does not take into account the cell that contains the `slice` [s] itself;
|
||||
;;; however, the data bits and the cell references of [s] are accounted for in `y` and `z`.
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
|
||||
;;; A non-quiet version of [compute_data_size?] that throws a cell overflow exception (`8`) on failure.
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;;; A non-quiet version of [slice_compute_data_size?] that throws a cell overflow exception (8) on failure.
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;;; Throws an exception with exit_code excno if cond is not 0 (commented since implemented in compilator)
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
{--
|
||||
# Debug primitives
|
||||
Only works for local TVM execution with debug level verbosity
|
||||
-}
|
||||
;;; Dumps the stack (at most the top 255 values) and shows the total stack depth.
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
{-
|
||||
# Persistent storage save and load
|
||||
-}
|
||||
|
||||
;;; Returns the persistent contract storage cell. It can be parsed or modified with slice and builder primitives later.
|
||||
cell get_data() asm "c4 PUSH";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
|
||||
;;; Sets `cell` [c] as persistent contract data. You can update persistent contract storage with this primitive.
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
|
||||
{-
|
||||
# Continuation primitives
|
||||
-}
|
||||
;;; Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls.
|
||||
;;; The primitive returns the current value of `c3`.
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
|
||||
;;; Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time.
|
||||
;;; Note that after execution of this primitive the current code
|
||||
;;; (and the stack of recursive function calls) won't change,
|
||||
;;; but any other function call will use a function from the new code.
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
|
||||
;;; Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
{---
|
||||
# Gas related primitives
|
||||
|
@ -230,37 +230,37 @@ cont bless(slice s) asm "BLESS";
|
|||
;;; This action is required to process external messages, which bring no value (hence no gas) with themselves.
|
||||
;;;
|
||||
;;; For more details check [accept_message effects](https://ton.org/docs/#/smart-contracts/accept).
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
;;; Sets current gas limit `gl` to the minimum of limit and `gm`, and resets the gas credit `gc` to zero.
|
||||
;;; If the gas consumed so far (including the present instruction) exceeds the resulting value of `gl`,
|
||||
;;; an (unhandled) out of gas exception is thrown before setting new gas limits.
|
||||
;;; Notice that [set_gas_limit] with an argument `limit ≥ 2^63 − 1` is equivalent to [accept_message].
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
|
||||
;;; Commits the current state of registers `c4` (“persistent data”) and `c5` (“actions”)
|
||||
;;; so that the current execution is considered “successful” with the saved values even if an exception
|
||||
;;; in Computation Phase is thrown later.
|
||||
() commit() impure asm "COMMIT";
|
||||
() commit() asm "COMMIT";
|
||||
|
||||
;;; Not implemented
|
||||
;;() buy_gas(int gram) impure asm "BUYGAS";
|
||||
;;() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
;;; Computes the amount of gas that can be bought for `amount` nanoTONs,
|
||||
;;; and sets `gl` accordingly in the same way as [set_gas_limit].
|
||||
() buy_gas(int amount) impure asm "BUYGAS";
|
||||
() buy_gas(int amount) asm "BUYGAS";
|
||||
|
||||
;;; Computes the minimum of two integers [x] and [y].
|
||||
int min(int x, int y) asm "MIN";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
|
||||
;;; Computes the maximum of two integers [x] and [y].
|
||||
int max(int x, int y) asm "MAX";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
|
||||
;;; Sorts two integers.
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
|
||||
;;; Computes the absolute value of an integer [x].
|
||||
int abs(int x) asm "ABS";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
{-
|
||||
# Slice primitives
|
||||
|
@ -279,80 +279,80 @@ int abs(int x) asm "ABS";
|
|||
;;; Converts a `cell` [c] into a `slice`. Notice that [c] must be either an ordinary cell,
|
||||
;;; or an exotic cell (see [TVM.pdf](https://ton-blockchain.github.io/docs/tvm.pdf), 3.1.2)
|
||||
;;; which is automatically loaded to yield an ordinary cell `c'`, converted into a `slice` afterwards.
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
|
||||
;;; Checks if [s] is empty. If not, throws an exception.
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
|
||||
;;; Loads the first reference from the slice.
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
|
||||
;;; Preloads the first reference from the slice.
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
|
||||
{- Functions below are commented because are implemented on compilator level for optimisation -}
|
||||
|
||||
;;; Loads a signed [len]-bit integer from a slice [s].
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
|
||||
;;; Loads an unsigned [len]-bit integer from a slice [s].
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
|
||||
;;; Preloads a signed [len]-bit integer from a slice [s].
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
|
||||
;;; Preloads an unsigned [len]-bit integer from a slice [s].
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
|
||||
;;; Loads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
|
||||
;;; Preloads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
|
||||
;;; Loads serialized amount of TonCoins (any unsigned integer up to `2^128 - 1`).
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
|
||||
;;; Returns all but the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
|
||||
;;; Returns the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
|
||||
;;; Returns all but the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
|
||||
;;; Returns the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
|
||||
;;; Loads a dictionary `D` (HashMapE) from `slice` [s].
|
||||
;;; (returns `null` if `nothing` constructor is used).
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
|
||||
;;; Preloads a dictionary `D` from `slice` [s].
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
|
||||
;;; Loads a dictionary as [load_dict], but returns only the remainder of the slice.
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
;;; Loads (Maybe ^Cell) from `slice` [s].
|
||||
;;; In other words loads 1 bit and if it is true
|
||||
;;; loads first ref and return it with slice remainder
|
||||
;;; otherwise returns `null` and slice remainder
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
|
||||
;;; Preloads (Maybe ^Cell) from `slice` [s].
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
|
||||
|
||||
;;; Returns the depth of `cell` [c].
|
||||
;;; If [c] has no references, then return `0`;
|
||||
;;; otherwise the returned value is one plus the maximum of depths of cells referred to from [c].
|
||||
;;; If [c] is a `null` instead of a cell, returns zero.
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
|
||||
{-
|
||||
|
@ -360,42 +360,42 @@ int cell_depth(cell c) asm "CDEPTH";
|
|||
-}
|
||||
|
||||
;;; Returns the number of references in `slice` [s].
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
|
||||
;;; Returns the number of data bits in `slice` [s].
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
|
||||
;;; Returns both the number of data bits and the number of references in `slice` [s].
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
|
||||
;;; Checks whether a `slice` [s] is empty (i.e., contains no bits of data and no cell references).
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
|
||||
;;; Checks whether `slice` [s] has no bits of data.
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
|
||||
;;; Checks whether `slice` [s] has no references.
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
|
||||
;;; Returns the depth of `slice` [s].
|
||||
;;; If [s] has no references, then returns `0`;
|
||||
;;; otherwise the returned value is one plus the maximum of depths of cells referred to from [s].
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
{-
|
||||
# Builder size primitives
|
||||
-}
|
||||
|
||||
;;; Returns the number of cell references already stored in `builder` [b]
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
|
||||
;;; Returns the number of data bits already stored in `builder` [b].
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
|
||||
;;; Returns the depth of `builder` [b].
|
||||
;;; If no cell references are stored in [b], then returns 0;
|
||||
;;; otherwise the returned value is one plus the maximum of depths of cells referred to from [b].
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
{-
|
||||
# Builder primitives
|
||||
|
@ -408,23 +408,23 @@ int builder_depth(builder b) asm "BDEPTH";
|
|||
-}
|
||||
|
||||
;;; Creates a new empty `builder`.
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
|
||||
;;; Converts a `builder` into an ordinary `cell`.
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;;; Stores a reference to `cell` [c] into `builder` [b].
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
|
||||
;;; Stores an unsigned [len]-bit integer `x` into `b` for `0 ≤ len ≤ 256`.
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
|
||||
;;; Stores a signed [len]-bit integer `x` into `b` for` 0 ≤ len ≤ 257`.
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
|
||||
|
||||
;;; Stores `slice` [s] into `builder` [b]
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
|
||||
;;; Stores (serializes) an integer [x] in the range `0..2^128 − 1` into `builder` [b].
|
||||
;;; The serialization of [x] consists of a 4-bit unsigned big-endian integer `l`,
|
||||
|
@ -433,17 +433,17 @@ builder store_slice(builder b, slice s) asm "STSLICER";
|
|||
;;; If [x] does not belong to the supported range, a range check exception is thrown.
|
||||
;;;
|
||||
;;; Store amounts of TonCoins to the builder as VarUInteger 16
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) asm "STGRAMS";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) pure asm "STGRAMS";
|
||||
|
||||
;;; Stores dictionary `D` represented by `cell` [c] or `null` into `builder` [b].
|
||||
;;; In other words, stores a `1`-bit and a reference to [c] if [c] is not `null` and `0`-bit otherwise.
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
;;; Stores (Maybe ^Cell) to builder:
|
||||
;;; if cell is null store 1 zero bit
|
||||
;;; otherwise store 1 true bit and ref to cell
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
|
||||
{-
|
||||
|
@ -485,22 +485,22 @@ builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
|||
|
||||
;;; Loads from slice [s] the only prefix that is a valid `MsgAddress`,
|
||||
;;; and returns both this prefix `s'` and the remainder `s''` of [s] as slices.
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
|
||||
;;; Decomposes slice [s] containing a valid `MsgAddress` into a `tuple t` with separate fields of this `MsgAddress`.
|
||||
;;; If [s] is not a valid `MsgAddress`, a cell deserialization exception is thrown.
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
|
||||
;;; Parses slice [s] containing a valid `MsgAddressInt` (usually a `msg_addr_std`),
|
||||
;;; applies rewriting from the anycast (if present) to the same-length prefix of the address,
|
||||
;;; and returns both the workchain and the 256-bit address as integers.
|
||||
;;; If the address is not 256-bit, or if [s] is not a valid serialization of `MsgAddressInt`,
|
||||
;;; throws a cell deserialization exception.
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
|
||||
;;; A variant of [parse_std_addr] that returns the (rewritten) address as a slice [s],
|
||||
;;; even if it is not exactly 256 bit long (represented by a `msg_addr_var`).
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
{-
|
||||
# Dictionary primitives
|
||||
|
@ -509,116 +509,116 @@ tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
|||
|
||||
;;; Sets the value associated with [key_len]-bit key signed index in dictionary [dict] to [value] (cell),
|
||||
;;; and returns the resulting dictionary.
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
|
||||
;;; Sets the value associated with [key_len]-bit key unsigned index in dictionary [dict] to [value] (cell),
|
||||
;;; and returns the resulting dictionary.
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
|
||||
;;; Creates an empty dictionary, which is actually a null value. Equivalent to PUSHNULL
|
||||
cell new_dict() asm "NEWDICT";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
;;; Checks whether a dictionary is empty. Equivalent to cell_null?.
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
|
||||
{- Prefix dictionary primitives -}
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
;;; Returns the value of the global configuration parameter with integer index `i` as a `cell` or `null` value.
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
;;; Checks whether c is a null. Note, that FunC also has polymorphic null? built-in.
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
;;; Creates an output action which would reserve exactly amount nanotoncoins (if mode = 0), at most amount nanotoncoins (if mode = 2), or all but amount nanotoncoins (if mode = 1 or mode = 3), from the remaining balance of the account. It is roughly equivalent to creating an outbound message carrying amount nanotoncoins (or b − amount nanotoncoins, where b is the remaining balance) to oneself, so that the subsequent output actions would not be able to spend more money than the remainder. Bit +2 in mode means that the external action does not fail if the specified amount cannot be reserved; instead, all remaining balance is reserved. Bit +8 in mode means `amount <- -amount` before performing any further actions. Bit +4 in mode means that amount is increased by the original balance of the current account (before the compute phase), including all extra currencies, before performing any other checks and actions. Currently, amount must be a non-negative integer, and mode must be in the range 0..15.
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
;;; Similar to raw_reserve, but also accepts a dictionary extra_amount (represented by a cell or null) with extra currencies. In this way currencies other than TonCoin can be reserved.
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
;;; Sends a raw message contained in msg, which should contain a correctly serialized object Message X, with the only exception that the source address is allowed to have dummy value addr_none (to be automatically replaced with the current smart contract address), and ihr_fee, fwd_fee, created_lt and created_at fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). Integer parameter mode contains the flags. Currently mode = 0 is used for ordinary messages; mode = 128 is used for messages that are to carry all the remaining balance of the current smart contract (instead of the value originally indicated in the message); mode = 64 is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount); mode' = mode + 1 means that the sender wants to pay transfer fees separately; mode' = mode + 2 means that any errors arising while processing this message during the action phase should be ignored. Finally, mode' = mode + 32 means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with +128.
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
;;; Creates an output action that would change this smart contract code to that given by cell new_code. Notice that this change will take effect only after the successful termination of the current run of the smart contract
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
;;; Generates a new pseudo-random unsigned 256-bit integer x. The algorithm is as follows: if r is the old value of the random seed, considered as a 32-byte array (by constructing the big-endian representation of an unsigned 256-bit integer), then its sha512(r) is computed; the first 32 bytes of this hash are stored as the new value r' of the random seed, and the remaining 32 bytes are returned as the next random value x.
|
||||
int random() impure asm "RANDU256";
|
||||
int random() asm "RANDU256";
|
||||
;;; Generates a new pseudo-random integer z in the range 0..range−1 (or range..−1, if range < 0). More precisely, an unsigned random value x is generated as in random; then z := x * range / 2^256 is computed.
|
||||
int rand(int range) impure asm "RAND";
|
||||
int rand(int range) asm "RAND";
|
||||
;;; Returns the current random seed as an unsigned 256-bit Integer.
|
||||
int get_seed() asm "RANDSEED";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
;;; Sets the random seed to unsigned 256-bit seed.
|
||||
() set_seed(int) impure asm "SETRAND";
|
||||
() set_seed(int) asm "SETRAND";
|
||||
;;; Mixes unsigned 256-bit integer x into the random seed r by setting the random seed to sha256 of the concatenation of two 32-byte strings: the first with the big-endian representation of the old seed r, and the second with the big-endian representation of x.
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
;;; Equivalent to randomize(cur_lt());.
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
;;; Checks whether the data parts of two slices coinside
|
||||
int equal_slice_bits (slice a, slice b) asm "SDEQ";
|
||||
int equal_slice_bits (slice a, slice b) pure asm "SDEQ";
|
||||
|
||||
;;; Concatenates two builders
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -1,208 +1,208 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
|
|
@ -1,211 +1,211 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
builder store_coins(builder b, int x) asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDVARUINT16";
|
||||
builder store_coins(builder b, int x) pure asm "STVARUINT16";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDVARUINT16";
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
|
@ -10,7 +10,7 @@ _ skipBits(slice s, int len) { return skip_bits(s, len); }
|
|||
|
||||
(cell, int) tryDictDelete(cell dict, int keyLen, slice index) { return dict_delete?(dict, keyLen, index); }
|
||||
|
||||
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure {
|
||||
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) {
|
||||
var cs = in_msg_cell.begin_parse();
|
||||
var flags = cs~load_uint(4); ;; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool
|
||||
if (flags & 1) {
|
||||
|
@ -74,7 +74,7 @@ _ skipBits(slice s, int len) { return skip_bits(s, len); }
|
|||
}
|
||||
}
|
||||
|
||||
() recv_external(slice in_msg) impure {
|
||||
() recv_external(slice in_msg) {
|
||||
var signature = in_msg~load_bits(512);
|
||||
var cs = in_msg;
|
||||
var (subwallet_id, valid_until, msg_seqno) = (cs~load_uint(32), cs~load_uint(32), cs~load_uint(32));
|
||||
|
|
|
@ -21,13 +21,13 @@ int parse_work_addr(slice cs) {
|
|||
;; Custom Commands
|
||||
;;
|
||||
|
||||
(int) equal_slices (slice s1, slice s2) asm "SDEQ";
|
||||
builder store_builder(builder to, builder what) asm(what to) "STB";
|
||||
builder store_builder_ref(builder to, builder what) asm(what to) "STBREFR";
|
||||
(slice, cell) load_maybe_cell(slice s) asm( -> 1 0) "LDDICT";
|
||||
(int) mod (int x, int y) asm "MOD";
|
||||
builder store_coins(builder b, int x) asm "STGRAMS";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(int) equal_slices (slice s1, slice s2) pure asm "SDEQ";
|
||||
builder store_builder(builder to, builder what) pure asm(what to) "STB";
|
||||
builder store_builder_ref(builder to, builder what) pure asm(what to) "STBREFR";
|
||||
(slice, cell) load_maybe_cell(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
(int) mod (int x, int y) pure asm "MOD";
|
||||
builder store_coins(builder b, int x) pure asm "STGRAMS";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
|
||||
|
||||
;;
|
||||
|
@ -182,4 +182,4 @@ builder store_withdraw_delayed(builder b) inline {
|
|||
.store_uint(555062058613674355757418046597367430905687018487295295368960255172568430, 240) ;; 'Please, retry the command when'
|
||||
.store_text_space()
|
||||
.store_uint(45434371896731988359547695118970428857702208118225198, 176); ;; 'your balance is ready.'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,212 +1,212 @@
|
|||
;; Standard library for funC
|
||||
;;
|
||||
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
int now() asm "NOW";
|
||||
slice my_address() asm "MYADDR";
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
int cur_lt() asm "LTIME";
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int now() pure asm "NOW";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(cell c, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
;; () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() commit() impure asm "COMMIT";
|
||||
() buy_gas(int gram) impure asm "BUYGAS";
|
||||
() accept_message() asm "ACCEPT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
() commit() asm "COMMIT";
|
||||
() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
int min(int x, int y) asm "MIN";
|
||||
int max(int x, int y) asm "MAX";
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
int abs(int x) asm "ABS";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
;; (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() asm "NEWDICT";
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
int random() impure asm "RANDU256";
|
||||
int rand(int range) impure asm "RAND";
|
||||
int get_seed() asm "RANDSEED";
|
||||
int set_seed() impure asm "SETRAND";
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
int random() asm "RANDU256";
|
||||
int rand(int range) asm "RAND";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
int set_seed() asm "SETRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
|
||||
int equal_slices (slice a, slice b) asm "SDEQ";
|
||||
int builder_null?(builder b) asm "ISNULL";
|
||||
int equal_slices (slice a, slice b) pure asm "SDEQ";
|
||||
int builder_null?(builder b) pure asm "ISNULL";
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> (tuple, ()) tpush(tuple t, X x) asm "TPUSH";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> (tuple, ()) tpush(tuple t, X x) pure asm "TPUSH";
|
||||
tuple emptyTuple() { return empty_tuple(); }
|
||||
forall X -> (tuple, ()) tuplePush(tuple t, X value) { return tpush(t, value); }
|
||||
|
||||
tuple asm_func_1(int x, int y, int z) asm "3 TUPLE";
|
||||
tuple asm_func_2(int x, int y, int z) asm (z y x -> 0) "3 TUPLE";
|
||||
tuple asm_func_3(int x, int y, int z) asm (y z x -> 0) "3 TUPLE";
|
||||
tuple asm_func_4(int a, (int, (int, int)) b, int c) asm (b a c -> 0) "5 TUPLE";
|
||||
tuple asm_func_1(int x, int y, int z) pure asm "3 TUPLE";
|
||||
tuple asm_func_2(int x, int y, int z) pure asm (z y x -> 0) "3 TUPLE";
|
||||
tuple asm_func_3(int x, int y, int z) pure asm (y z x -> 0) "3 TUPLE";
|
||||
tuple asm_func_4(int a, (int, (int, int)) b, int c) pure asm (b a c -> 0) "5 TUPLE";
|
||||
|
||||
_ asmFunc1(int x, int y, int z) { return asm_func_1(x, y, z); }
|
||||
_ asmFunc3(int x, int y, int z) { return asm_func_3(x, y, z); }
|
||||
|
||||
(tuple, ()) asm_func_modify(tuple a, int b, int c) asm (c b a -> 0) "SWAP TPUSH SWAP TPUSH";
|
||||
(tuple, ()) asm_func_modify(tuple a, int b, int c) pure asm (c b a -> 0) "SWAP TPUSH SWAP TPUSH";
|
||||
(tuple, ()) asmFuncModify(tuple a, int b, int c) { return asm_func_modify(a, b, c); }
|
||||
|
||||
global tuple t;
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
;; This works with ~functions also. And even works with wrappers of wrappers.
|
||||
;; Moreover, such wrappers can reorder input parameters, see a separate test camel2.fc.
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
|
||||
builder beginCell() { return begin_cell(); }
|
||||
cell endCell(builder b) { return end_cell(b); }
|
||||
|
@ -21,19 +21,19 @@ builder storeRef(builder b, cell c) { return store_ref(b, c); }
|
|||
builder storeUint(builder b, int i, int bw) { return store_uint(b, i, bw); }
|
||||
|
||||
;; 'inline' is not needed actually, but if it exists, it's just ignored
|
||||
slice beginParse(cell c) inline { return begin_parse(c); }
|
||||
slice skipBits(slice s, int len) inline { return skip_bits(s, len); }
|
||||
(slice, ()) ~skipBits(slice s, int len) inline { return ~skip_bits(s, len); }
|
||||
(slice, int) ~loadUint(slice s, int len) inline { return load_uint(s, len); }
|
||||
slice beginParse(cell c) pure inline { return begin_parse(c); }
|
||||
slice skipBits(slice s, int len) pure inline { return skip_bits(s, len); }
|
||||
(slice, ()) ~skipBits(slice s, int len) pure inline { return ~skip_bits(s, len); }
|
||||
(slice, int) ~loadUint(slice s, int len) pure inline { return load_uint(s, len); }
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize(cell c, int maxCells) impure { return compute_data_size(c, maxCells); }
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize(cell c, int maxCells) { return compute_data_size(c, maxCells); }
|
||||
|
||||
cell new_dict() asm "NEWDICT";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
|
||||
cell dict::new() { return new_dict(); }
|
||||
cell dict::iset(cell dict, int keyLen, int index, slice value) { return idict_set(dict, keyLen, index, value); }
|
||||
|
@ -41,11 +41,11 @@ cell dict::iset(cell dict, int keyLen, int index, slice value) { return idict_se
|
|||
(slice, int) dict::tryIGet(cell dict, int keyLen, int index) { return idict_get?(dict, keyLen, index); }
|
||||
(int, slice, int) dict::tryIGetMin(cell dict, int keyLen) { return idict_get_min?(dict, keyLen); }
|
||||
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
|
||||
tuple emptyTuple() { return empty_tuple(); }
|
||||
tuple emptyTuple1() { return emptyTuple(); }
|
||||
|
@ -54,19 +54,19 @@ forall X -> tuple tuplePush(tuple t, X value) { return tpush(t, value); }
|
|||
forall X -> (tuple, ()) ~tuplePush(tuple t, X value) { return ~tpush(t, value); }
|
||||
forall X -> X tupleAt(tuple t, int index) { return at(t, index); }
|
||||
forall X1, Y2, Z3 -> Y2 tripleSecond([X1, Y2, Z3] p) { return triple_second(p); }
|
||||
forall X -> X nullValue() asm "PUSHNULL";
|
||||
forall X -> X nullValue() pure asm "PUSHNULL";
|
||||
|
||||
() throwIf(int excNo, int condition) impure { return throw_if(excNo, condition); }
|
||||
() throwIf(int excNo, int condition) { return throw_if(excNo, condition); }
|
||||
|
||||
tuple initial1(tuple x) { return x; }
|
||||
_ initial2(x) { return initial1(x); }
|
||||
|
||||
int add(int x, int y) { return x + y; } ;; this is also a wrapper, as its body is _+_(x,y)
|
||||
|
||||
() fake1(int a, int b, int c) impure asm(a b c) "DROP DROP DROP";
|
||||
() fake2(int a, int b, int c) impure asm(b c a) "DROP DROP DROP";
|
||||
() fake3(int a, int b, int c) impure asm(c a b) "DROP DROP DROP";
|
||||
() fake4(int a, int b, int c) impure asm(c b a) "DROP DROP DROP";
|
||||
() fake1(int a, int b, int c) asm(a b c) "DROP DROP DROP";
|
||||
() fake2(int a, int b, int c) asm(b c a) "DROP DROP DROP";
|
||||
() fake3(int a, int b, int c) asm(c a b) "DROP DROP DROP";
|
||||
() fake4(int a, int b, int c) asm(c b a) "DROP DROP DROP";
|
||||
|
||||
() fake1Wrapper(int a, int b, int c) { return fake1(a, b, c); }
|
||||
() fake2Wrapper(int a, int b, int c) { return fake2(a, b, c); }
|
||||
|
@ -95,9 +95,9 @@ int add(int x, int y) { return x + y; } ;; this is also a wrapper, as its body i
|
|||
;; skip 64 bits
|
||||
minv~skipBits(16);
|
||||
minv = minv.skipBits(16);
|
||||
minv.skipBits(16000); ;; does nothing
|
||||
minv.skipBits(11); ;; does nothing
|
||||
(minv, _) = ~skipBits(minv, 16);
|
||||
skipBits(minv, 16000); ;; does nothing
|
||||
skipBits(minv, 11); ;; does nothing
|
||||
minv~skipBits(16);
|
||||
;; load 3*32
|
||||
var minv1 = minv~loadUint(32);
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
#pragma compute-asm-ltr;
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
|
||||
builder beginCell() { return begin_cell(); }
|
||||
cell endCell(builder b) { return end_cell(b); }
|
||||
|
@ -19,13 +19,13 @@ builder storeRef2(cell c, builder b) { return store_ref(b, c); }
|
|||
builder storeUint1(builder b, int x, int bw) { return store_uint(b, x, bw); }
|
||||
builder storeUint2(builder b, int bw, int x) { return store_uint(b, x, bw); }
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize1(cell c, int maxCells) impure { return compute_data_size(c, maxCells); }
|
||||
(int, int, int) computeDataSize2(int maxCells, cell c) impure { return compute_data_size(c, maxCells); }
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) pure asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize1(cell c, int maxCells) { return compute_data_size(c, maxCells); }
|
||||
(int, int, int) computeDataSize2(int maxCells, cell c) { return compute_data_size(c, maxCells); }
|
||||
|
||||
() throwIf(int condition, int excNo) impure { return throw_if(excNo, condition); }
|
||||
() throwIf(int condition, int excNo) { return throw_if(excNo, condition); }
|
||||
|
||||
() fake(int a, int b, int c) impure asm "DROP DROP DROP";
|
||||
() fake(int a, int b, int c) asm "DROP DROP DROP";
|
||||
() fake2(int b, int c, int a) { return fake(a,b,c); }
|
||||
() fake3(int c, int a, int b) { return fake(a,b,c); }
|
||||
() fake4(int c, int b, int a) { return fake(a,b,c); }
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
;; (save to a variable, return from a function, etc.)
|
||||
;; it also works, since a function becomes codegenerated (though direct calls are expectedly inlined).
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
|
||||
builder beginCell() { return begin_cell(); }
|
||||
cell endCell(builder b) { return end_cell(b); }
|
||||
builder storeRef(builder b, cell c) { return store_ref(b, c); }
|
||||
builder storeUint3(int i, int bw, builder b) { return store_uint(b, i, bw); }
|
||||
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize2(int maxCells, cell c) impure { return compute_data_size(c, maxCells); }
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
(int, int, int) computeDataSize2(int maxCells, cell c) { return compute_data_size(c, maxCells); }
|
||||
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
|
||||
tuple emptyTuple() { return empty_tuple(); }
|
||||
forall X -> tuple tuplePush(tuple t, X value) { return tpush(t, value); }
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
;; Here we test that a just-return function is not a valid wrapper, it will not be inlined.
|
||||
;; (doesn't use all arguments, has different pureness, has method_id, etc.)
|
||||
|
||||
builder begin_cell() asm "NEWC";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
cell get_data() asm "c4 PUSH";
|
||||
tuple empty_tuple() asm "NIL";
|
||||
forall X -> (tuple, ()) tpush(tuple t, X x) asm "TPUSH";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
forall X -> (tuple, ()) tpush(tuple t, X x) pure asm "TPUSH";
|
||||
|
||||
builder storeUint(builder b, int x, int unused) { return store_uint(b, x, x); }
|
||||
() throwIf(int excNo, int cond) impure { throw_if(excNo, cond); }
|
||||
() throwIf2(int excNo, int cond) { return throw_if(excNo, cond); }
|
||||
() throwIf(int excNo, int cond) { throw_if(excNo, cond); }
|
||||
|
||||
_ initial1(x) { return x; }
|
||||
_ initial2(x) { return initial1(x); }
|
||||
|
||||
tuple asm_func_4(int a, (int, (int, int)) b, int c) asm (b a c -> 0) "5 TUPLE";
|
||||
tuple asm_func_4(int a, (int, (int, int)) b, int c) pure asm (b a c -> 0) "5 TUPLE";
|
||||
_ asmFunc4(int a, (int, (int, int)) b, int c) { return asm_func_4(a, b, c); }
|
||||
|
||||
int postpone_elections() {
|
||||
|
@ -28,7 +27,6 @@ int postpone_elections() {
|
|||
set_data(c);
|
||||
slice s = get_data().begin_parse();
|
||||
throwIf(101, 0);
|
||||
var unused = throwIf2(101, 0);
|
||||
return s~load_uint(8);
|
||||
}
|
||||
|
||||
|
@ -90,7 +88,6 @@ TESTCASE | -1 | 97 | 97
|
|||
|
||||
@fif_codegen DECLPROC storeUint
|
||||
@fif_codegen DECLPROC throwIf
|
||||
@fif_codegen DECLPROC throwIf2
|
||||
@fif_codegen DECLPROC postpone_elections
|
||||
@fif_codegen 74435 DECLMETHOD test2
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ const int int240 = ((int1 + int2) * 10) << 3;
|
|||
|
||||
int iget240() { return int240; }
|
||||
|
||||
builder newc() asm "NEWC";
|
||||
slice endcs(builder b) asm "ENDC" "CTOS";
|
||||
int sdeq (slice s1, slice s2) asm "SDEQ";
|
||||
builder stslicer(builder b, slice s) asm "STSLICER";
|
||||
builder newc() pure asm "NEWC";
|
||||
slice endcs(builder b) pure asm "ENDC" "CTOS";
|
||||
int sdeq (slice s1, slice s2) pure asm "SDEQ";
|
||||
builder stslicer(builder b, slice s) pure asm "STSLICER";
|
||||
|
||||
builder storeUint(builder b, int x, int len) { return store_uint(b, x, len); }
|
||||
_ endSlice(builder b) { return endcs(b); }
|
||||
() throwUnless(int excno, int cond) impure { return throw_unless(excno, cond); }
|
||||
() throwUnless(int excno, int cond) { return throw_unless(excno, cond); }
|
||||
|
||||
_ main() {
|
||||
int i1 = iget1();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
global int g;
|
||||
|
||||
_ foo_repeat() impure inline {
|
||||
_ foo_repeat() inline {
|
||||
g = 1;
|
||||
repeat(5) {
|
||||
g *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
int foo_until() impure inline {
|
||||
int foo_until() inline {
|
||||
g = 1;
|
||||
int i = 0;
|
||||
do {
|
||||
|
@ -17,7 +17,7 @@ int foo_until() impure inline {
|
|||
return i;
|
||||
}
|
||||
|
||||
int foo_while() impure inline {
|
||||
int foo_while() inline {
|
||||
g = 1;
|
||||
int i = 0;
|
||||
while (i < 10) {
|
||||
|
|
|
@ -26,9 +26,9 @@ int string_crc32() method_id {
|
|||
return "transfer(slice, int)"c;
|
||||
}
|
||||
|
||||
builder newc() asm "NEWC";
|
||||
builder newc() pure asm "NEWC";
|
||||
slice endcs(builder b) asm "ENDC" "CTOS";
|
||||
int sdeq (slice s1, slice s2) asm "SDEQ";
|
||||
int sdeq (slice s1, slice s2) pure asm "SDEQ";
|
||||
|
||||
_ main() {
|
||||
slice s_ascii = ascii_slice();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "../../../smartcont/mathlib.fc";
|
||||
|
||||
forall X -> (tuple, ()) ~tset(tuple t, int idx, X val) asm(t val idx) "SETINDEXVAR";
|
||||
forall X -> (tuple, ()) ~tset(tuple t, int idx, X val) pure asm(t val idx) "SETINDEXVAR";
|
||||
|
||||
;; computes 1-acos(x)/Pi by a very simple, extremely slow (~70k gas) and imprecise method
|
||||
;; fixed256 acos_prepare_slow(fixed255 x);
|
||||
|
|
|
@ -50,7 +50,7 @@ SymDef* predefine_builtin_func(std::string name, TypeExpr* func_type) {
|
|||
template <typename T>
|
||||
SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const T& func, bool impure = false) {
|
||||
SymDef* def = predefine_builtin_func(name, func_type);
|
||||
def->value = new SymValAsmFunc{func_type, func, impure};
|
||||
def->value = new SymValAsmFunc{func_type, func, !impure};
|
||||
#ifdef FUNC_DEBUG
|
||||
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
|
||||
#endif
|
||||
|
@ -61,7 +61,7 @@ template <typename T>
|
|||
SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const T& func, std::initializer_list<int> arg_order,
|
||||
std::initializer_list<int> ret_order = {}, bool impure = false) {
|
||||
SymDef* def = predefine_builtin_func(name, func_type);
|
||||
def->value = new SymValAsmFunc{func_type, func, arg_order, ret_order, impure};
|
||||
def->value = new SymValAsmFunc{func_type, func, arg_order, ret_order, !impure};
|
||||
#ifdef FUNC_DEBUG
|
||||
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
|
||||
#endif
|
||||
|
@ -72,7 +72,7 @@ SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const AsmOp&
|
|||
std::initializer_list<int> arg_order, std::initializer_list<int> ret_order = {},
|
||||
bool impure = false) {
|
||||
SymDef* def = predefine_builtin_func(name, func_type);
|
||||
def->value = new SymValAsmFunc{func_type, make_simple_compile(macro), arg_order, ret_order, impure};
|
||||
def->value = new SymValAsmFunc{func_type, make_simple_compile(macro), arg_order, ret_order, !impure};
|
||||
#ifdef FUNC_DEBUG
|
||||
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
|
||||
#endif
|
||||
|
|
|
@ -108,6 +108,7 @@ enum Keyword {
|
|||
_Forall,
|
||||
_Asm,
|
||||
_Impure,
|
||||
_Pure,
|
||||
_Global,
|
||||
_Extern,
|
||||
_Inline,
|
||||
|
@ -754,10 +755,9 @@ struct CodeBlob {
|
|||
|
||||
struct SymVal : sym::SymValBase {
|
||||
TypeExpr* sym_type;
|
||||
bool impure;
|
||||
bool auto_apply{false};
|
||||
SymVal(int _type, int _idx, TypeExpr* _stype = nullptr, bool _impure = false)
|
||||
: sym::SymValBase(_type, _idx), sym_type(_stype), impure(_impure) {
|
||||
SymVal(int _type, int _idx, TypeExpr* _stype = nullptr)
|
||||
: sym::SymValBase(_type, _idx), sym_type(_stype) {
|
||||
}
|
||||
~SymVal() override = default;
|
||||
TypeExpr* get_type() const {
|
||||
|
@ -771,6 +771,7 @@ struct SymValFunc : SymVal {
|
|||
flagInlineRef = 2, // function marked `inline_ref`
|
||||
flagWrapsAnotherF = 4, // (T) thisF(...args) { return anotherF(...args); } (calls to thisF will be replaced)
|
||||
flagUsedAsNonCall = 8, // used not only as `f()`, but as a 1-st class function (assigned to var, pushed to tuple, etc.)
|
||||
flagMarkedAsPure = 16, // declared as `pure`, can't call impure and access globals, unused invocations are optimized out
|
||||
};
|
||||
|
||||
td::RefInt256 method_id; // todo why int256? it's small
|
||||
|
@ -780,11 +781,10 @@ struct SymValFunc : SymVal {
|
|||
std::string name; // seeing function name in debugger makes it much easier to delve into FunC sources
|
||||
#endif
|
||||
~SymValFunc() override = default;
|
||||
SymValFunc(int val, TypeExpr* _ft, bool _impure = false) : SymVal(_Func, val, _ft, _impure) {
|
||||
}
|
||||
SymValFunc(int val, TypeExpr* _ft, std::initializer_list<int> _arg_order, std::initializer_list<int> _ret_order = {},
|
||||
bool _impure = false)
|
||||
: SymVal(_Func, val, _ft, _impure), arg_order(_arg_order), ret_order(_ret_order) {
|
||||
SymValFunc(int val, TypeExpr* _ft, bool marked_as_pure)
|
||||
: SymVal(_Func, val, _ft), flags(marked_as_pure ? flagMarkedAsPure : 0) {}
|
||||
SymValFunc(int val, TypeExpr* _ft, std::initializer_list<int> _arg_order, std::initializer_list<int> _ret_order, bool marked_as_pure)
|
||||
: SymVal(_Func, val, _ft), flags(marked_as_pure ? flagMarkedAsPure : 0), arg_order(_arg_order), ret_order(_ret_order) {
|
||||
}
|
||||
|
||||
const std::vector<int>* get_arg_order() const {
|
||||
|
@ -804,12 +804,15 @@ struct SymValFunc : SymVal {
|
|||
bool is_just_wrapper_for_another_f() const {
|
||||
return flags & flagWrapsAnotherF;
|
||||
}
|
||||
bool is_marked_as_pure() const {
|
||||
return flags & flagMarkedAsPure;
|
||||
}
|
||||
};
|
||||
|
||||
struct SymValCodeFunc : SymValFunc {
|
||||
CodeBlob* code;
|
||||
~SymValCodeFunc() override = default;
|
||||
SymValCodeFunc(int val, TypeExpr* _ft, bool _impure = false) : SymValFunc(val, _ft, _impure), code(nullptr) {
|
||||
SymValCodeFunc(int val, TypeExpr* _ft, bool marked_as_pure) : SymValFunc(val, _ft, marked_as_pure), code(nullptr) {
|
||||
}
|
||||
bool does_need_codegen() const;
|
||||
};
|
||||
|
@ -1716,25 +1719,25 @@ struct SymValAsmFunc : SymValFunc {
|
|||
compile_func_t ext_compile;
|
||||
td::uint64 crc;
|
||||
~SymValAsmFunc() override = default;
|
||||
SymValAsmFunc(TypeExpr* ft, const AsmOp& _macro, bool impure = false)
|
||||
: SymValFunc(-1, ft, impure), simple_compile(make_simple_compile(_macro)) {
|
||||
SymValAsmFunc(TypeExpr* ft, const AsmOp& _macro, bool marked_as_pure)
|
||||
: SymValFunc(-1, ft, marked_as_pure), simple_compile(make_simple_compile(_macro)) {
|
||||
}
|
||||
SymValAsmFunc(TypeExpr* ft, std::vector<AsmOp> _macro, bool impure = false)
|
||||
: SymValFunc(-1, ft, impure), ext_compile(make_ext_compile(std::move(_macro))) {
|
||||
SymValAsmFunc(TypeExpr* ft, std::vector<AsmOp> _macro, bool marked_as_pure)
|
||||
: SymValFunc(-1, ft, marked_as_pure), ext_compile(make_ext_compile(std::move(_macro))) {
|
||||
}
|
||||
SymValAsmFunc(TypeExpr* ft, simple_compile_func_t _compile, bool impure = false)
|
||||
: SymValFunc(-1, ft, impure), simple_compile(std::move(_compile)) {
|
||||
SymValAsmFunc(TypeExpr* ft, simple_compile_func_t _compile, bool marked_as_pure)
|
||||
: SymValFunc(-1, ft, marked_as_pure), simple_compile(std::move(_compile)) {
|
||||
}
|
||||
SymValAsmFunc(TypeExpr* ft, compile_func_t _compile, bool impure = false)
|
||||
: SymValFunc(-1, ft, impure), ext_compile(std::move(_compile)) {
|
||||
SymValAsmFunc(TypeExpr* ft, compile_func_t _compile, bool marked_as_pure)
|
||||
: SymValFunc(-1, ft, marked_as_pure), ext_compile(std::move(_compile)) {
|
||||
}
|
||||
SymValAsmFunc(TypeExpr* ft, simple_compile_func_t _compile, std::initializer_list<int> arg_order,
|
||||
std::initializer_list<int> ret_order = {}, bool impure = false)
|
||||
: SymValFunc(-1, ft, arg_order, ret_order, impure), simple_compile(std::move(_compile)) {
|
||||
std::initializer_list<int> ret_order = {}, bool marked_as_pure = false)
|
||||
: SymValFunc(-1, ft, arg_order, ret_order, marked_as_pure), simple_compile(std::move(_compile)) {
|
||||
}
|
||||
SymValAsmFunc(TypeExpr* ft, compile_func_t _compile, std::initializer_list<int> arg_order,
|
||||
std::initializer_list<int> ret_order = {}, bool impure = false)
|
||||
: SymValFunc(-1, ft, arg_order, ret_order, impure), ext_compile(std::move(_compile)) {
|
||||
std::initializer_list<int> ret_order = {}, bool marked_as_pure = false)
|
||||
: SymValFunc(-1, ft, arg_order, ret_order, marked_as_pure), ext_compile(std::move(_compile)) {
|
||||
}
|
||||
bool compile(AsmOpList& dest, std::vector<VarDescr>& out, std::vector<VarDescr>& in, const SrcLocation& where) const;
|
||||
};
|
||||
|
|
|
@ -120,6 +120,7 @@ void define_keywords() {
|
|||
.add_keyword("global", Kw::_Global)
|
||||
.add_keyword("asm", Kw::_Asm)
|
||||
.add_keyword("impure", Kw::_Impure)
|
||||
.add_keyword("pure", Kw::_Pure)
|
||||
.add_keyword("inline", Kw::_Inline)
|
||||
.add_keyword("inline_ref", Kw::_InlineRef)
|
||||
.add_keyword("auto_apply", Kw::_AutoApply)
|
||||
|
|
|
@ -385,8 +385,8 @@ void parse_global_var_decls(Lexer& lex) {
|
|||
lex.expect(';');
|
||||
}
|
||||
|
||||
SymValCodeFunc* make_new_glob_func(SymDef* func_sym, TypeExpr* func_type, bool impure = false) {
|
||||
SymValCodeFunc* res = new SymValCodeFunc{glob_func_cnt, func_type, impure};
|
||||
SymValCodeFunc* make_new_glob_func(SymDef* func_sym, TypeExpr* func_type, bool marked_as_pure) {
|
||||
SymValCodeFunc* res = new SymValCodeFunc{glob_func_cnt, func_type, marked_as_pure};
|
||||
#ifdef FUNC_DEBUG
|
||||
res->name = func_sym->name();
|
||||
#endif
|
||||
|
@ -649,6 +649,7 @@ Expr* parse_expr100(Lexer& lex, CodeBlob& code, bool nv) {
|
|||
}
|
||||
res->sym = sym;
|
||||
SymVal* val = nullptr;
|
||||
bool impure = false;
|
||||
if (sym) {
|
||||
val = dynamic_cast<SymVal*>(sym->value);
|
||||
}
|
||||
|
@ -658,6 +659,7 @@ Expr* parse_expr100(Lexer& lex, CodeBlob& code, bool nv) {
|
|||
res->e_type = val->get_type();
|
||||
res->cls = Expr::_GlobFunc;
|
||||
auto_apply = val->auto_apply;
|
||||
impure = !dynamic_cast<SymValFunc*>(val)->is_marked_as_pure();
|
||||
} else if (val->idx < 0) {
|
||||
lex.cur().error_at("accessing variable `", "` being defined");
|
||||
} else {
|
||||
|
@ -666,7 +668,7 @@ Expr* parse_expr100(Lexer& lex, CodeBlob& code, bool nv) {
|
|||
// std::cerr << "accessing variable " << lex.cur().str << " : " << res->e_type << std::endl;
|
||||
}
|
||||
// std::cerr << "accessing symbol " << lex.cur().str << " : " << res->e_type << (val->impure ? " (impure)" : " (pure)") << std::endl;
|
||||
res->flags = Expr::_IsLvalue | Expr::_IsRvalue | (val->impure ? Expr::_IsImpure : 0);
|
||||
res->flags = Expr::_IsLvalue | Expr::_IsRvalue | (impure ? Expr::_IsImpure : 0);
|
||||
}
|
||||
if (auto_apply) {
|
||||
int impure = res->flags & Expr::_IsImpure;
|
||||
|
@ -757,7 +759,7 @@ Expr* parse_expr80(Lexer& lex, CodeBlob& code, bool nv) {
|
|||
res = new Expr{Expr::_Apply, name, {obj, x}};
|
||||
}
|
||||
res->here = loc;
|
||||
res->flags = Expr::_IsRvalue | (val->impure ? Expr::_IsImpure : 0);
|
||||
res->flags = Expr::_IsRvalue | (val->is_marked_as_pure() ? 0 : Expr::_IsImpure);
|
||||
res->deduce_type(lex.cur());
|
||||
if (modify) {
|
||||
auto tmp = res;
|
||||
|
@ -1242,7 +1244,7 @@ CodeBlob* parse_func_body(Lexer& lex, FormalArgList arg_list, TypeExpr* ret_type
|
|||
}
|
||||
|
||||
SymValAsmFunc* parse_asm_func_body(Lexer& lex, TypeExpr* func_type, const FormalArgList& arg_list, TypeExpr* ret_type,
|
||||
bool impure = false) {
|
||||
bool marked_as_pure) {
|
||||
auto loc = lex.cur().loc;
|
||||
lex.expect(_Asm);
|
||||
int cnt = (int)arg_list.size();
|
||||
|
@ -1346,14 +1348,14 @@ SymValAsmFunc* parse_asm_func_body(Lexer& lex, TypeExpr* func_type, const Formal
|
|||
for (const AsmOp& asm_op : asm_ops) {
|
||||
crc_s += asm_op.op;
|
||||
}
|
||||
crc_s.push_back(impure);
|
||||
crc_s.push_back(!marked_as_pure);
|
||||
for (const int& x : arg_order) {
|
||||
crc_s += std::string((const char*) (&x), (const char*) (&x + 1));
|
||||
}
|
||||
for (const int& x : ret_order) {
|
||||
crc_s += std::string((const char*) (&x), (const char*) (&x + 1));
|
||||
}
|
||||
auto res = new SymValAsmFunc{func_type, asm_ops, impure};
|
||||
auto res = new SymValAsmFunc{func_type, asm_ops, marked_as_pure};
|
||||
res->arg_order = std::move(arg_order);
|
||||
res->ret_order = std::move(ret_order);
|
||||
res->crc = td::crc64(crc_s);
|
||||
|
@ -1487,9 +1489,8 @@ void detect_if_function_just_wraps_another(SymValCodeFunc* v_current, const td::
|
|||
// 'return true;' (false, nil) are (surprisingly) also function calls, with auto_apply=true
|
||||
if (v_called->auto_apply)
|
||||
return;
|
||||
|
||||
// they must have the same pureness
|
||||
if (v_called->impure != v_current->impure || v_current->is_inline_ref())
|
||||
// if an original is marked `pure`, and this one doesn't, it's okay; just check for inline_ref storage
|
||||
if (v_current->is_inline_ref())
|
||||
return;
|
||||
|
||||
// ok, f_current is a wrapper
|
||||
|
@ -1513,8 +1514,16 @@ void parse_func_def(Lexer& lex) {
|
|||
Lexem func_name = lex.cur();
|
||||
lex.next();
|
||||
FormalArgList arg_list = parse_formal_args(lex);
|
||||
bool impure = (lex.tp() == _Impure);
|
||||
if (impure) {
|
||||
bool marked_as_pure = false;
|
||||
if (lex.tp() == _Impure) {
|
||||
static bool warning_shown = false;
|
||||
if (!warning_shown) {
|
||||
lex.cur().loc.show_warning("`impure` specifier is deprecated. All functions are impure by default, use `pure` to mark a function as pure");
|
||||
warning_shown = true;
|
||||
}
|
||||
lex.next();
|
||||
} else if (lex.tp() == _Pure) {
|
||||
marked_as_pure = true;
|
||||
lex.next();
|
||||
}
|
||||
int flags_inline = 0;
|
||||
|
@ -1577,7 +1586,7 @@ void parse_func_def(Lexer& lex) {
|
|||
}
|
||||
}
|
||||
if (lex.tp() == ';') {
|
||||
make_new_glob_func(func_sym, func_type, impure);
|
||||
make_new_glob_func(func_sym, func_type, marked_as_pure);
|
||||
lex.next();
|
||||
} else if (lex.tp() == '{') {
|
||||
if (dynamic_cast<SymValAsmFunc*>(func_sym_val)) {
|
||||
|
@ -1590,7 +1599,7 @@ void parse_func_def(Lexer& lex) {
|
|||
lex.cur().error("function `"s + func_name.str + "` has been already defined in an yet-unknown way");
|
||||
}
|
||||
} else {
|
||||
func_sym_code = make_new_glob_func(func_sym, func_type, impure);
|
||||
func_sym_code = make_new_glob_func(func_sym, func_type, marked_as_pure);
|
||||
}
|
||||
if (func_sym_code->code) {
|
||||
lex.cur().error("redefinition of function `"s + func_name.str + "`");
|
||||
|
@ -1603,7 +1612,7 @@ void parse_func_def(Lexer& lex) {
|
|||
detect_if_function_just_wraps_another(func_sym_code, method_id);
|
||||
} else {
|
||||
Lexem asm_lexem = lex.cur();
|
||||
SymValAsmFunc* asm_func = parse_asm_func_body(lex, func_type, arg_list, ret_type, impure);
|
||||
SymValAsmFunc* asm_func = parse_asm_func_body(lex, func_type, arg_list, ret_type, marked_as_pure);
|
||||
#ifdef FUNC_DEBUG
|
||||
asm_func->name = func_name.str;
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
int cell_hash(cell c)
|
||||
asm "HASHCU";
|
||||
|
@ -9,36 +9,36 @@ asm "HASHSU";
|
|||
int check_signature(int hash, slice signature, int public_key)
|
||||
asm "CHKSIGNU";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure
|
||||
;; () throw_if(int excno, int cond)
|
||||
;; asm "THROWARGIF";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(cell, slice) load_ref(slice s) asm "LDREF";
|
||||
(int, slice) zload_int(slice s, int len) asm "LDIX";
|
||||
(int, slice) zload_uint(slice s, int len) asm "LDUX";
|
||||
int zpreload_int(slice s, int len) asm "PLDIX";
|
||||
int zpreload_uint(slice s, int len) asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) asm "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell value, int index, cell dict, int key_len) asm "DICTISETREF";
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder store_ref(cell c, builder b) asm "STREF";
|
||||
builder zstore_uint(int x, builder b, int len) asm "STUX";
|
||||
builder zstore_int(int x, builder b, int len) asm "STIX";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(cell, slice) load_ref(slice s) pure asm "LDREF";
|
||||
(int, slice) zload_int(slice s, int len) pure asm "LDIX";
|
||||
(int, slice) zload_uint(slice s, int len) pure asm "LDUX";
|
||||
int zpreload_int(slice s, int len) pure asm "PLDIX";
|
||||
int zpreload_uint(slice s, int len) pure asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) pure asm "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell value, int index, cell dict, int key_len) pure asm "DICTISETREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
builder store_ref(cell c, builder b) pure asm "STREF";
|
||||
builder zstore_uint(int x, builder b, int len) pure asm "STUX";
|
||||
builder zstore_int(int x, builder b, int len) pure asm "STIX";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;; Simple configuration smart contract
|
||||
|
||||
() recv_internal(cell in_msg) impure {
|
||||
() recv_internal(cell in_msg) {
|
||||
;; do nothing for internal messages
|
||||
}
|
||||
|
||||
() recv_external(cell in_msg) impure {
|
||||
() recv_external(cell in_msg) {
|
||||
var (signature, cs0) = load_bits(begin_parse(in_msg), 512);
|
||||
var (msg_seqno, cs) = zload_uint(cs0, 32);
|
||||
(var valid_until, cs) = zload_uint(cs, 32);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
int cell_hash(cell c)
|
||||
asm "HASHCU";
|
||||
|
@ -9,36 +9,36 @@ asm "HASHSU";
|
|||
int check_signature(int hash, slice signature, int public_key)
|
||||
asm "CHKSIGNU";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure
|
||||
;; () throw_if(int excno, int cond)
|
||||
;; asm "THROWARGIF";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;; Simple configuration smart contract
|
||||
|
||||
() recv_internal(cell in_msg) impure {
|
||||
() recv_internal(cell in_msg) {
|
||||
;; do nothing for internal messages
|
||||
}
|
||||
|
||||
() recv_external(cell in_msg) impure {
|
||||
() recv_external(cell in_msg) {
|
||||
var (cs0, signature) = load_bits(begin_parse(in_msg), 512);
|
||||
var (cs, msg_seqno) = load_uint(cs0, 32);
|
||||
(cs, var valid_until) = load_uint(cs, 32);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
int cell_hash(cell c)
|
||||
asm "HASHCU";
|
||||
|
@ -9,36 +9,36 @@ asm "HASHSU";
|
|||
int check_signature(int hash, slice signature, int public_key)
|
||||
asm "CHKSIGNU";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure
|
||||
;; () throw_if(int excno, int cond)
|
||||
;; asm "THROWARGIF";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
(slice, int) zload_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
(slice, int) zload_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
int zpreload_int(slice s, int len) asm "PLDIX";
|
||||
int zpreload_uint(slice s, int len) asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder zstore_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
builder zstore_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
(slice, int) zload_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
(slice, int) zload_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
int zpreload_int(slice s, int len) pure asm "PLDIX";
|
||||
int zpreload_uint(slice s, int len) pure asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
builder zstore_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
builder zstore_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;; Simple configuration smart contract
|
||||
|
||||
() recv_internal(cell in_msg) impure {
|
||||
() recv_internal(cell in_msg) {
|
||||
;; do nothing for internal messages
|
||||
}
|
||||
|
||||
() recv_external(cell in_msg) impure {
|
||||
() recv_external(cell in_msg) {
|
||||
var (cs0, signature) = load_bits(begin_parse(in_msg), 512);
|
||||
var (cs, msg_seqno) = zload_uint(cs0, 32);
|
||||
(cs, var valid_until) = zload_uint(cs, 32);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
int cell_hash(cell c)
|
||||
asm "HASHCU";
|
||||
|
@ -9,37 +9,37 @@ asm "HASHSU";
|
|||
int check_signature(int hash, slice signature, int public_key)
|
||||
asm "CHKSIGNU";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure
|
||||
;; () throw_if(int excno, int cond)
|
||||
;; asm "THROWARGIF";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~set_idict_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~set_idict_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;; builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;; builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;; Simple configuration smart contract
|
||||
|
||||
() recv_internal(cell in_msg) impure {
|
||||
() recv_internal(cell in_msg) {
|
||||
;; do nothing for internal messages
|
||||
}
|
||||
|
||||
() recv_external(cell in_msg) impure {
|
||||
() recv_external(cell in_msg) {
|
||||
var cs = begin_parse(in_msg);
|
||||
var signature = cs~load_bits(512);
|
||||
var cs0 = cs;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
int cell_hash(cell c)
|
||||
asm "HASHCU";
|
||||
|
@ -9,36 +9,36 @@ asm "HASHSU";
|
|||
int check_signature(int hash, slice signature, int public_key)
|
||||
asm "CHKSIGNU";
|
||||
|
||||
;; () throw_if(int excno, int cond) impure
|
||||
;; () throw_if(int excno, int cond)
|
||||
;; asm "THROWARGIF";
|
||||
|
||||
cell get_data() asm "c4 PUSH";
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
;; int .preload_int(slice s, int len) asm "PLDIX";
|
||||
;; int .preload_uint(slice s, int len) asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice .preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
;;builder .store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
;;builder .store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
cell .end_cell(builder b) asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
;; (slice, int) load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
;; (slice, int) load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
;; int .preload_int(slice s, int len) pure asm "PLDIX";
|
||||
;; int .preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
(slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
;; slice .preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
cell set_idict_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
;;builder .store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
;;builder .store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
cell .end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
;; Simple configuration smart contract
|
||||
|
||||
() recv_internal(cell in_msg) impure {
|
||||
() recv_internal(cell in_msg) {
|
||||
;; do nothing for internal messages
|
||||
}
|
||||
|
||||
() recv_external(cell in_msg) impure {
|
||||
() recv_external(cell in_msg) {
|
||||
var (cs0, signature) = load_bits(begin_parse(in_msg), 512);
|
||||
var (cs, msg_seqno) = load_uint(cs0, 32);
|
||||
(cs, var valid_until) = load_uint(cs, 32);
|
||||
|
|
|
@ -5,7 +5,7 @@ _ unpack() inline {
|
|||
return res;
|
||||
}
|
||||
|
||||
() pack(a, x, y) impure inline_ref {
|
||||
() pack(a, x, y) inline_ref {
|
||||
set_data(begin_cell()
|
||||
.store_uint(a, 8)
|
||||
.store_int(x, 32)
|
||||
|
@ -13,7 +13,7 @@ _ unpack() inline {
|
|||
.end_cell());
|
||||
}
|
||||
|
||||
() main() impure {
|
||||
() main() {
|
||||
var (a, x, y) = unpack();
|
||||
x += y;
|
||||
pack(a, x, y);
|
||||
|
|
|
@ -11,12 +11,12 @@ _ pre_next() {
|
|||
return x + 1;
|
||||
}
|
||||
|
||||
() init() impure {
|
||||
() init() {
|
||||
;; global x;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
int next() impure {
|
||||
int next() {
|
||||
;; global x;
|
||||
return x += 1;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ _ set_y(x, w) {
|
|||
y = (w, x);
|
||||
}
|
||||
|
||||
_ get_y() impure {
|
||||
_ get_y() {
|
||||
return y;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@ global int i;
|
|||
|
||||
#include "i1sub1.fc";
|
||||
|
||||
() sub0() impure { i = 0; }
|
||||
() sub0() { i = 0; }
|
||||
|
||||
#include "i1sub2.fc";
|
||||
|
||||
() main() impure {
|
||||
() main() {
|
||||
sub0();
|
||||
sub1();
|
||||
sub2();
|
||||
i = 9;
|
||||
}
|
||||
|
||||
#include "../test/i1sub2.fc";
|
||||
#include "../test/i1sub2.fc";
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
#include "i1sub1.fc";
|
||||
|
||||
() sub1() impure {
|
||||
() sub1() {
|
||||
i = 1;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "./i1sub1.fc";
|
||||
|
||||
() sub2() impure {
|
||||
() sub2() {
|
||||
sub1();
|
||||
sub0();
|
||||
i = 2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
() test1() impure {
|
||||
() test1() {
|
||||
int i = 3;
|
||||
repeat (3) {
|
||||
try {
|
||||
|
@ -22,7 +22,7 @@ int divide_by_ten(int num) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
() test2() impure {
|
||||
() test2() {
|
||||
int n = divide_by_ten(37);
|
||||
throw_unless(502, n == 3);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ int divide_by_ten(int num) {
|
|||
return (0, a);
|
||||
}
|
||||
|
||||
() test3() impure {
|
||||
() test3() {
|
||||
int a = 0;
|
||||
int b = 57;
|
||||
try {
|
||||
|
@ -68,7 +68,7 @@ int get_y(int x, int y) {
|
|||
return y;
|
||||
}
|
||||
|
||||
() test4() impure {
|
||||
() test4() {
|
||||
throw_unless(504, get_x(3, 4) == 3);
|
||||
throw_unless(504, get_y(3, 4) == -1);
|
||||
}
|
||||
|
@ -86,12 +86,12 @@ int get_y(int x, int y) {
|
|||
return (a, b, c, d, e);
|
||||
}
|
||||
|
||||
() test5() impure {
|
||||
() test5() {
|
||||
var (a, b, c, d, e) = foo(10, 20, 30, 40, 50);
|
||||
throw_unless(505, (a == 11) & (b == 22) & (c == 33) & (d == 44) & (e == 55));
|
||||
}
|
||||
|
||||
() test6() impure {
|
||||
() test6() {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
int c = 0;
|
||||
|
|
|
@ -14,7 +14,7 @@ _ test1_body() {
|
|||
return (0, null());
|
||||
}
|
||||
|
||||
() test1() impure {
|
||||
() test1() {
|
||||
var (x, y) = test1_body();
|
||||
throw_unless(101, x == 104);
|
||||
throw_unless(102, y.builder_refs() == y.builder_bits());
|
||||
|
@ -67,7 +67,7 @@ _ test2_body(int a, int b, int c) {
|
|||
return null();
|
||||
}
|
||||
|
||||
() test2() impure {
|
||||
() test2() {
|
||||
throw_unless(201, test2_body(0, 4, 0) == 1);
|
||||
throw_unless(202, test2_body(0, 5, 0) == 2);
|
||||
throw_unless(203, test2_body(3, 4, 0) == 3);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
() main(cs) impure {
|
||||
() main(cs) {
|
||||
int i = 0;
|
||||
if (cs.slice_refs()) {
|
||||
do {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(cell) recv_external(slice in_msg) impure {
|
||||
(cell) recv_external(slice in_msg) {
|
||||
cell mydict = new_dict();
|
||||
builder r = begin_cell().store_int(10, 16);
|
||||
mydict~udict_set_builder(32, 1, r );
|
||||
|
@ -9,6 +9,6 @@
|
|||
return mydict;
|
||||
}
|
||||
|
||||
() recv_internal() impure {
|
||||
() recv_internal() {
|
||||
;; Nothing
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
int check_signatures(msg_hash, signatures, signers, bitmask_size) impure {
|
||||
int check_signatures(msg_hash, signatures, signers, bitmask_size) {
|
||||
var bitmask = 0;
|
||||
var id = -1;
|
||||
do {
|
||||
|
|
|
@ -35,122 +35,122 @@
|
|||
*/
|
||||
|
||||
/// Adds an element to the beginning of lisp-style list.
|
||||
forall X -> tuple cons(X head, tuple tail) asm "CONS";
|
||||
forall X -> tuple cons(X head, tuple tail) pure asm "CONS";
|
||||
|
||||
/// Extracts the head and the tail of lisp-style list.
|
||||
forall X -> (X, tuple) uncons(tuple list) asm "UNCONS";
|
||||
forall X -> (X, tuple) uncons(tuple list) pure asm "UNCONS";
|
||||
|
||||
/// Extracts the tail and the head of lisp-style list.
|
||||
forall X -> (tuple, X) list_next(tuple list) asm( -> 1 0) "UNCONS";
|
||||
forall X -> (tuple, X) list_next(tuple list) pure asm( -> 1 0) "UNCONS";
|
||||
|
||||
/// Returns the head of lisp-style list.
|
||||
forall X -> X car(tuple list) asm "CAR";
|
||||
forall X -> X car(tuple list) pure asm "CAR";
|
||||
|
||||
/// Returns the tail of lisp-style list.
|
||||
tuple cdr(tuple list) asm "CDR";
|
||||
tuple cdr(tuple list) pure asm "CDR";
|
||||
|
||||
/// Creates tuple with zero elements.
|
||||
tuple empty_tuple() asm "NIL";
|
||||
tuple empty_tuple() pure asm "NIL";
|
||||
|
||||
/// Appends a value `x` to a `Tuple t = (x1, ..., xn)`, but only if the resulting `Tuple t' = (x1, ..., xn, x)`
|
||||
/// is of length at most 255. Otherwise throws a type check exception.
|
||||
forall X -> tuple tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) asm "TPUSH";
|
||||
forall X -> tuple tpush(tuple t, X value) pure asm "TPUSH";
|
||||
forall X -> (tuple, ()) ~tpush(tuple t, X value) pure asm "TPUSH";
|
||||
|
||||
/// Creates a tuple of length one with given argument as element.
|
||||
forall X -> [X] single(X x) asm "SINGLE";
|
||||
forall X -> [X] single(X x) pure asm "SINGLE";
|
||||
|
||||
/// Unpacks a tuple of length one
|
||||
forall X -> X unsingle([X] t) asm "UNSINGLE";
|
||||
forall X -> X unsingle([X] t) pure asm "UNSINGLE";
|
||||
|
||||
/// Creates a tuple of length two with given arguments as elements.
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) asm "PAIR";
|
||||
forall X, Y -> [X, Y] pair(X x, Y y) pure asm "PAIR";
|
||||
|
||||
/// Unpacks a tuple of length two
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) asm "UNPAIR";
|
||||
forall X, Y -> (X, Y) unpair([X, Y] t) pure asm "UNPAIR";
|
||||
|
||||
/// Creates a tuple of length three with given arguments as elements.
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) asm "TRIPLE";
|
||||
forall X, Y, Z -> [X, Y, Z] triple(X x, Y y, Z z) pure asm "TRIPLE";
|
||||
|
||||
/// Unpacks a tuple of length three
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) asm "UNTRIPLE";
|
||||
forall X, Y, Z -> (X, Y, Z) untriple([X, Y, Z] t) pure asm "UNTRIPLE";
|
||||
|
||||
/// Creates a tuple of length four with given arguments as elements.
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) asm "4 TUPLE";
|
||||
forall X, Y, Z, W -> [X, Y, Z, W] tuple4(X x, Y y, Z z, W w) pure asm "4 TUPLE";
|
||||
|
||||
/// Unpacks a tuple of length four
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) asm "4 UNTUPLE";
|
||||
forall X, Y, Z, W -> (X, Y, Z, W) untuple4([X, Y, Z, W] t) pure asm "4 UNTUPLE";
|
||||
|
||||
/// Returns the first element of a tuple (with unknown element types).
|
||||
forall X -> X first(tuple t) asm "FIRST";
|
||||
forall X -> X first(tuple t) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a tuple (with unknown element types).
|
||||
forall X -> X second(tuple t) asm "SECOND";
|
||||
forall X -> X second(tuple t) pure asm "SECOND";
|
||||
|
||||
/// Returns the third element of a tuple (with unknown element types).
|
||||
forall X -> X third(tuple t) asm "THIRD";
|
||||
forall X -> X third(tuple t) pure asm "THIRD";
|
||||
|
||||
/// Returns the fourth element of a tuple (with unknown element types).
|
||||
forall X -> X fourth(tuple t) asm "3 INDEX";
|
||||
forall X -> X fourth(tuple t) pure asm "3 INDEX";
|
||||
|
||||
/// Returns the first element of a pair tuple.
|
||||
forall X, Y -> X pair_first([X, Y] p) asm "FIRST";
|
||||
forall X, Y -> X pair_first([X, Y] p) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a pair tuple.
|
||||
forall X, Y -> Y pair_second([X, Y] p) asm "SECOND";
|
||||
forall X, Y -> Y pair_second([X, Y] p) pure asm "SECOND";
|
||||
|
||||
/// Returns the first element of a triple tuple.
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) asm "FIRST";
|
||||
forall X, Y, Z -> X triple_first([X, Y, Z] p) pure asm "FIRST";
|
||||
|
||||
/// Returns the second element of a triple tuple.
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) asm "SECOND";
|
||||
forall X, Y, Z -> Y triple_second([X, Y, Z] p) pure asm "SECOND";
|
||||
|
||||
/// Returns the third element of a triple tuple.
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) asm "THIRD";
|
||||
forall X, Y, Z -> Z triple_third([X, Y, Z] p) pure asm "THIRD";
|
||||
|
||||
|
||||
/// Push null element (casted to given type)
|
||||
/// By the TVM type `Null` FunC represents absence of a value of some atomic type.
|
||||
/// So `null` can actually have any atomic type.
|
||||
forall X -> X null() asm "PUSHNULL";
|
||||
forall X -> X null() pure asm "PUSHNULL";
|
||||
|
||||
/// Moves a variable [x] to the top of the stack
|
||||
forall X -> (X, ()) ~impure_touch(X x) impure asm "NOP";
|
||||
forall X -> (X, ()) ~impure_touch(X x) asm "NOP";
|
||||
|
||||
|
||||
|
||||
/// Returns the current Unix time as an Integer
|
||||
int now() asm "NOW";
|
||||
int now() pure asm "NOW";
|
||||
|
||||
/// Returns the internal address of the current smart contract as a Slice with a `MsgAddressInt`.
|
||||
/// If necessary, it can be parsed further using primitives such as [parse_std_addr].
|
||||
slice my_address() asm "MYADDR";
|
||||
slice my_address() pure asm "MYADDR";
|
||||
|
||||
/// Returns the balance of the smart contract as a tuple consisting of an int
|
||||
/// (balance in nanotoncoins) and a `cell`
|
||||
/// (a dictionary with 32-bit keys representing the balance of "extra currencies")
|
||||
/// at the start of Computation Phase.
|
||||
/// Note that RAW primitives such as [send_raw_message] do not update this field.
|
||||
[int, cell] get_balance() asm "BALANCE";
|
||||
[int, cell] get_balance() pure asm "BALANCE";
|
||||
|
||||
/// Returns the logical time of the current transaction.
|
||||
int cur_lt() asm "LTIME";
|
||||
int cur_lt() pure asm "LTIME";
|
||||
|
||||
/// Returns the starting logical time of the current block.
|
||||
int block_lt() asm "BLOCKLT";
|
||||
int block_lt() pure asm "BLOCKLT";
|
||||
|
||||
/// Computes the representation hash of a `cell` [c] and returns it as a 256-bit unsigned integer `x`.
|
||||
/// Useful for signing and checking signatures of arbitrary entities represented by a tree of cells.
|
||||
int cell_hash(cell c) asm "HASHCU";
|
||||
int cell_hash(cell c) pure asm "HASHCU";
|
||||
|
||||
/// Computes the hash of a `slice s` and returns it as a 256-bit unsigned integer `x`.
|
||||
/// The result is the same as if an ordinary cell containing only data and references from `s` had been created
|
||||
/// and its hash computed by [cell_hash].
|
||||
int slice_hash(slice s) asm "HASHSU";
|
||||
int slice_hash(slice s) pure asm "HASHSU";
|
||||
|
||||
/// Computes sha256 of the data bits of `slice` [s]. If the bit length of `s` is not divisible by eight,
|
||||
/// throws a cell underflow exception. The hash value is returned as a 256-bit unsigned integer `x`.
|
||||
int string_hash(slice s) asm "SHA256U";
|
||||
int string_hash(slice s) pure asm "SHA256U";
|
||||
|
||||
/*
|
||||
# Signature checks
|
||||
|
@ -163,14 +163,14 @@ int string_hash(slice s) asm "SHA256U";
|
|||
/// Note that `CHKSIGNU` creates a 256-bit slice with the hash and calls `CHKSIGNS`.
|
||||
/// That is, if [hash] is computed as the hash of some data, these data are hashed twice,
|
||||
/// the second hashing occurring inside `CHKSIGNS`.
|
||||
int check_signature(int hash, slice signature, int public_key) asm "CHKSIGNU";
|
||||
int check_signature(int hash, slice signature, int public_key) pure asm "CHKSIGNU";
|
||||
|
||||
/// Checks whether [signature] is a valid Ed25519-signature of the data portion of `slice data` using `public_key`,
|
||||
/// similarly to [check_signature].
|
||||
/// If the bit length of [data] is not divisible by eight, throws a cell underflow exception.
|
||||
/// The verification of Ed25519 signatures is the standard one,
|
||||
/// with sha256 used to reduce [data] to the 256-bit number that is actually signed.
|
||||
int check_data_signature(slice data, slice signature, int public_key) asm "CHKSIGNS";
|
||||
int check_data_signature(slice data, slice signature, int public_key) pure asm "CHKSIGNS";
|
||||
|
||||
/***
|
||||
# Computation of boc size
|
||||
|
@ -178,10 +178,10 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
|
|||
*/
|
||||
|
||||
/// A non-quiet version of [compute_data_size?] that throws a cell overflow exception (`8`) on failure.
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) impure asm "CDATASIZE";
|
||||
(int, int, int) compute_data_size(cell c, int max_cells) asm "CDATASIZE";
|
||||
|
||||
/// A non-quiet version of [slice_compute_data_size?] that throws a cell overflow exception (`8`) on failure.
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) impure asm "SDATASIZE";
|
||||
(int, int, int) slice_compute_data_size(slice s, int max_cells) asm "SDATASIZE";
|
||||
|
||||
/// Returns `(x, y, z, -1)` or `(null, null, null, 0)`.
|
||||
/// Recursively computes the count of distinct cells `x`, data bits `y`, and cell references `z`
|
||||
|
@ -192,48 +192,48 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
|
|||
/// The total count of visited cells `x` cannot exceed non-negative [max_cells];
|
||||
/// otherwise the computation is aborted before visiting the `(max_cells + 1)`-st cell and
|
||||
/// a zero flag is returned to indicate failure. If [c] is `null`, returns `x = y = z = 0`.
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) compute_data_size?(cell c, int max_cells) pure asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
/// Similar to [compute_data_size?], but accepting a `slice` [s] instead of a `cell`.
|
||||
/// The returned value of `x` does not take into account the cell that contains the `slice` [s] itself;
|
||||
/// however, the data bits and the cell references of [s] are accounted for in `y` and `z`.
|
||||
(int, int, int, int) slice_compute_data_size?(slice s, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
(int, int, int, int) slice_compute_data_size?(slice s, int max_cells) pure asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
|
||||
|
||||
/// Throws an exception with exit_code excno if cond is not 0 (commented since implemented in compilator)
|
||||
// () throw_if(int excno, int cond) impure asm "THROWARGIF";
|
||||
// () throw_if(int excno, int cond) asm "THROWARGIF";
|
||||
|
||||
/***
|
||||
# Debug primitives
|
||||
Only works for local TVM execution with debug level verbosity
|
||||
*/
|
||||
/// Dumps the stack (at most the top 255 values) and shows the total stack depth.
|
||||
() dump_stack() impure asm "DUMPSTK";
|
||||
() dump_stack() asm "DUMPSTK";
|
||||
|
||||
/*
|
||||
# Persistent storage save and load
|
||||
*/
|
||||
|
||||
/// Returns the persistent contract storage cell. It can be parsed or modified with slice and builder primitives later.
|
||||
cell get_data() asm "c4 PUSH";
|
||||
cell get_data() pure asm "c4 PUSH";
|
||||
|
||||
/// Sets `cell` [c] as persistent contract data. You can update persistent contract storage with this primitive.
|
||||
() set_data(cell c) impure asm "c4 POP";
|
||||
() set_data(cell c) asm "c4 POP";
|
||||
|
||||
/*
|
||||
# Continuation primitives
|
||||
*/
|
||||
/// Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls.
|
||||
/// The primitive returns the current value of `c3`.
|
||||
cont get_c3() asm "c3 PUSH";
|
||||
cont get_c3() pure asm "c3 PUSH";
|
||||
|
||||
/// Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time.
|
||||
/// Note that after execution of this primitive the current code
|
||||
/// (and the stack of recursive function calls) won't change,
|
||||
/// but any other function call will use a function from the new code.
|
||||
() set_c3(cont c) impure asm "c3 POP";
|
||||
() set_c3(cont c) asm "c3 POP";
|
||||
|
||||
/// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
|
||||
cont bless(slice s) asm "BLESS";
|
||||
cont bless(slice s) pure asm "BLESS";
|
||||
|
||||
/***
|
||||
# Gas related primitives
|
||||
|
@ -245,37 +245,37 @@ cont bless(slice s) asm "BLESS";
|
|||
/// This action is required to process external messages, which bring no value (hence no gas) with themselves.
|
||||
///
|
||||
/// For more details check [accept_message effects](https://ton.org/docs/#/smart-contracts/accept).
|
||||
() accept_message() impure asm "ACCEPT";
|
||||
() accept_message() asm "ACCEPT";
|
||||
|
||||
/// Sets current gas limit `gl` to the minimum of limit and `gm`, and resets the gas credit `gc` to zero.
|
||||
/// If the gas consumed so far (including the present instruction) exceeds the resulting value of `gl`,
|
||||
/// an (unhandled) out of gas exception is thrown before setting new gas limits.
|
||||
/// Notice that [set_gas_limit] with an argument `limit ≥ 2^63 − 1` is equivalent to [accept_message].
|
||||
() set_gas_limit(int limit) impure asm "SETGASLIMIT";
|
||||
() set_gas_limit(int limit) asm "SETGASLIMIT";
|
||||
|
||||
/// Commits the current state of registers `c4` (“persistent data”) and `c5` (“actions”)
|
||||
/// so that the current execution is considered “successful” with the saved values even if an exception
|
||||
/// in Computation Phase is thrown later.
|
||||
() commit() impure asm "COMMIT";
|
||||
() commit() asm "COMMIT";
|
||||
|
||||
/// Not implemented
|
||||
//() buy_gas(int gram) impure asm "BUYGAS";
|
||||
//() buy_gas(int gram) asm "BUYGAS";
|
||||
|
||||
/// Computes the amount of gas that can be bought for `amount` nanoTONs,
|
||||
/// and sets `gl` accordingly in the same way as [set_gas_limit].
|
||||
() buy_gas(int amount) impure asm "BUYGAS";
|
||||
() buy_gas(int amount) asm "BUYGAS";
|
||||
|
||||
/// Computes the minimum of two integers [x] and [y].
|
||||
int min(int x, int y) asm "MIN";
|
||||
int min(int x, int y) pure asm "MIN";
|
||||
|
||||
/// Computes the maximum of two integers [x] and [y].
|
||||
int max(int x, int y) asm "MAX";
|
||||
int max(int x, int y) pure asm "MAX";
|
||||
|
||||
/// Sorts two integers.
|
||||
(int, int) minmax(int x, int y) asm "MINMAX";
|
||||
(int, int) minmax(int x, int y) pure asm "MINMAX";
|
||||
|
||||
/// Computes the absolute value of an integer [x].
|
||||
int abs(int x) asm "ABS";
|
||||
int abs(int x) pure asm "ABS";
|
||||
|
||||
/*
|
||||
# Slice primitives
|
||||
|
@ -294,80 +294,80 @@ int abs(int x) asm "ABS";
|
|||
/// Converts a `cell` [c] into a `slice`. Notice that [c] must be either an ordinary cell,
|
||||
/// or an exotic cell (see [TVM.pdf](https://ton-blockchain.github.io/docs/tvm.pdf), 3.1.2)
|
||||
/// which is automatically loaded to yield an ordinary cell `c'`, converted into a `slice` afterwards.
|
||||
slice begin_parse(cell c) asm "CTOS";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
|
||||
/// Checks if [s] is empty. If not, throws an exception.
|
||||
() end_parse(slice s) impure asm "ENDS";
|
||||
() end_parse(slice s) asm "ENDS";
|
||||
|
||||
/// Loads the first reference from the slice.
|
||||
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
|
||||
(slice, cell) load_ref(slice s) pure asm( -> 1 0) "LDREF";
|
||||
|
||||
/// Preloads the first reference from the slice.
|
||||
cell preload_ref(slice s) asm "PLDREF";
|
||||
cell preload_ref(slice s) pure asm "PLDREF";
|
||||
|
||||
/* Functions below are commented because are implemented on compilator level for optimisation */
|
||||
|
||||
/// Loads a signed [len]-bit integer from a slice [s].
|
||||
// (slice, int) ~load_int(slice s, int len) asm(s len -> 1 0) "LDIX";
|
||||
// (slice, int) ~load_int(slice s, int len) pure asm(s len -> 1 0) "LDIX";
|
||||
|
||||
/// Loads an unsigned [len]-bit integer from a slice [s].
|
||||
// (slice, int) ~load_uint(slice s, int len) asm( -> 1 0) "LDUX";
|
||||
// (slice, int) ~load_uint(slice s, int len) pure asm( -> 1 0) "LDUX";
|
||||
|
||||
/// Preloads a signed [len]-bit integer from a slice [s].
|
||||
// int preload_int(slice s, int len) asm "PLDIX";
|
||||
// int preload_int(slice s, int len) pure asm "PLDIX";
|
||||
|
||||
/// Preloads an unsigned [len]-bit integer from a slice [s].
|
||||
// int preload_uint(slice s, int len) asm "PLDUX";
|
||||
// int preload_uint(slice s, int len) pure asm "PLDUX";
|
||||
|
||||
/// Loads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
// (slice, slice) load_bits(slice s, int len) asm(s len -> 1 0) "LDSLICEX";
|
||||
// (slice, slice) load_bits(slice s, int len) pure asm(s len -> 1 0) "LDSLICEX";
|
||||
|
||||
/// Preloads the first `0 ≤ len ≤ 1023` bits from slice [s] into a separate `slice s''`.
|
||||
// slice preload_bits(slice s, int len) asm "PLDSLICEX";
|
||||
// slice preload_bits(slice s, int len) pure asm "PLDSLICEX";
|
||||
|
||||
/// Loads serialized amount of TonCoins (any unsigned integer up to `2^120 - 1`).
|
||||
(slice, int) load_grams(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_grams(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
(slice, int) load_coins(slice s) pure asm( -> 1 0) "LDGRAMS";
|
||||
|
||||
/// Returns all but the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST";
|
||||
slice skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
(slice, ()) ~skip_bits(slice s, int len) pure asm "SDSKIPFIRST";
|
||||
|
||||
/// Returns the first `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice first_bits(slice s, int len) asm "SDCUTFIRST";
|
||||
slice first_bits(slice s, int len) pure asm "SDCUTFIRST";
|
||||
|
||||
/// Returns all but the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) asm "SDSKIPLAST";
|
||||
slice skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
(slice, ()) ~skip_last_bits(slice s, int len) pure asm "SDSKIPLAST";
|
||||
|
||||
/// Returns the last `0 ≤ len ≤ 1023` bits of `slice` [s].
|
||||
slice slice_last(slice s, int len) asm "SDCUTLAST";
|
||||
slice slice_last(slice s, int len) pure asm "SDCUTLAST";
|
||||
|
||||
/// Loads a dictionary `D` (HashMapE) from `slice` [s].
|
||||
/// (returns `null` if `nothing` constructor is used).
|
||||
(slice, cell) load_dict(slice s) asm( -> 1 0) "LDDICT";
|
||||
(slice, cell) load_dict(slice s) pure asm( -> 1 0) "LDDICT";
|
||||
|
||||
/// Preloads a dictionary `D` from `slice` [s].
|
||||
cell preload_dict(slice s) asm "PLDDICT";
|
||||
cell preload_dict(slice s) pure asm "PLDDICT";
|
||||
|
||||
/// Loads a dictionary as [load_dict], but returns only the remainder of the slice.
|
||||
slice skip_dict(slice s) asm "SKIPDICT";
|
||||
slice skip_dict(slice s) pure asm "SKIPDICT";
|
||||
|
||||
/// Loads (Maybe ^Cell) from `slice` [s].
|
||||
/// In other words loads 1 bit and if it is true
|
||||
/// loads first ref and return it with slice remainder
|
||||
/// otherwise returns `null` and slice remainder
|
||||
(slice, cell) load_maybe_ref(slice s) asm( -> 1 0) "LDOPTREF";
|
||||
(slice, cell) load_maybe_ref(slice s) pure asm( -> 1 0) "LDOPTREF";
|
||||
|
||||
/// Preloads (Maybe ^Cell) from `slice` [s].
|
||||
cell preload_maybe_ref(slice s) asm "PLDOPTREF";
|
||||
cell preload_maybe_ref(slice s) pure asm "PLDOPTREF";
|
||||
|
||||
|
||||
/// Returns the depth of `cell` [c].
|
||||
/// If [c] has no references, then return `0`;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [c].
|
||||
/// If [c] is a `null` instead of a cell, returns zero.
|
||||
int cell_depth(cell c) asm "CDEPTH";
|
||||
int cell_depth(cell c) pure asm "CDEPTH";
|
||||
|
||||
|
||||
/*
|
||||
|
@ -375,42 +375,42 @@ int cell_depth(cell c) asm "CDEPTH";
|
|||
*/
|
||||
|
||||
/// Returns the number of references in `slice` [s].
|
||||
int slice_refs(slice s) asm "SREFS";
|
||||
int slice_refs(slice s) pure asm "SREFS";
|
||||
|
||||
/// Returns the number of data bits in `slice` [s].
|
||||
int slice_bits(slice s) asm "SBITS";
|
||||
int slice_bits(slice s) pure asm "SBITS";
|
||||
|
||||
/// Returns both the number of data bits and the number of references in `slice` [s].
|
||||
(int, int) slice_bits_refs(slice s) asm "SBITREFS";
|
||||
(int, int) slice_bits_refs(slice s) pure asm "SBITREFS";
|
||||
|
||||
/// Checks whether a `slice` [s] is empty (i.e., contains no bits of data and no cell references).
|
||||
int slice_empty?(slice s) asm "SEMPTY";
|
||||
int slice_empty?(slice s) pure asm "SEMPTY";
|
||||
|
||||
/// Checks whether `slice` [s] has no bits of data.
|
||||
int slice_data_empty?(slice s) asm "SDEMPTY";
|
||||
int slice_data_empty?(slice s) pure asm "SDEMPTY";
|
||||
|
||||
/// Checks whether `slice` [s] has no references.
|
||||
int slice_refs_empty?(slice s) asm "SREMPTY";
|
||||
int slice_refs_empty?(slice s) pure asm "SREMPTY";
|
||||
|
||||
/// Returns the depth of `slice` [s].
|
||||
/// If [s] has no references, then returns `0`;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [s].
|
||||
int slice_depth(slice s) asm "SDEPTH";
|
||||
int slice_depth(slice s) pure asm "SDEPTH";
|
||||
|
||||
/*
|
||||
# Builder size primitives
|
||||
*/
|
||||
|
||||
/// Returns the number of cell references already stored in `builder` [b]
|
||||
int builder_refs(builder b) asm "BREFS";
|
||||
int builder_refs(builder b) pure asm "BREFS";
|
||||
|
||||
/// Returns the number of data bits already stored in `builder` [b].
|
||||
int builder_bits(builder b) asm "BBITS";
|
||||
int builder_bits(builder b) pure asm "BBITS";
|
||||
|
||||
/// Returns the depth of `builder` [b].
|
||||
/// If no cell references are stored in [b], then returns 0;
|
||||
/// otherwise the returned value is one plus the maximum of depths of cells referred to from [b].
|
||||
int builder_depth(builder b) asm "BDEPTH";
|
||||
int builder_depth(builder b) pure asm "BDEPTH";
|
||||
|
||||
/*
|
||||
# Builder primitives
|
||||
|
@ -423,23 +423,23 @@ int builder_depth(builder b) asm "BDEPTH";
|
|||
*/
|
||||
|
||||
/// Creates a new empty `builder`.
|
||||
builder begin_cell() asm "NEWC";
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
|
||||
/// Converts a `builder` into an ordinary `cell`.
|
||||
cell end_cell(builder b) asm "ENDC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
|
||||
/// Stores a reference to `cell` [c] into `builder` [b].
|
||||
builder store_ref(builder b, cell c) asm(c b) "STREF";
|
||||
builder store_ref(builder b, cell c) pure asm(c b) "STREF";
|
||||
|
||||
/// Stores an unsigned [len]-bit integer `x` into `b` for `0 ≤ len ≤ 256`.
|
||||
// builder store_uint(builder b, int x, int len) asm(x b len) "STUX";
|
||||
// builder store_uint(builder b, int x, int len) pure asm(x b len) "STUX";
|
||||
|
||||
/// Stores a signed [len]-bit integer `x` into `b` for` 0 ≤ len ≤ 257`.
|
||||
// builder store_int(builder b, int x, int len) asm(x b len) "STIX";
|
||||
// builder store_int(builder b, int x, int len) pure asm(x b len) "STIX";
|
||||
|
||||
|
||||
/// Stores `slice` [s] into `builder` [b]
|
||||
builder store_slice(builder b, slice s) asm "STSLICER";
|
||||
builder store_slice(builder b, slice s) pure asm "STSLICER";
|
||||
|
||||
/// Stores (serializes) an integer [x] in the range `0..2^120 − 1` into `builder` [b].
|
||||
/// The serialization of [x] consists of a 4-bit unsigned big-endian integer `l`,
|
||||
|
@ -448,17 +448,17 @@ builder store_slice(builder b, slice s) asm "STSLICER";
|
|||
/// If [x] does not belong to the supported range, a range check exception is thrown.
|
||||
///
|
||||
/// Store amounts of TonCoins to the builder as VarUInteger 16
|
||||
builder store_grams(builder b, int x) asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) asm "STGRAMS";
|
||||
builder store_grams(builder b, int x) pure asm "STGRAMS";
|
||||
builder store_coins(builder b, int x) pure asm "STGRAMS";
|
||||
|
||||
/// Stores dictionary `D` represented by `cell` [c] or `null` into `builder` [b].
|
||||
/// In other words, stores a `1`-bit and a reference to [c] if [c] is not `null` and `0`-bit otherwise.
|
||||
builder store_dict(builder b, cell c) asm(c b) "STDICT";
|
||||
builder store_dict(builder b, cell c) pure asm(c b) "STDICT";
|
||||
|
||||
/// Stores (Maybe ^Cell) to builder:
|
||||
/// if cell is null store 1 zero bit
|
||||
/// otherwise store 1 true bit and ref to cell
|
||||
builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
||||
builder store_maybe_ref(builder b, cell c) pure asm(c b) "STOPTREF";
|
||||
|
||||
|
||||
/*
|
||||
|
@ -500,22 +500,22 @@ builder store_maybe_ref(builder b, cell c) asm(c b) "STOPTREF";
|
|||
|
||||
/// Loads from slice [s] the only prefix that is a valid `MsgAddress`,
|
||||
/// and returns both this prefix `s'` and the remainder `s''` of [s] as slices.
|
||||
(slice, slice) load_msg_addr(slice s) asm( -> 1 0) "LDMSGADDR";
|
||||
(slice, slice) load_msg_addr(slice s) pure asm( -> 1 0) "LDMSGADDR";
|
||||
|
||||
/// Decomposes slice [s] containing a valid `MsgAddress` into a `tuple t` with separate fields of this `MsgAddress`.
|
||||
/// If [s] is not a valid `MsgAddress`, a cell deserialization exception is thrown.
|
||||
tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
||||
tuple parse_addr(slice s) pure asm "PARSEMSGADDR";
|
||||
|
||||
/// Parses slice [s] containing a valid `MsgAddressInt` (usually a `msg_addr_std`),
|
||||
/// applies rewriting from the anycast (if present) to the same-length prefix of the address,
|
||||
/// and returns both the workchain and the 256-bit address as integers.
|
||||
/// If the address is not 256-bit, or if [s] is not a valid serialization of `MsgAddressInt`,
|
||||
/// throws a cell deserialization exception.
|
||||
(int, int) parse_std_addr(slice s) asm "REWRITESTDADDR";
|
||||
(int, int) parse_std_addr(slice s) pure asm "REWRITESTDADDR";
|
||||
|
||||
/// A variant of [parse_std_addr] that returns the (rewritten) address as a slice [s],
|
||||
/// even if it is not exactly 256 bit long (represented by a `msg_addr_var`).
|
||||
(int, slice) parse_var_addr(slice s) asm "REWRITEVARADDR";
|
||||
(int, slice) parse_var_addr(slice s) pure asm "REWRITEVARADDR";
|
||||
|
||||
/*
|
||||
# Dictionary primitives
|
||||
|
@ -524,116 +524,116 @@ tuple parse_addr(slice s) asm "PARSEMSGADDR";
|
|||
|
||||
/// Sets the value associated with [key_len]-bit key signed index in dictionary [dict] to [value] (cell),
|
||||
/// and returns the resulting dictionary.
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETREF";
|
||||
cell idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
(cell, ()) ~idict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETREF";
|
||||
|
||||
/// Sets the value associated with [key_len]-bit key unsigned index in dictionary [dict] to [value] (cell),
|
||||
/// and returns the resulting dictionary.
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETREF";
|
||||
cell udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
(cell, ()) ~udict_set_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETREF";
|
||||
|
||||
cell idict_get_ref(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
cell idict_get_ref(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETOPTREF";
|
||||
(cell, int) idict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGETREF" "NULLSWAPIFNOT";
|
||||
(cell, int) udict_get_ref?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGETREF" "NULLSWAPIFNOT";
|
||||
(cell, cell) idict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTISETGETOPTREF";
|
||||
(cell, cell) udict_set_get_ref(cell dict, int key_len, int index, cell value) pure asm(value index dict key_len) "DICTUSETGETOPTREF";
|
||||
(cell, int) idict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDEL";
|
||||
(cell, int) udict_delete?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDEL";
|
||||
(slice, int) idict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIGET" "NULLSWAPIFNOT";
|
||||
(slice, int) udict_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, slice, int) udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~idict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTIDELGET" "NULLSWAPIFNOT";
|
||||
(cell, (slice, int)) ~udict_delete_get?(cell dict, int key_len, int index) pure asm(index dict key_len) "DICTUDELGET" "NULLSWAPIFNOT";
|
||||
cell udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
(cell, ()) ~udict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUSET";
|
||||
cell idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
(cell, ()) ~idict_set(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTISET";
|
||||
cell dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, ()) ~dict_set(cell dict, int key_len, slice index, slice value) pure asm(value index dict key_len) "DICTSET";
|
||||
(cell, int) udict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUADD";
|
||||
(cell, int) udict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTUREPLACE";
|
||||
(cell, int) idict_add?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIADD";
|
||||
(cell, int) idict_replace?(cell dict, int key_len, int index, slice value) pure asm(value index dict key_len) "DICTIREPLACE";
|
||||
cell udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
(cell, ()) ~udict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUSETB";
|
||||
cell idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
(cell, ()) ~idict_set_builder(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTISETB";
|
||||
cell dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, ()) ~dict_set_builder(cell dict, int key_len, slice index, builder value) pure asm(value index dict key_len) "DICTSETB";
|
||||
(cell, int) udict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUADDB";
|
||||
(cell, int) udict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTUREPLACEB";
|
||||
(cell, int) idict_add_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIADDB";
|
||||
(cell, int) idict_replace_builder?(cell dict, int key_len, int index, builder value) pure asm(value index dict key_len) "DICTIREPLACEB";
|
||||
(cell, int, slice, int) udict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_min(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMIN" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) udict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~udict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTUREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, int, slice, int) idict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (int, slice, int)) ~idict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTIREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, slice, slice, int) dict_delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(cell, (slice, slice, int)) ~dict::delete_get_max(cell dict, int key_len) pure asm(-> 0 2 1 3) "DICTREMMAX" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) udict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTUMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_min?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMIN" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_max?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAX" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_min_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMINREF" "NULLSWAPIFNOT2";
|
||||
(int, cell, int) idict_get_max_ref?(cell dict, int key_len) pure asm (-> 1 0 2) "DICTIMAXREF" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) udict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTUGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_next?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXT" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_nexteq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETNEXTEQ" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_prev?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREV" "NULLSWAPIFNOT2";
|
||||
(int, slice, int) idict_get_preveq?(cell dict, int key_len, int pivot) pure asm(pivot dict key_len -> 1 0 2) "DICTIGETPREVEQ" "NULLSWAPIFNOT2";
|
||||
|
||||
/// Creates an empty dictionary, which is actually a null value. Equivalent to PUSHNULL
|
||||
cell new_dict() asm "NEWDICT";
|
||||
cell new_dict() pure asm "NEWDICT";
|
||||
/// Checks whether a dictionary is empty. Equivalent to cell_null?.
|
||||
int dict_empty?(cell c) asm "DICTEMPTY";
|
||||
int dict_empty?(cell c) pure asm "DICTEMPTY";
|
||||
|
||||
|
||||
/* Prefix dictionary primitives */
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) asm(key dict key_len) "PFXDICTDEL";
|
||||
(slice, slice, slice, int) pfxdict_get?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTGETQ" "NULLSWAPIFNOT2";
|
||||
(cell, int) pfxdict_set?(cell dict, int key_len, slice key, slice value) pure asm(value key dict key_len) "PFXDICTSET";
|
||||
(cell, int) pfxdict_delete?(cell dict, int key_len, slice key) pure asm(key dict key_len) "PFXDICTDEL";
|
||||
|
||||
/// Returns the value of the global configuration parameter with integer index `i` as a `cell` or `null` value.
|
||||
cell config_param(int x) asm "CONFIGOPTPARAM";
|
||||
cell config_param(int x) pure asm "CONFIGOPTPARAM";
|
||||
/// Checks whether c is a null. Note, that FunC also has polymorphic null? built-in.
|
||||
int cell_null?(cell c) asm "ISNULL";
|
||||
int cell_null?(cell c) pure asm "ISNULL";
|
||||
|
||||
/// Creates an output action which would reserve exactly amount nanotoncoins (if mode = 0), at most amount nanotoncoins (if mode = 2), or all but amount nanotoncoins (if mode = 1 or mode = 3), from the remaining balance of the account. It is roughly equivalent to creating an outbound message carrying amount nanotoncoins (or b − amount nanotoncoins, where b is the remaining balance) to oneself, so that the subsequent output actions would not be able to spend more money than the remainder. Bit +2 in mode means that the external action does not fail if the specified amount cannot be reserved; instead, all remaining balance is reserved. Bit +8 in mode means `amount <- -amount` before performing any further actions. Bit +4 in mode means that amount is increased by the original balance of the current account (before the compute phase), including all extra currencies, before performing any other checks and actions. Currently, amount must be a non-negative integer, and mode must be in the range 0..15.
|
||||
() raw_reserve(int amount, int mode) impure asm "RAWRESERVE";
|
||||
() raw_reserve(int amount, int mode) asm "RAWRESERVE";
|
||||
/// Similar to raw_reserve, but also accepts a dictionary extra_amount (represented by a cell or null) with extra currencies. In this way currencies other than TonCoin can be reserved.
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) impure asm "RAWRESERVEX";
|
||||
() raw_reserve_extra(int amount, cell extra_amount, int mode) asm "RAWRESERVEX";
|
||||
/// Sends a raw message contained in msg, which should contain a correctly serialized object Message X, with the only exception that the source address is allowed to have dummy value addr_none (to be automatically replaced with the current smart contract address), and ihr_fee, fwd_fee, created_lt and created_at fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). Integer parameter mode contains the flags. Currently mode = 0 is used for ordinary messages; mode = 128 is used for messages that are to carry all the remaining balance of the current smart contract (instead of the value originally indicated in the message); mode = 64 is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount); mode' = mode + 1 means that the sender wants to pay transfer fees separately; mode' = mode + 2 means that any errors arising while processing this message during the action phase should be ignored. Finally, mode' = mode + 32 means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with +128.
|
||||
() send_raw_message(cell msg, int mode) impure asm "SENDRAWMSG";
|
||||
() send_raw_message(cell msg, int mode) asm "SENDRAWMSG";
|
||||
/// Creates an output action that would change this smart contract code to that given by cell new_code. Notice that this change will take effect only after the successful termination of the current run of the smart contract
|
||||
() set_code(cell new_code) impure asm "SETCODE";
|
||||
() set_code(cell new_code) asm "SETCODE";
|
||||
|
||||
/// Generates a new pseudo-random unsigned 256-bit integer x. The algorithm is as follows: if r is the old value of the random seed, considered as a 32-byte array (by constructing the big-endian representation of an unsigned 256-bit integer), then its sha512(r) is computed; the first 32 bytes of this hash are stored as the new value r' of the random seed, and the remaining 32 bytes are returned as the next random value x.
|
||||
int random() impure asm "RANDU256";
|
||||
int random() asm "RANDU256";
|
||||
/// Generates a new pseudo-random integer z in the range 0..range−1 (or range..−1, if range < 0). More precisely, an unsigned random value x is generated as in random; then z := x * range / 2^256 is computed.
|
||||
int rand(int range) impure asm "RAND";
|
||||
int rand(int range) asm "RAND";
|
||||
/// Returns the current random seed as an unsigned 256-bit Integer.
|
||||
int get_seed() asm "RANDSEED";
|
||||
int get_seed() pure asm "RANDSEED";
|
||||
/// Sets the random seed to unsigned 256-bit seed.
|
||||
() set_seed(int) impure asm "SETRAND";
|
||||
() set_seed(int) asm "SETRAND";
|
||||
/// Mixes unsigned 256-bit integer x into the random seed r by setting the random seed to sha256 of the concatenation of two 32-byte strings: the first with the big-endian representation of the old seed r, and the second with the big-endian representation of x.
|
||||
() randomize(int x) impure asm "ADDRAND";
|
||||
() randomize(int x) asm "ADDRAND";
|
||||
/// Equivalent to randomize(cur_lt());.
|
||||
() randomize_lt() impure asm "LTIME" "ADDRAND";
|
||||
() randomize_lt() asm "LTIME" "ADDRAND";
|
||||
|
||||
/// Checks whether the data parts of two slices coinside
|
||||
int equal_slice_bits (slice a, slice b) asm "SDEQ";
|
||||
int equal_slice_bits (slice a, slice b) pure asm "SDEQ";
|
||||
|
||||
/// Concatenates two builders
|
||||
builder store_builder(builder to, builder from) asm "STBR";
|
||||
builder store_builder(builder to, builder from) pure asm "STBR";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue