TON Дев Чат
NftItem
схеме нету истории транзакций, например если я хочу узнать пред. owner(ов) и за сколько они продавали 🤔EQC3dNlesgVD8YbAazcauIrXBPfiVhMMr5YYk2in0Mtsz0Bz
pytonlib (0.0.42)
CRITICAL:pytonlib.tonlibjson:Tonlib #003 crashed: Traceback (most recent call last):
pytonlib.tonlibjson.TonlibError: INVALID_CONFIG: hardforks differs from embedded hardforks
BALANCE // balance, in_value, in_msg_full, in_msg_body, balance_tuple
0 INDEX // balance, in_value, in_msg_full, in_msg_body, balance
DUP // balance, in_value, in_msg_full, in_msg_body, balance, balance
2000000000 PUSHINT
LESS // balance, in_value, in_msg_full, in_msg_body, balance, balance<2TON
206 THROWIF // balance, in_value, in_msg_full, in_msg_body, balance
[*] SWAP // balance, in_value, in_msg_full, balance, in_msg_body
[*] SREFS // balance, in_value, in_msg_full, balance, in_msg_body_refs
[*] 250 THROWIF // balance, in_value, in_msg_full, balance
3 BLKDROP // balance
DUP // balance, balance
2000000000 PUSHINT
LESS // balance, balance<2TON
206 THROWIF // balance
dic.udict_get?(64, x00), другие лежат в dic.udict_get?(64, x01) и так далее, удобно, просто и... дёшево?
slice cell0 = get_data().begin_parse();
int var1 = cell0~load_uint(17);
int var2 = cell0~load_uint(33);
int var3 = cell0~load_uint(10);
cell cell1 = cell0~load_ref();
int var4 = cell1~load_bits(512);
int var5 = cell1~load_bits(511);
cell cell2 = cell0~load_ref();
int var6 = cell1~load_bits(1023);
cell cell3 = cell1~load_ref();
....
slice ds = get_data().begin_parse();
cell vars_dict = ds~load_dict();
(int var1, _) = vars_dict.udict_get(64, 1);
(int var2, _) = vars_dict.udict_get(64, 2);
(int var3, _) = vars_dict.udict_get(64, 3);
....
ton (0.26)
git push --force
(или что-то подобное) передают привет.
PS C:\Users\Maxim\Desktop\ton> toncliпробовал сделать по этой инструкции. имею такие выводы :
INFO: 🥰 First time run - i'll create config folder 4you and save some stuff there
INFO: 🤖 Check all executables are installed...
INFO: Adding path to executable func success!
ERROR: Command '['C:\\Users\\Maxim\\Desktop\\ton\\fift.exe', '-V']' returned non-zero exit status 3221225501.
WARNING: 🤖 Can't find executable for fift, please specify it, e.g.: /usr/bin/fift
Path
PS C:\Users\Maxim> func -V
FunC semantic version: v0.2.0
Build information: [ Commit: 8537dd60e6341474967f8e9d04a7b7f6a060ec36, Date: 2022-06-13 20:02:32 +0300]
PS C:\Users\Maxim> lite-client -V
lite-client build information: [ Commit: 8537dd60e6341474967f8e9d04a7b7f6a060ec36, Date: 2022-06-13 20:02:32 +0300]
PS C:\Users\Maxim> fift -V
PS C:\Users\Maxim>
в чем может быть проблема?
which fift
возможно он у вас не в /usr/bin/fift
установлен
C:\\Users\\Maxim\\Desktop\\ton\\fift.exeи тут
/usr/bin/fift
а вам надо найти куда вы его установили и через переменную окружения подсказать ему
PS C:\Users\Maxim\Desktop\ton> ls
Каталог: C:\Users\Maxim\Desktop\ton
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 20.12.2022 11:12 453632 adnl-proxy.exe
-a---- 20.12.2022 11:12 14848 CompilerIdC.exe
-a---- 20.12.2022 11:12 15360 CompilerIdCXX.exe
-a---- 20.12.2022 11:12 7694848 create-hardfork.exe
-a---- 20.12.2022 11:12 3852288 create-state.exe
-a---- 20.12.2022 11:12 5521920 dht-server.exe
-a---- 20.12.2022 11:12 5559296 fift.exe
-a---- 20.12.2022 11:12 1947648 func.exe
-a---- 20.12.2022 11:12 386048 generate-random-id.exe
-a---- 20.12.2022 11:12 367104 generate_common.exe
-a---- 20.12.2022 11:12 445952 http-proxy.exe
-a---- 20.12.2022 11:12 2070528 json2tlo.exe
-a---- 20.12.2022 11:12 2798748 libcrypto-1_1-x64.dll
-a---- 20.12.2022 11:12 3077632 lite-client.exe
-a---- 20.12.2022 11:12 556976 openssl.exe
-a---- 20.12.2022 11:12 779776 pow-miner.exe
-a---- 20.12.2022 11:12 8849920 rldp-http-proxy.exe
-a---- 20.12.2022 11:13 1288192 tlbc.exe
-a---- 20.12.2022 11:13 4340224 tonlib-cli.exe
-a---- 20.12.2022 11:13 4231168 tonlibjson.dll
-a---- 20.12.2022 11:13 929792 validator-engine-console.exe
-a---- 20.12.2022 11:13 13564928 validator-engine.exe
int mul(int a, int b, int m) method_id inline_ref {
(_, int r) = muldivmod(a % m, b % m, m);
return r;
}
{ message: The origin localhost don't have permissions to use a wallet.,
code: 1001. }
withdraw_from_pool
w
ImportError: cannot import name 'BitString' from 'bitstring' (/usr/local/lib/python3.10/site-packages/bitstring.py)
fift
tonapi.help
: abuse@namecheap.com
/tmp/tmprn65enec.fif
: contract_tests.fif:2040: PROC:<{:procedure already defined
torskiy@DESKTOP-PCD7KCG:~$ docker build . -t toncli-local
[+] Building 0.0s (1/2)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3536167109/Dockerfile: no such file or directory
torskiy@DESKTOP-PCD7KCG:~$ docker run --rm -it toncli-local
ERROR: Command '['/usr/local/bin/fift', '-V']' died with <Signals.SIGILL: 4>.
ERROR: Command '['/usr/local/bin/fift', '-V']' died with <Signals.SIGILL: 4>.
ERROR: 😳 Executable path is not working correct, output:
WARNING: 🤖 Can't find executable for fift, please specify it, e.g.: /usr/bin/fift
Path:
Dockerfile no such file or directory
.func: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
bounce:0
):Error interpreting standard preamble file `Fift.fif`: cannot locate file `Fift.fif`
Check that correct include path is set by -I or by FIFTPATH environment variable, or disable standard preamble by -n.
valid_until <= now
)
() recv_internal(slice in_msg_body) impure {
throw_if(35,in_msg_body.slice_bits() < 32);
int n = in_msg_body~load_uint(32);
slice ds = get_data().begin_parse();
int total = ds~load_uint(64);
total += n;
set_data(begin_cell().store_uint(total, 64).end_cell());
}
И тест к нему:int __test_example() {
set_data(begin_cell().store_uint(0, 64).end_cell());
cell message = begin_cell().store_uint(10, 32).end_cell();
var (int gas_used1, _) = invoke_method(recv_internal, [message.begin_parse()]);
var (int gas_used2, stack) = invoke_method(get_total, []);
[int total] = stack;
throw_if(101, total != 10);
return gas_used1 + gas_used2;
}
Почему тест не проходит? Все делаю по гайду, логика кода вроде верная (обнуляем ячейку, что то кладем туда, потом сравниваем то что внутри)INFO: Test [__test_example] status: [FAIL], code: [2] Total gas used (including testing code): [3587]Если 2 это TVM exit code, то оно почему то считает стек не заполненным?
int mul_mod(int a, int b, int m) inline_ref {В поле result находится кол-во газа, потраченное на саму функцию. Такая вот оптимизация.
(_, int r) = muldivmod(a % m, b % m, m);
return r;
}
int mul_mod_better(int a, int b, int m) inline_ref {
(_, int r) = muldivmod(a, b, m);
return r;
}
int mul_mod_best(int a, int b, int m) asm "x{A988} s,";
Test [multiplication_128_mod_25519] OK, result: [[ 1232 ]], gas usage: [4791] (0.00479 TON == 208.72 req/TON)
Test [better_multiplication_128_mod_25519] OK, result: [[ 1110 ]], gas usage: [4669] (0.00467 TON == 214.18 req/TON)
Test [best_multiplication_128_mod_25519] OK, result: [[ 65 ]], gas usage: [3124] (0.00312 TON == 320.10 req/TON)
x=0 is used for ordinary messages; x=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); x=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); x'=x+1 means that the sender wants to pay transfer fees separately; x'=x+2 means that any errors arising while processing this message during the action phase should be ignored. Finally, x'=x+32 means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with +128.
Argument of type 'import(".../hello-world/node_modules/ton/dist/boc/Cell").Cell' is not assignable to parameter of type 'import(".../hello-world/node_modules/ton-contract-executor/node_modules/ton/dist/boc/Cell").Cell'.
Types of property 'bits' are incompatible.
Type 'import(".../hello-world/node_modules/ton/dist/boc/BitString").BitString' is not assignable to type 'import(".../hello-world/node_modules/ton-contract-executor/node_modules/ton/dist/boc/BitString").BitString'.
Property '#private' in type 'BitString' refers to a different member that cannot be accessed from within type 'BitString'.
contract = await SmartContract.fromCell(
initCodeCell, initDataCell);
int balance() inline_ref method_id {
return get_balance().pair_first();
}
(int) load_data() inline {
var ds = get_data().begin_parse();
return (ds~load_uint(32));
}
() save_data(int counter) impure inline {
set_data(begin_cell()
.store_uint(counter, 32)
.end_cell());
}
int counter() method_id {
var (counter) = load_data();
return counter;
}
() recv_internal(cell in_msg) impure {
save_data(2);
}
${chainId}:${hex}
).toString(true, true, true);
Master: -1,
Basic: 0,
cell
, а slice
. Хотя in_msg
и не используется, но всё равно может возникать ошибка проверки типов."decimals":"0"
вместо "decimals":0
, впрочем в самом же стандарте пример без строки 🫤
@fragmentChat
).