Skip to content

Chat questions

Швец Андрей Евгеньевич edited this page Nov 28, 2024 · 18 revisions

1. Do I need to send 2 messages from Jetton Minter to Jetton Wallet to first deploy it (because it deploys with 0 on balance) and then do the actual mint transaction on it?

Answer:

No, when sending a message on the TON blockchain you can both attach the StateInit of the contract and the message body itself at the same time. In this case, if the contract is uninitialized, it will be initialized by your StateInit and then immediately process your message. If you attach a StateInit to a message sent to an already initialized contract, the StateInit will be ignored, and only the message body itself will be processed.


2. Does using ~strdump and ~dump waste gas? They don't only have an effect in sandbox?

Answer:

More likely yes than no. You can see your dump in the retracer.ton.org later, but the validator is free to send your print anywhere, even to its memory, or to /dev/null.


3. Hi all. I'm making Jetton-wallet with modifications, I take it from https://github.com/ton-blockchain/minter-contract/. There in read.me it says, do npm install -> make changes -> npm run build. And here I get an error: FATAL ERROR: 'func' with version >= 0.2.0 executable is not found, is it installed and in path?

Answer:

Use the more up-to-date repository https://github.com/ton-blockchain/token-contract


4. Could you tell me how a contract can find out that tokens have been sent to its Jetton wallet? Are there any standard ways?

Answer:

If its Jetton Wallet sends JettonNotify, it will know. If it doesn't, it is impossible to get this information onchain. (JettonWallet does not have to send notify).


5. Where does the execution of get-methods take place? And where can I find the gas limit for get* methods? Because I write in Sandbox - everything works, and then, even in testnet they tell me - you are asking a bit expensive, here you are (-14) exit code.

Answer:

The calculations take place either on your computer locally, or on your api provider, such as tonapi (this is much more common). It would be nice if execution of all “standard” get-methods could fit within 200k gas. Execution of custom methods depends on what to execute through. Locally you can charge somewhere up to 20-30 million gas units through the emulator. Any more than that is quite risky. Different api offer different gaslimit. In tonapi.io, for example, 1 million.


6. Where can I find the latest version of stdlib.fc?

Answer:

Here


7. Could you tell me how to skip unix_time in a test in Blueprint/Sandbox? To execute transactions at different unix times

Answer:

Just set blockchain.now to needed Unix timestamp.


8. Hi. My contract receives a message and sends exactly the same, I want to calculate how much it will consume forward gas, but to calculate not on its own, but based on int fwd_fee = cs~load_coins(); from the incoming message. What is the correct answer?

  1. It is exactly fwd_fee
  2. It's get_original_fwd_fee from fwd_fee
  3. You need to play with get_forward_fee / get_simple_forward_fee somehow.

Or if someone can explain on fingers why and what is the difference between get_original_fwd_fee, get_forward_fee and get_simple_forward_fee - I would appreciate it Answer:

  • If the message is identical to the one that came in, its fwd_fee will be identical to original_fwd_fee.
  • original_fwd_fee - to find out how much the message you just received paid for.
  • get_forward_fee - find out how much a message consisting of X bits and Y cells will cost (not counting the root cell, more on that next).
  • get_simple_forward_fee - same as the previous one, but without lump_price - the minimum price for sending a message. This price also covers the root cell fee.

Could you please tell me where I can get the actual lite-client/funC/fift as a console utility for linux from?

Clone this wiki locally