mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated smartcontract code
- updated smartcontract code - fixed bug in liteserver listening socket - updated documentation
This commit is contained in:
parent
38c3e39066
commit
b978e27b2f
63 changed files with 3185 additions and 81 deletions
13
crypto/func/test/w3.fc
Normal file
13
crypto/func/test/w3.fc
Normal file
|
@ -0,0 +1,13 @@
|
|||
() main(cs) impure {
|
||||
int i = 0;
|
||||
if (cs.slice_refs()) {
|
||||
do {
|
||||
i = i + 1;
|
||||
} until(i > 10);
|
||||
}
|
||||
set_data(begin_cell()
|
||||
.store_uint(1, 32)
|
||||
.store_uint(2, 32)
|
||||
.store_uint(i, 32)
|
||||
.end_cell());
|
||||
}
|
13
crypto/func/test/w4.fc
Normal file
13
crypto/func/test/w4.fc
Normal file
|
@ -0,0 +1,13 @@
|
|||
_ main(cell dict, int t3) {
|
||||
int index = -1;
|
||||
do {
|
||||
(index, slice value, int found) = dict.udict_get_next?(32, index);
|
||||
if (found) {
|
||||
(int temp1, int temp2) = (value~load_uint(16), value~load_uint(32));
|
||||
if (t3 > temp2) {
|
||||
dict~udict_delete_get?(32, index);
|
||||
}
|
||||
}
|
||||
} until ( ~ found);
|
||||
return dict;
|
||||
}
|
14
crypto/func/test/w5.fc
Normal file
14
crypto/func/test/w5.fc
Normal file
|
@ -0,0 +1,14 @@
|
|||
(cell) recv_external(slice in_msg) impure {
|
||||
cell mydict = new_dict();
|
||||
builder r = begin_cell().store_int(10, 16);
|
||||
mydict~udict_set_builder(32, 1, r );
|
||||
int index = -1;
|
||||
do {
|
||||
(var index, var value, var found) = mydict.udict_get_next?(32, index);
|
||||
} until ( ~ found );
|
||||
return mydict;
|
||||
}
|
||||
|
||||
() recv_internal() impure {
|
||||
;; Nothing
|
||||
}
|
12
crypto/func/test/w6.fc
Normal file
12
crypto/func/test/w6.fc
Normal file
|
@ -0,0 +1,12 @@
|
|||
int test(int x) method_id {
|
||||
int i = 0;
|
||||
;; int f = false;
|
||||
do {
|
||||
i = i + 1;
|
||||
if (i > 5) {
|
||||
return 1;
|
||||
}
|
||||
int f = (i * i == 64);
|
||||
} until (f);
|
||||
return -1;
|
||||
}
|
14
crypto/func/test/w7.fc
Normal file
14
crypto/func/test/w7.fc
Normal file
|
@ -0,0 +1,14 @@
|
|||
int test(int y) {
|
||||
int x = 1;
|
||||
if (y > 0) {
|
||||
return 1;
|
||||
}
|
||||
return x > 0;
|
||||
}
|
||||
|
||||
int f(int y) {
|
||||
if (y > 0) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue