Reputation
Badges 6
Editor Freshman 3 × Eureka! Newbie Enthusiast ScholarIn my personal experience, I would use code like this to track the result of a transaction:
=== Your Code Parameters ===
.....
console.log("============================");
console.log("Interacting with Collection Contract: \n" + contract_address);
let seqno: number = await wallet_address.getSeqno();
let transfer = await wallet_address.sendTransfer({
seqno: seqno,
secretKey: keyPair.secretKey,
messages: [
internal({
value: toNano("...
When you verify a smart contract's source code on a blockchain explorer or website, the page generates a unique code hash for the contract. This code hash is essentially a digital fingerprint of the contract's bytecode. When someone views the verified source code on the explorer, the explorer looks up the code hash and retrieves the corresponding source code.
However, if the contract's bytecode is updated using the set_code()
instruction, the code hash will change. **This means that the ...
That's a great question. If you check the repository URL for this NFT, which is the code in FunC
, Telemint, you'll see a line of code that reads throw_unless(err::not_enough_funds, bid >= initial_min_bid);
*1.
This line means that you need more funds in the NFT itself to trigger this kind of transaction in practice. In other words, "not enough funds" means that you should replenish the balance of the NFT smart contract so that there is more than 💎1.
*1: https://github.com/T...
Good question. As a community contributor, I share this concern. The information I can provide is sourced from tonscan.org.
- TonFoundation Address (approx. $62M): https://tonscan.org/address/EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N
- TON DNS Address (approx. $7.6M): https://tonscan.org/address/EQC3dNlesgVD8YbAazcauIrXBPfiVhMMr5YYk2in0Mtsz0Bz
- TON Ecosystem reserve (approx. $947M): https://tonscan.org/address/EQAhE3sLxHZpsyZ_HecMuwzvXHKLjYx4kEUehhOy2JmCcHCT#transactions
I w...
The maximum size of a smart contract deployed on the TON Network depends on the complexity of the contract and the number of cells it utilizes. In general, the size of a smart contract's Bag-of-Cells (BoC) representation should not exceed the size limit of a single shardchain block, which is 2 MB
. However, practical limits for smart contracts are much smaller.
A single cell in the TON Network can store up to 1023 data
bits and has 4 references to other cells
. The more complex the sma...
Yes, this is a great question!
TON DNS is a decentralized domain name system that lets you assign a human-readable name to crypto wallets, smart contracts, and websites.
Domain names are NFTs that can be stored, gifted, or sold. Auctions for domain names last for one week, and bids must be at least 5% higher than the previous bid. The highest bidder at the end of the auction period wins the domain name.
In addition, the .ton domain can be used as a multi-support gate to ...
There are always 4 arguments on stack when recv_internal
is called.
By declaring recv_internal
with less than 4 arguments you force FunC to ignore most deep variables (they still will be there, but your code will be unaware for the whole TVM execution).
in_msg_full - cell with raw message cell that contains all the flags and additional fields
in_msg_body - slice that only contain body of the message
Please check https://ton.org/docs/learn/tvm-instruction...
Before we start, you need to know the message itself is sending on Cell
data type in TON. Which means, each cell has a limit of 1023 bits
for storing data. This limit includes the data stored within the cell and any necessary headers or metadata.
Suppose you have a message body that is 900 bits long, and you want to store it in a cell along with its message header. The message header itself will also take up some bits for storing its fields, such as message type, address information,...
This is a great question! (Took me a long time to understand as well)
So basically, you are asking:
- Why do we store the uint(....) there?
- And why do we deal with int_msg_info over there?
1/ The message structure
To understand why we store the uint(...) in the message, you need to understand how TVM works for Message. In practice, the Message Layout shows that to "compress" the message we want to store, we must store it into a "Cell" and upload it to the smart contract a...
compute_gas_fees
and other_fee
are fees charged by the TON network for processing smart contract transactions.
compute_gas_fees
are the fees charged for the computation required to execute the smart contract code. This includes the cost of processing instructions, reading and writing data to the blockchain, and validating transactions. The amount of compute_gas_fees charged depends on the complexity of the smart contract code and the amount of resources required to execute it.
`ot...
Good question! Essentially, we are following the content from getgems.io, the largest NFT marketplace on TON. It suggests that we can use two specific addresses as dead addresses, similar to what we know from Ethereum:
1/ "EQD__________________________________________0vo"(https://dton.io/a/EQD__________________________________________0vo)
2/ "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c"(https://dton.io/a/EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c)
By sending NFTs to ...
The reason for the different addresses generated by TonHub, TonKeeper, and wallet.ton.org when using the same mnemonic phrase is because the address depends on the wallet contract version being used.
It is important to note that v4 of the wallet contract allows for the installation of plugins, which could potentially introduce security vulnerabilities if used improperly. If you do not require the advanced features provided by v4, it is recommended that you use v3 ins...
The function run_ticktock
only operates in the masterchain and it's exclusive to the smart contracts whose addresses are specified in the corresponding config parameter.
Therefore, such smart contracts cannot work on a basechain.
Yes, you can find the related of code of NFTs in FunC here:
Certainly, the EVM ecosystem is indeed known for its robust block explorers, and there are similar tools available in the TON ecosystem as well. These explorers provide detailed insights into blocks, transactions, and events happening on the TON network:
Explorer.toncoin.org - A comprehensive block explorer that provides detailed information about the FreeTON blockchain, including blocks, transactions, and account details.
DTON.io - This is another popular TON block explorer that provid...
Yes, gas consumption does increase with the size of the dictionary. This is due to how the dictionary is packed.
Specifically, it's packaged as a compressed prefix tree into a cell tree. When you perform a read operation, all the cells on the path to your value are read, with each cell reading costing 25/100 of the gas.
Thus, larger dictionaries, which have more cells to read, will consume more gas.
Generally speaking, you can use https://testnet.toncenter.com/api/v2/#/accounts/get_address_information_getAddressInformation_get to acquire all formats of a single address.
However, in practice, you can also utilize libraries to generate these. Below are a few snippets of code:
import { mnemonicToPrivateKey } from "ton-crypto";
let mnemonics = "YOUR_MNEMONICS";
let keyPair = await mnemonicToPrivateKey([mnemonics]);
// ✨ 🟡 Test-net:
const client = new TonClient4(...
Generally speaking, the FunC code op::increase = "op::increase"c
first converts this into a uint
(unsigned integer), since in TVM (Turing Virtual Machine), communication is done only in unsigned integers to distinguish the unlimited
functions that you build.
On the other hand, the uint
can be converted into hex
code to save space when storing it in a Smart Contract.
**Here's an example in TypeScript to finalize the op-code into uint and hex data. It uses the CRC32 method to...
Unfortunately, the answer is no.
Because the cells are immutable, and partially because you can cheaply calculate the cell hash.
That is correct; you need to use Snake Data Encoding if you want to store more than 1023 bits in a Smart Contract (TVM).
You have no other option.
The short answer is to use the method that Arter provided by checking the snake encoding example code here:
Snake Encoding Example Code
Also, for a more comprehensive understanding of how to incorporate this process into your work, you can refer ...
You can sign a Cell with ton-crypto
or ton-core, and later verify it using check_signature
or check_data_signature
from stdlib.fc
in FunC.
Here's an approximate code snippet that you should review:
sign(yourCell.hash(), keypair.secretKey);
## And in the FunC contract, check like this:
check_signature(cell_hash(your_cell), signature, public_key)
For more details, you can refer to the [TON documentation on signature checks](https://docs.ton.org/develop/fun...
Overall
In big endian byte order, the **most significant byte (MSB) is stored at the lowest memory address, and the least significant byte (LSB) is stored at the highest memory address.
This is also known as network byte order, because it is the format used in internet protocols like TCP/IP in general.
Big-Endian in TVM
In TVM, integers within cells are serialized using the big-endian format by default. This means that when an integer is converted into a sequence of bytes t...
First of all, LT (Logical Time) is unique for each smart contract in TON. This means that different addresses produce different hashes for transactions, and each will be tagged with a different Logical Time inside the block.
In an** asynchronous system **like TON, you can't get a response from the destination smart contract in the same transaction. A contract call may take a few blocks to be processed, depending on the length of the route between the source and destination.
The asynchro...
Based on the Whitepaper found here, logical time is described as:
For this purpose, the creation of an outbound message is considered an atomic event, logically dependent on the previous message created by the same transaction, as well as on the previous transaction of the same account, on the inbound message processed by the same transaction, and on all events contained in the blocks referred to by hashes contained in the block with the same transactio...
Hi, there are a few potential reasons here. Although I spend most of my time coding in Tact (https://tact-lang.org/), the process is nearly the same.
Primarily, it depends on your smart contract code design. But first and foremost, you need to deploy the contract code to the TVM, then trigger the initial parameter settings. This is essential, no matter what.
It seems like you've deployed your contract code and data, but haven't successfully initialized the contract on the blockchain. ...
I don't have any experience dealing with Validator configuration, but I can share with you the idea for the Public Key we use in TON and how it interacts with smart contracts.
import { randomBytes } from "crypto";
import { keyPairFromSeed } from "ton-crypto";
let keypair = keyPairFromSeed(randomBytes(32));
let public_key_hex = keypair.publicKey.toString("hex");
let public_key_int = BigInt("0x" + public_key_hex);
let public_key_cell = beginCell().storeU...
In order to ensure that the first transaction has been processed and the wallet has received the TON coins before attempting to send the jetton, you should wait for a confirmation of the first transaction.
The amount of time it takes for a transaction to be confirmed can vary depending on factors such as network congestion and transaction fees. Generally, you should wait for at least one confirmation, which typically takes around 1-2 minutes on the TON network.
When sending the TON ...
Great question. The short answer is no.
Because each NFT owner is locally recorded, it means you need to send a transaction to each NFT.
But luckily, you can still use a series of CLI commands to send multiple transactions to reset each NFT's owner.
Be aware that the difference between EVM and TVM is that the TON network supports sharding your contract in a scalable way. If you launch a collection with a maximum of 10,000 in circulation, then you will have 10,001 contracts: one ...