Reputation
Badges 3
Editor Enthusiast NewbieUnlike Ethereum where https://etherscan.io is the only dominant explorer, TON is a more decentralized ecosystem with different explorers that excel in different things. The full list is on https://ton.app/explorers
Some interesting ones:
-
https://tonscan.org - Great for simple things, polished UI. Excellent for users, less for developers.
-
https://tonwhales.com/explorer - Good for developers since it shows much more low level information if you need to debug transactions that faile...
TLDR
For most cases https://www.orbs.com/ton-access is a good solution for getting unthrottled and decentralized RPC access
It also has convenient JS API:
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { TonClient } from "ton";
// get the decentralized RPC endpoint
const endpoint = await getHttpEndpoint();
// initialize ton library
const client = new TonClient({ endpoint });
Longer answer
It depends on your use-case. There are thr...
Unfortunately, since the TON ecosystem is still early, there's no official support for TON in the leading hardware wallets (as of October 2022). But hopefully official support is coming soon.
Unofficial support for Ledger is available from two places:
- https://github.com/ton-blockchain/ledger-app-ton (by core team)
- https://github.com/ton-community/ledger-app-ton (by TonWhales)
The downside of this approach is that support is not official b...
Holding crypto is normally a tradeoff between security and convenience. There is no one right way - so here's a quick overview of various strategies in TON. I'll focus on strategies for holding large amounts (normally by an institution like an exchange or a big whale).
Cold storage / hot storage is a method where you keep a small amount that is used frequently in a hot wallet - a wallet that is convenient but less secure - and the large amount that is used infrequently in a cold wallet - a...
I created a template repo to fullfil the above requirements:
https://github.com/ton-defi-org/tonstarter-contracts
Simply clone this repo and rename the directory and you can start working. The README has a very thorough explanation how everything works.
There is no one official way to develop smart contracts for TON. Every developer has their own best practices. This setup is definitely opinionated and some developers may not appreciate the choices made. Nevertheless, I stand ...
When discussing payments on TON, there are two methods you should be aware of:
1. Payment Channels
This method is useful when you have many small payments between several parties and gas cost (transaction fee) is an issue. This method will eliminate the blockchain fees and make them constant and independent on the number of payments.
The method works by using a template standard smart contract called PaymentChannel that the two parties deploy an instance of. Then the two parties ...
It is not possible for one contract on TON to call a method on another smart contract on TON.
The pattern of contracts calling contracts synchronously (within the flow of the same transaction) originates from Solidity and the EVM but this pattern is not applicable to all blockchains. There are several conceptual differences between TON and the EVM - you can read more about them here.
I...
Option 1 - download pre-compiled TON binaries
You can find pre-compiled binaries for func
, fift
and lite-client
in the repo https://github.com/ton-defi-org/ton-binaries
-
Download the binaries from the Releases page of this repo - make sure to select the correct version according to the operating system you're using and install the additional dependencies
-
After download, make sure the downloaded binaries are execu...
TLDR
For regular user work, always use workchain 0 - which is the workchain with workchain_id
= 0
What are the different chains in TON?
-
One master chain - the special unique workchain with
workchain_id
=-1
Mostly used by network validators for running the PoS elections contracts, regular users don't normally send transactions on this chain.
-
Up to 2^32 workchains - today there's only one with
workchain_id
=0
but possibly more in the future
...
TLDR
When implementing dapps - always use internal messages only.
Never use external messages. You can safely ignore the fact that external messages exist.
Wallets on TON are smart contracts too
Unlike most blockchains, Ethereum included, when a user on TON downloads a wallet app, this wallet app will deploy a wallet smart contract for the user. This wallet smart contract holds the user's TON coin balance.
Every interaction that the user does takes place through this ...
The TVM has a special function for dumping variables in debug - ~dump
Run ~dump(variable_name);
to print a variable's contents.
Run ~dump(12345);
to print the number 12345
.
Example:
() recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {
;; let's say I want to print the value of the variable msg_value
~dump(msg_value);
}
Please note that this command will not run on mai...
TLDR
No. Not at this point.
Is this good idea?
The TON (ton.org) core team is against using Solidity. TON and its TVM are very different from Ethereum and its EVM. For example, you can't make synchronous calls to other contracts, you can only send an asynchronous message. You can read more about the other differences here. Using Solidity would force EVM state of mind on the ...