1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

[FunC] Fixed some impure specifiers in stdlib.fc

This commit is contained in:
Aleksandr Kirsanov 2024-05-03 11:33:25 +03:00
parent f217a7d312
commit a3e9e03019
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
17 changed files with 62 additions and 62 deletions

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -209,7 +209,7 @@ cell get_data() asm "c4 PUSH";
*/ */
/// Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls. /// 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`. /// The primitive returns the current value of `c3`.
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
/// Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time. /// 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 /// Note that after execution of this primitive the current code
@ -218,7 +218,7 @@ cont get_c3() impure asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
/// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist. /// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
/*-- /*--
# Gas related primitives # Gas related primitives
@ -609,7 +609,7 @@ int random() impure asm "RANDU256";
/// Generates a new pseudo-random integer z in the range 0..range1 (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. /// Generates a new pseudo-random integer z in the range 0..range1 (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) impure asm "RAND";
/// Returns the current random seed as an unsigned 256-bit Integer. /// Returns the current random seed as an unsigned 256-bit Integer.
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
/// Sets the random seed to unsigned 256-bit seed. /// Sets the random seed to unsigned 256-bit seed.
() set_seed(int) impure asm "SETRAND"; () set_seed(int) impure 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. /// 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.

View file

@ -209,7 +209,7 @@ cell get_data() asm "c4 PUSH";
-} -}
;;; Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls. ;;; 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`. ;;; The primitive returns the current value of `c3`.
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
;;; Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time. ;;; 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 ;;; Note that after execution of this primitive the current code
@ -218,7 +218,7 @@ cont get_c3() impure asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
;;; Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist. ;;; Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
{--- {---
# Gas related primitives # Gas related primitives
@ -609,7 +609,7 @@ int random() impure asm "RANDU256";
;;; Generates a new pseudo-random integer z in the range 0..range1 (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. ;;; Generates a new pseudo-random integer z in the range 0..range1 (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) impure asm "RAND";
;;; Returns the current random seed as an unsigned 256-bit Integer. ;;; Returns the current random seed as an unsigned 256-bit Integer.
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
;;; Sets the random seed to unsigned 256-bit seed. ;;; Sets the random seed to unsigned 256-bit seed.
() set_seed(int) impure asm "SETRAND"; () set_seed(int) impure 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. ;;; 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.

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -53,9 +53,9 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
cell get_data() asm "c4 PUSH"; cell get_data() asm "c4 PUSH";
() set_data(cell c) impure asm "c4 POP"; () set_data(cell c) impure asm "c4 POP";
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
() accept_message() impure asm "ACCEPT"; () accept_message() impure asm "ACCEPT";
() set_gas_limit(int limit) impure asm "SETGASLIMIT"; () set_gas_limit(int limit) impure asm "SETGASLIMIT";
@ -202,7 +202,7 @@ int cell_null?(cell c) asm "ISNULL";
int random() impure asm "RANDU256"; int random() impure asm "RANDU256";
int rand(int range) impure asm "RAND"; int rand(int range) impure asm "RAND";
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
int set_seed() impure asm "SETRAND"; int set_seed() impure asm "SETRAND";
() randomize(int x) impure asm "ADDRAND"; () randomize(int x) impure asm "ADDRAND";
() randomize_lt() impure asm "LTIME" "ADDRAND"; () randomize_lt() impure asm "LTIME" "ADDRAND";

View file

@ -177,6 +177,12 @@ int check_data_signature(slice data, slice signature, int public_key) asm "CHKSI
The primitives below may be useful for computing storage fees of user-provided data. The primitives below may be useful for computing storage fees of user-provided data.
*/ */
/// 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";
/// 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";
/// Returns `(x, y, z, -1)` or `(null, null, null, 0)`. /// 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` /// Recursively computes the count of distinct cells `x`, data bits `y`, and cell references `z`
/// in the DAG rooted at `cell` [c], effectively returning the total storage used by this DAG taking into account /// in the DAG rooted at `cell` [c], effectively returning the total storage used by this DAG taking into account
@ -186,18 +192,12 @@ 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]; /// 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 /// 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`. /// 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, int) compute_data_size?(cell c, int max_cells) asm "CDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
/// Similar to [compute_data_size?], but accepting a `slice` [s] instead of a `cell`. /// 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; /// 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`. /// 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, int) slice_compute_data_size?(slice s, int max_cells) asm "SDATASIZEQ NULLSWAPIFNOT2 NULLSWAPIFNOT";
/// 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";
/// 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";
/// Throws an exception with exit_code excno if cond is not 0 (commented since implemented in compilator) /// 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) impure asm "THROWARGIF";
@ -224,7 +224,7 @@ cell get_data() asm "c4 PUSH";
*/ */
/// Usually `c3` has a continuation initialized by the whole code of the contract. It is used for function calls. /// 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`. /// The primitive returns the current value of `c3`.
cont get_c3() impure asm "c3 PUSH"; cont get_c3() asm "c3 PUSH";
/// Updates the current value of `c3`. Usually, it is used for updating smart contract code in run-time. /// 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 /// Note that after execution of this primitive the current code
@ -233,7 +233,7 @@ cont get_c3() impure asm "c3 PUSH";
() set_c3(cont c) impure asm "c3 POP"; () set_c3(cont c) impure asm "c3 POP";
/// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist. /// Transforms a `slice` [s] into a simple ordinary continuation `c`, with `c.code = s` and an empty stack and savelist.
cont bless(slice s) impure asm "BLESS"; cont bless(slice s) asm "BLESS";
/*** /***
# Gas related primitives # Gas related primitives
@ -624,7 +624,7 @@ int random() impure asm "RANDU256";
/// Generates a new pseudo-random integer z in the range 0..range1 (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. /// Generates a new pseudo-random integer z in the range 0..range1 (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) impure asm "RAND";
/// Returns the current random seed as an unsigned 256-bit Integer. /// Returns the current random seed as an unsigned 256-bit Integer.
int get_seed() impure asm "RANDSEED"; int get_seed() asm "RANDSEED";
/// Sets the random seed to unsigned 256-bit seed. /// Sets the random seed to unsigned 256-bit seed.
() set_seed(int) impure asm "SETRAND"; () set_seed(int) impure 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. /// 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.