Reputation
Badges 5
Editor Freshman Enthusiast Supporter NewbieThere is no need for Ethereum-like proxy contracts in TON. Contracts in TON can upgrade its code without changing its address.
I believe that other TVM projects use PHP heavily, but TON does not. There are PHP community extensions that are available for you to use, but they are still in development:
https://github.com/olifanton/ton
It will allow you to interact with wallets:
https://github.com/olifanton/ton/blob/main/src/Olifanton/Ton/Contracts/Wallets/V4/WalletV4.php
For example, where variable $kp is the keypair and variable $transport is a structure defined by the SDK that essentially acts as a provid...
It is possible to do this, but you would have to generate thousands of different private and public key pairs. I have yet to see one configured specifically for TON, though.
Essentially, you would generate thousands of random mnemonics and filter for ones that are like the parameters that you want.
You can generate key pairs with TonWeb:
const nacl = TonWeb.utils.nacl; // use nacl library for key pairs
const tonweb = new TonWeb();
const key...
Don't remove it!
The minter contract is the parent and wallet is the child. There is one minter instance and N wallet instances (N is the number of holders of your token). Getting rid of the wallet would mean that your users wouldn't own or be able to do anything with your jettons.
There is a Telegram payments bot, but it has yet to integrate TON:
There are some community example projects of TON bots that accept TON payments:
https://github.com/Gusarich/ton-bot-example
https://github.com/LevZed/ton-payments-in-telegram-bot
But if you want something better, you'll have to develop one yourself. You can try starting here:
https://ton.org/docs/develop/dapps/asset-processing/
There are TON NFT explorers. For example, the following explorer is linked on the official TEP-62 NFT standard page:
https://explorer.tonnft.tools/
As for explorers that parse on-chain data, I don't know of any. There are many ways to store data on-chain, but URLs are the most prevalent. Would be a cool project for anyone willing to try it!
I'm not aware of one from a smart contract perspective, though it could be a very cool idea.
TON Rocket Pay has a few services which might be what you're looking for:
https://pay.ton-rocket.com/api/#/subscriptions
The following is from a test file in tonweb. Here's the entire file. https://github.com/toncenter/tonweb/blob/master/src/test-jetton.js
It should be enough for your needs!
const transfer = async () => {
const seqno = (await wallet.methods.seqno().call()) || 0;
console.log({seqno})
console.log(
await wallet.methods.transfer({
secretKey: keyPair.secretKey,
toAddress: JETTON_WALLET_ADDRESS,
...
It really depends on the smart contract code. The standard for NFTs (TEP-62) does not include deletion, however.
https://github.com/ton-blockchain/TEPs/blob/master/text/0062-nft-standard.md
You could always just transfer it to the null address, or if that doesn't work, some other random address.
Probably not through using the CLI, but you can debug directly within the script using dump_stack
:
() dump_stack() impure asm "DUMPSTK";
Try installing via GitHub instead of pip:
Two issues:
- You should read address from slice via
load_msg_addr
, notload_bits
- Store address to builder via
Addr
, notaddr
addr
, is an alias for 256uint. Meanwhile full address serialization with Addr
also includes address format tag, workchain, 256bit part and some additional fields.
You can find them in the following GitHub repository, but they were written in Fift:
https://github.com/ton-blockchain/ton/tree/master/crypto/smartcont
Any node in the TON network has its own ADNL address. It's like IP addresses on the Internet; they are public keys for the network to utilize. It's more like personal information.
You can read more here:
Slices are the way to store strings. At the end of the day, strings are just a bunch of bytes that are interpreted in an ASCII format. You'll have to interpret strings as such when working with them in the smart contract.
https://ton.org/docs/develop/func/literals_identifiers#string-literals
You can define strings with quotation marks like in other languages, but they are stored in such a way that they become a slice of bytes.
You're looking for the dump_stack()
function.
https://ton.org/docs/develop/func/stdlib/#dump_stack
It dumps the last 255 values in the stack and shows the total stack depth.
() dump_stack() impure asm "DUMPSTK";
There's also the ~dump
and ~strdump
built-ins.
This particular issue makes it look like there isn't a specific piece of tech called OpenSSL installed on your device. If you have homebrew installed, you can install with the following:
brew install openssl
The documentation surrounding TON DNS is here:
https://ton.org/docs/participate/web3/dns
Its official site is here:
https://dns.ton.org/
I must stress that this is not the same DNS as what you would find when registering a .com domain address on a typical domain registrar. There is currently no ".ton" nameserver that can be connected to the rest of the world wide web. Instead, these are essentially nicknames for addresses. This is helpful because addresses are hard to memorize, bu...
To a certain degree you can attempt to develop smart contracts on Windows, yes. You can install the TON CLI on Windows with python:
pip install toncli
https://ton.org/docs/develop/smart-contracts/sdk/toncli#windows
Remember that TON is by-and-large a community led project, with much of the infrastructure being decentralized. Unix based systems are nearly the norm in many developer communities. I strongly recommend using WSL (Windows Subsystem for Linux) if you intend ...
https://ton.org/docs/develop/func/stdlib#uncons
uncons
works with lists, not regular tuples.
The idea behind most blockchain dapps (not specific to TON), is to make the entire backend on-chain as smart contracts. It is recommended to avoid any servers for remote calculations. This is possible because the validators/nodes of the blockchain act as the remote servers. They are incentivized to act as remote servers because you pay gas with the TON currency.
The answer is likely "no". Smart contracts are for on-chain logic, and the server is off-chain. The actions taking place on a smart contract will not be determined solely by the TVM.
You could have a smart contract act as an interface for the server to listen to: for example, account A communicates with smart contract B, and sends an event to delete a file of ID C on server D. But there is nothing that guarantees that file C exists, or that the server D's logic will listen to B.
Easiest way to resolve this is by simply downloading a precompiled binary:
It is definitely feasible to implement the logic of your game as a smart contact and then it’s guaranteed to be secure for all users.
Each transaction to change the game state will cost a few cents as gas. If this cost is an issue (for example your game has tens of thousands of transactions per player), then you can use payment channels to reduce this cost.
One of the interesting things mentioned is randomness, which is difficult in the Web3 space. A verifiable randomness function (VRF)...
Do not attempt to deserialize/serialize a reference value like you would an integer. Instead, use load_ref
:
(slice, cell) load_ref(slice s) asm( -> 1 0) "LDREF";
"MessageAny" is a type that refers to type Message.
https://github.com/ton-blockchain/ton/blob/master/crypto/block/block.tlb#L155
This post has JS code that does it as well as explanations how it all works: https://ton-community.github.io/tutorials/01-wallet/
You should be able to get the wallet address like so:
import { mnemonicToWalletKey } from "ton-crypto";
import { WalletContractV4 } from "ton";
async function main() {
// open wallet v4 (notice the correct wallet version here)
const mnemonic = "unfold sugar water ..."; // your 24 secret words (replace ... with the rest of the words)
...
The following is copied from the Tonkeeper News, which is relevant to the question at hand:
End-to-end security with TON Connect
Blockchains directly enable people to control their financial assets by using a so-called “non-custodial” or “unhosted” wallet: an application that keeps a cryptographic key securely on your device. This key is used to authorize transfers of coins and tokens, protecting your account from unexpected or fraudulent charges. Your account exists solely on the b...
The tl-parser utility can be found here:
https://github.com/vysheng/tl-parser
You'll have to compile and install it, but the bash script should work afterwards.
If you mean running your own node, then there are multiple flavors of API:
https://github.com/ton-foundation/ton-api-v4
If you mean something like Ganache for TON, then there's the TON contract executor: