TON Dev Chat
error: redefinition of built-in assembler function `cons`
forall X -> tuple cons(X head, tuple tail) asm "CONS";
.
.
.
raise ValueError(f"😥 No address_text found in {contract.address}")
ValueError: 😥 No address_text found in C:\Users\[my-username]\AppData\Local\toncli\toncli\wallet/build/contract_address
() 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 get_total() method_id {
slice ds = get_data().begin_parse();
int total = ds~load_uint(64);
return total;
}
toncli deploy -n testnet
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:16:9: error: undefined function `now`, defining a global function of unknown type
now(), ;; unixtime
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:20:35: error: undefined function `null`, defining a global function of unknown type
unsafe_tuple([1000000000, null()]), ;; balance_remaining
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:21:9: error: undefined function `my_address`, defining a global function of unknown type
my_address(), ;; myself
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/stdlib.func:29:22: error: function `null` was already declared as an ordinary function
forall X -> X null() asm "PUSHNULL";
^
INFO:
🌈 Start tests
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:16:9: error: undefined function `now`, defining a global function of unknown type
now(), ;; unixtime
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:20:35: error: undefined function `null`, defining a global function of unknown type
unsafe_tuple([1000000000, null()]), ;; balance_remaining
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:21:9: error: undefined function `my_address`, defining a global function of unknown type
my_address(), ;; myself
(base) shendengdui@MacBook-Pro-12 test % toncli start wallet
INFO:
🐒 I'll create folder /Users/shendengdui/Desktop/test/wallet with project wallet and all needed files
INFO:
👑 Folder successfully created - happy blockchain hacking
INFO:
🐼 You now can do cd wallet and toncli deploy -n testnet
(base) shendengdui@MacBook-Pro-12 test % cd wallet
(base) shendengdui@MacBook-Pro-12 wallet % toncli deploy -n testnet
INFO:
🚀 You want to interact with your contracts ['contract'] in testnet - that's great!
INFO:
✋ Do not panic - i'm creating wallet in /Users/shendengdui/Library/Application Support/toncli, so you can easily manage your contracts
INFO:
🐒 I'll create folder /Users/shendengdui/Library/Application Support/toncli/wallet with project wallet and all needed files
INFO:
👑 Folder successfully created - happy blockchain hacking
INFO:
🐼 You now can do cd wallet and toncli deploy -n testnet
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:16:9: error: undefined function `now`, defining a global function of unknown type
now(), ;; unixtime
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:20:35: error: undefined function `null`, defining a global function of unknown type
unsafe_tuple([1000000000, null()]), ;; balance_remaining
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/tests-helpers.func:21:9: error: undefined function `my_address`, defining a global function of unknown type
my_address(), ;; myself
^
/Users/shendengdui/Library/Application Support/toncli/func-libs/stdlib.func:29:22: error: function `null` was already declared as an ordinary function
forall X -> X null() asm "PUSHNULL";
^
toncli start wallet
INFO: v0.0.43
(base) shendengdui@MacBook-Pro-12 ~ % pip install https://github.com/disintar/toncli.git
Collecting https://github.com/disintar/toncli.git
Downloading https://github.com/disintar/toncli.git
| 226 kB 860 kB/s
ERROR: Cannot unpack file /private/var/folders/45/94zqnqp12cv193w1g27tlmr80000gn/T/pip-unpack-z5uww80k/toncli.git (downloaded from /private/var/folders/45/94zqnqp12cv193w1g27tlmr80000gn/T/pip-req-build-od59cmkv, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/45/94zqnqp12cv193w1g27tlmr80000gn/T/pip-req-build-od59cmkv
error: undefined function `.slice_bits`, defining a global function of unknown type
throw_if(35, in_msg_body.slice_bits() < 32);
SEND_MODE
works, especially the 2 (ignore errors) flag.
() recv_internal(…) {
…
set_data(…)
send_raw_message(…, 128 + 2)
}
send_raw_message
, I get:body.fif
file."Asm.fif" include
<b
op 32 u,
;;whatelse??
;;comments? how to write them?
b>
cmake --build . --target rldp-http-proxy
.env
change TON_PROXY_REMOTE_ADDR
variable to <ip-of-django>:<your-port>
. If Django is running on the same machine, use localhost. After this restart container with docker compose restart rldp-proxy
.
curl -x in1.ton.org:8080 http://<your-domain>.ton -v
. You should see the html-source of your site. If don’t, check the output for problems.
tonweb-mnemonic
is used to generate a mnemonic phrase and a key pair from it.
docker compose restart rldp-proxy
docker-compose restart rldp-proxy
"TonUtil.fif" include
"build/contract.pk" load-generate-keypair // generate key pair
constant private_key // save private to constant
constant public_key // save public to constant
."Private key: " private_key Bx. cr
."Public key: " public_key Bx. cr
?testnet=true
as a query parameter for wallet.ton.org
did the job.
sendfile x.boc
or it's toncenter API equivalent, does the boc data get broadcast to every wallet's recv_external then the signature (starting bytes of x.boc) checked and processed if matched.recv_external
. And all the documentation I've gone through speaks very sparsely on how to order the boc, and how exactly they're processed when externally sent
this version does not use seqno for replay protection; instead, it remembers all recent query_ids
;; in this way several external messages with different query_id can be sent in parallel
kQDFmYxPYg0UH94u0jbH2RPOVMK2W-f5VdiC6pP-gZ-TPtWB
const transfer = await wallet.createTransfer({
secretKey: key.secretKey, // from the secret mnemonic of the deployer wallet
seqno: seqno,
sendMode: SendMode.PAY_GAS_SEPARATLY + SendMode.IGNORE_ERRORS,
order: new InternalMessage({
to: newContractAddress, // calculated before
value: 0.02, // fund the new contract with 0.02 TON to pay rent
bounce: false,
body: new CommonMessageInfo({
stateInit: new StateInit({ data: initDataCell, code: initCodeCell }), // calculated before
body: null,
}),
}),
});
revoke_authorizations_before
to his token (not to authorized contract, because that would need to increase Merkle proof to prove that there were no deauthorize
messages).
ton-contract-executor
is great for testing contractston-compiler
, which is not WASM
-based. It doesn't work on windows for instance. It would be great to upgrade to ton-compiler v2.0.0
.new SmartContract(code: TonCell | Ton3Cell)
, but fully library agnostic is too far
toncli lc allshards
- currently it shows that there are no shards neither in mainnet nor in testnet.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/var/folders/45/94zqnqp12cv193w1g27tlmr80000gn/T/ipykernel_39202/3923502270.py in <module>
1 # init TonlibClient
----> 2 client = TonlibClient(ls_index=0, config=ton_config, keystore=keystore_dir)
TypeError: __init__() missing 1 required positional argument: 'loop'
in_msg
:...mnemonic.mnemonicToKeyPair(['secret-word-1', 'secret-word-2', ...]).privateKey
not in db
and causes error
TRY:<{}>
debugLogs
fieldSTRDUMP
opcode now logs utf-8 strings
Access to XMLHttpRequest at 'https://testnet.toncenter.com/api/v2/jsonRPC' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field x-ton-client-version is not allowed by Access-Control-Allow-Headers in preflight response.
get_c3
() in func to calculate the address of some other nft index?c3
is a continuation, not a cell, so I think it's impossible.
var wallet = tonweb.wallet.create({publicKey: keyPair.publicKey, wc: 0})
const address = await wallet.getAddress()
address.toString(true, true, false);for different versions
Cell.
fromBoc(Buffer.from
(“te6cckEBAQEAOQAAbnNi0JwAAAAAAAAAADmJaAgAhaRh9xxNzw5iYjZIe2XBXz533u71Al417Ew5NWU4OKIBAgMEBQatCXqU”,'base64’
))[0]// TonWeb version
async function test() {
const boc = "te6cckEBAQEAOQAAbnNi0JwAAAAAAAAAADmJaAgAhaRh9xxNzw5iYjZIe2XBXz533u71Al417Ew5NWU4OKIBAgMEBQatCXqU";
const yourCell = TonWeb.boc.Cell.oneFromBoc(TonWeb.utils.base64ToBytes(boc));
console.log(yourCell);
}
txDataOut = yourCell.beginParse()
txDataOut.readUint(32).toNumber()
//op code which here is 0x7362d09c
txDataOut.readUint(64).toNumber()
// query id
const mintAmount = txDataOut.readCoins();
https://tonapi.io/v1/blockchain/getTransactions?limit=100
x
to the function and when inside function check the type and decide how to serialize it.
for (var key in obj){
}
recv_internal
just unpacks the initial stack int balance, int value, cell msg, slice msg_body
. You don't have to take all values of the stack
Message X
and msg_body is X