Forwarded from TOLK lang
π«§ Tolk v0.11: type aliases, union types, and pattern matching
This update might confuse you at first. You may wonder: "Why do we need this? How will it be useful?". But in the end, you'll see how everything comes together bringing seamless and generalized message handling.
β Notable changes in Tolk v0.11:
1. Type aliases
2. Union types
3. Pattern matching for types
4. Operators
5. Pattern matching for expressions
6. Semicolon for the last statement in a block can be omitted
PR on GitHub with detailed info.
β Type aliases
Tolk now supports type aliases, similar to TypeScript and Rust.
An alias creates a new name for an existing type but remains interchangeable with it. No performance overhead β a compile-time feature.
β Union types `T1 | T2 | ...`
They now allow a variable to hold multiple possible types.
Nullable types
At the TVM level, union types work as tagged unions β similar to Rust enums but more flexible.
β Pattern matching
The only way to work with union types is matching them:
Matching is based on smart casts β inside each branch, the variable is automatically narrowed to the matched type.
It can also be used as an expression:
So, `match` + smart casts are our way for union types. You may notice that it's close to enums in Rust. But we don't have enum. Union types are more general and powerful.
β `match` for expressions
As you see, match also works for constant expressions, similar to switch in other languages.
β Union types and TL/B `Either`
Look how clean this is:
No need to manually handle bits from the slice β it's naturally expressed in the type system!
β Union types and TL/B constructors
Moreover β handling incoming messages is beautifully expressed with union types.
β Union types and future structures
The ultimate goal? You'll describe each incoming message as a struct, create a union type for them, parse a slice, and just match over variants:
π³ So, union types (that perfectly work with tensors) will seamlessly work with structures. With union types, you will declare both Either and different kinds of messages. Combined with intN and other types, they will allow to express (almost) any practical TL/B construction. They are not limited to message routing β in other words, message routing does not differ from handling any field, any storage, or any cell in general.
This update might confuse you at first. You may wonder: "Why do we need this? How will it be useful?". But in the end, you'll see how everything comes together bringing seamless and generalized message handling.
β Notable changes in Tolk v0.11:
1. Type aliases
type NewName = <existing type>2. Union types
T1 | T2 | ...3. Pattern matching for types
4. Operators
is and !is5. Pattern matching for expressions
6. Semicolon for the last statement in a block can be omitted
PR on GitHub with detailed info.
β Type aliases
Tolk now supports type aliases, similar to TypeScript and Rust.
type UserId = int32;
type MaybeOwnerHash = bytes32?;
An alias creates a new name for an existing type but remains interchangeable with it. No performance overhead β a compile-time feature.
β Union types `T1 | T2 | ...`
They now allow a variable to hold multiple possible types.
fun whatFor(a: bits8 | bits256): slice | UserId { ... }
var result = whatFor(...); // slice | UserId
Nullable types
T? are now formally T | null. At the TVM level, union types work as tagged unions β similar to Rust enums but more flexible.
β Pattern matching
The only way to work with union types is matching them:
match (result) {
slice => { /* result is slice here */ }
UserId => { /* result is UserId here */ }
}
Matching is based on smart casts β inside each branch, the variable is automatically narrowed to the matched type.
It can also be used as an expression:
type Pair2 = (int, int);
type Pair3 = (int, int, int);
fun getLast(tensor: Pair2 | Pair3) {
return match (tensor) {
Pair2 => tensor.1,
Pair3 => tensor.2,
}
}
So, `match` + smart casts are our way for union types. You may notice that it's close to enums in Rust. But we don't have enum. Union types are more general and powerful.
β `match` for expressions
val nextValue = match (curValue) {
1 => 0,
0 => 1,
else => -1
};
As you see, match also works for constant expressions, similar to switch in other languages.
β Union types and TL/B `Either`
T1 | T2 will be directly mapped to TL-B (Either T1 T2). Look how clean this is:
(Either SmallPayload LargePayload) becomes
struct StoragePart {
data: SmallPayload | LargePayload;
// (de)serialized as '0' + ... or '1' + ...
}
match (s.data) {
SmallPayload => ...
LargePayload => ...
}
No need to manually handle bits from the slice β it's naturally expressed in the type system!
β Union types and TL/B constructors
T1 | T2 | ... is a typed way to describe multiple constructors from TL/B. Generally, they can be used anywhere inside a storage or a message. Moreover β handling incoming messages is beautifully expressed with union types.
β Union types and future structures
The ultimate goal? You'll describe each incoming message as a struct, create a union type for them, parse a slice, and just match over variants:
// don't mind about opcodes yet
struct CounterIncBy { byValue: int32 }
struct CounterReset {}
struct ... other messages
type IncomingMessage = CounterIncBy | CounterReset | ...;
// ... after parsing a message
match (msg) {
CounterIncBy => {
newCounter = curCounter + msg.byValue
}
CounterReset => {
newCounter = 0
}
...
}
π³ So, union types (that perfectly work with tensors) will seamlessly work with structures. With union types, you will declare both Either and different kinds of messages. Combined with intN and other types, they will allow to express (almost) any practical TL/B construction. They are not limited to message routing β in other words, message routing does not differ from handling any field, any storage, or any cell in general.
π₯17π6π3
Forwarded from Ton Console (Denis Subbotin [Ρ
ΠΎΡΠ΅Ρ Π²Π°ΡΠΈ Π΄Π΅Π½ΡΠ³ΠΈ])
π Sign Arbitrary Data with TON Connect
The latest update to our TON Connect implementation introduces a powerful new feature: the ability to sign arbitrary data β from plain text and binary blobs to BOC (cell) format.
This unlocks new use cases in the TON ecosystem: secure off-chain flows, verifiable signatures, and advanced on-chain logic β all through the familiar TON Connect interface.
Now supported in the latest versions of Tonkeeper on iOS and Android.
Explore the guide and start building β
The latest update to our TON Connect implementation introduces a powerful new feature: the ability to sign arbitrary data β from plain text and binary blobs to BOC (cell) format.
This unlocks new use cases in the TON ecosystem: secure off-chain flows, verifiable signatures, and advanced on-chain logic β all through the familiar TON Connect interface.
Now supported in the latest versions of Tonkeeper on iOS and Android.
Explore the guide and start building β
π₯7π4β€βπ₯1
Forwarded from BotNews
Bot API 9.0
Announcing the largest Bot API update of 2025 (so farπ )
πͺ Telegram Business 2.0
β’ Bots can now fully customize the branding of Business Accounts β managing their name, username, bio and profile pictures.
β’ Introduced support for managing Paid Giftsπ , including conversions, transfers and upgrades.
β’ Bots can now checkβοΈ Telegram Star balances and transfer Stars from managed businesses.
β’ Bots can now easily mark Business messages as read or delete them.
β’ Added extensive support for managing stories on Business accounts β featuring photos, videos and interactive elements like links, locations, reactions, weather info and even Gifts.
β’ All stories posted by bots can also be edited or deleted.
β’ Introduced granular Business permissions, giving users even finer control over connected bots.
ποΈ Mini App Storage
β’ Mini Apps can now store data locally on the user's device.
β’ Sensitive tokens can be safely persisted in a specialized secure storage.
π Telegram Gifts
β’ Introduced support for unique Gifts β with detailed model, symbol and backdrop info.
β’ Bots can also check which Gift types are accepted by users and chats.
βοΈ Paid Messages
β’ Bots can now track how many Stars users paid to send a message.
β’ This includes out-of-the-box support for paid messages in both groups and business accounts.
βοΈ Telegram Premium
β’ Bots can now gift a Telegram Premium subscription paid in Stars.
β’ And more, see the full changelog for details:
https://torg.tg-me.sbs/bots/api-changelog#april-11-2025
Announcing the largest Bot API update of 2025 (so far
β’ Bots can now fully customize the branding of Business Accounts β managing their name, username, bio and profile pictures.
β’ Introduced support for managing Paid Gifts
β’ Bots can now check
β’ Bots can now easily mark Business messages as read or delete them.
β’ Added extensive support for managing stories on Business accounts β featuring photos, videos and interactive elements like links, locations, reactions, weather info and even Gifts.
β’ All stories posted by bots can also be edited or deleted.
β’ Introduced granular Business permissions, giving users even finer control over connected bots.
β’ Mini Apps can now store data locally on the user's device.
β’ Sensitive tokens can be safely persisted in a specialized secure storage.
β’ Introduced support for unique Gifts β with detailed model, symbol and backdrop info.
β’ Bots can also check which Gift types are accepted by users and chats.
β’ Bots can now track how many Stars users paid to send a message.
β’ This includes out-of-the-box support for paid messages in both groups and business accounts.
β’ Bots can now gift a Telegram Premium subscription paid in Stars.
β’ And more, see the full changelog for details:
https://torg.tg-me.sbs/bots/api-changelog#april-11-2025
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯11π1π1
π Welcome Challenge: A Tact Developers Competition!
DivaTech is launching TON Contests β a platform for hosting competitions for TON smart contract developers.
To celebrate the launch, weβre kicking off our first contest β Welcome Challenge with a $1000 prize pool!
Youβll face 5 easy-to-medium-level tasks in Tact smart contract development, with 6 hours to solve them.
π When: April 13, 3:00 PM β 9:00 PM (GMT+3)
π Where: Online at toncontests.com
π Prizes:
π₯ Top 5: $100 each
π₯ Next10: $35 each
π₯ Next 15: $10 each
Registration for the Welcome Challenge is now open
DivaTech is launching TON Contests β a platform for hosting competitions for TON smart contract developers.
To celebrate the launch, weβre kicking off our first contest β Welcome Challenge with a $1000 prize pool!
Youβll face 5 easy-to-medium-level tasks in Tact smart contract development, with 6 hours to solve them.
π When: April 13, 3:00 PM β 9:00 PM (GMT+3)
π Where: Online at toncontests.com
π Prizes:
π₯ Top 5: $100 each
π₯ Next10: $35 each
π₯ Next 15: $10 each
Registration for the Welcome Challenge is now open
β‘7π₯5π4β€βπ₯3
Forwarded from TON Contests
Media is too big
VIEW IN TELEGRAM
π§ Tact Smart Battle π€
Join the ultimate smart contract challenge powered by Tact, organized by TON Studio & Codeforces
π
Prize Pool β $20,000 in Toncoin!
π― Challenge Tasks:
1. Simple Voting β basic voting system.
2. Serial Voting β multiple proposals via a master contract.
3. Scalable Voting β support up to 4 billion voters.
4. Voting with Refunds β refunds to voters.
5. Gas-Managed Voting β fully optimized contracts.
π Rewards:
- Top 128 participants share the prize pool and receive exclusive Soulbound Tokens (SBTs).
- All participants with valid solutions also receive a Participant SBT.
- SBTs include embedded on-chain developer reputation.
βοΈ Additional Perks:
- Top participants will be invited for job interviews at TON Studio.
β° Duration: 7 days
ποΈ Start Date: April 21, 12:00 (UTC+3)
π Deadline: April 28, 12:00 (UTC+3)
Registration:
π Challenge Link (Codeforces)
Registration guide:
π Notion link
Community & Support:
π Telegram Challenge Chat
Good luck and may your contracts be efficient and bug-free!π π₯
Join the ultimate smart contract challenge powered by Tact, organized by TON Studio & Codeforces
1. Simple Voting β basic voting system.
2. Serial Voting β multiple proposals via a master contract.
3. Scalable Voting β support up to 4 billion voters.
4. Voting with Refunds β refunds to voters.
5. Gas-Managed Voting β fully optimized contracts.
- Top 128 participants share the prize pool and receive exclusive Soulbound Tokens (SBTs).
- All participants with valid solutions also receive a Participant SBT.
- SBTs include embedded on-chain developer reputation.
- Top participants will be invited for job interviews at TON Studio.
π Deadline: April 28, 12:00 (UTC+3)
Registration:
Registration guide:
Community & Support:
Good luck and may your contracts be efficient and bug-free!
Please open Telegram to view this post
VIEW IN TELEGRAM
β‘8π₯5π3π€©3πΏ2π1
This media is not supported in your browser
VIEW IN TELEGRAM
π Tact v1.6.6 is released!
The final patch release of this v1.6 series is upon us, and it brings a significant tooling improvement, amongst other things. Meet the official Tact formatter β a new tool that ensures consistent code style across your Tact projects. It ships with Tact v1.6.6, and you can run it in your projects via
The v1.6.* series of patches has been a journey of refinement and polish, setting the stage for what's coming next. As we close this chapter, we're already working hard on exciting new features for the future.
For now, let's explore the Tact v1.6.6 release:
π§° Standard library additions and changes
β’ Added compute phase exit code constants reserved by the Tact compiler, such as
β’ Added the SignedBundle struct and the corresponding verifySignature method.
β’ Added
β’ Optimized the
π Bug fixes
There were a lot of those. Remember that last time we started fuzzing the compiler with LLMs to root out bugs? Well, we found many bugs that way and fixed even more β many error messages got way more informative and useful. Some bug fixes allowed for seemingly unrelated UX improvements too.
One nice example of a second-order fix would be that the
See the full release notes for a long list of bugs squished and error messages improved.
βοΈ Documentation updates
β’ Added a "Learn Tact in Y minutes" page, which gives a whirlwind code-first tour of the Tact language.
β’ Any AI vibe coders out there? The docs now generate
β’ The "gas best practices" page got updated with new recommendations, such as specialized math functions or the
β’ Lots of examples fixed, with more fixes to arrive as we speak.
π§³ Formatter!
You can run it via
Furthermore, it also ships with our official language server and VSCode extensions. See the tact-language-server's README.md for installation details.
π See the full release notes for Tact v1.6.6
π₯ And upgrade Tact in your projects
In about 4 days from now, on April 21 at 12:00 (UTC+3), the Tact Smart Battle will begin! It is the ultimate smart contract challenge powered by Tact and organized by TON Studio & Codeforces. The prize pool is $20,000 in Toncoin, and the top 128 participants will receive exclusive Soulbound Tokens (SBTs). Moreover, the best battlers will be invited for job interviews at TON Studio.
And all participants with valid solutions would also receive a Participant SBT.
π Register, if not already: Codeforces
β’ Here's the registration guide, just in case: Notion
β’ Hop in the community chat to ask questions, receive support and have fun learning and using Tact: @tact_smart_battle
π² flint and tact
β¨οΈ @tact_kitchen from the @ton_studio
The final patch release of this v1.6 series is upon us, and it brings a significant tooling improvement, amongst other things. Meet the official Tact formatter β a new tool that ensures consistent code style across your Tact projects. It ships with Tact v1.6.6, and you can run it in your projects via
npx tact-fmt or by invoking a format command in your editor. You'd need to install the Tact's language server or the VSCode extension for that β see the tact-language-server repo for details.The v1.6.* series of patches has been a journey of refinement and polish, setting the stage for what's coming next. As we close this chapter, we're already working hard on exciting new features for the future.
For now, let's explore the Tact v1.6.6 release:
π§° Standard library additions and changes
β’ Added compute phase exit code constants reserved by the Tact compiler, such as
TactExitCodeNullReferenceException (128) and many others.β’ Added the SignedBundle struct and the corresponding verifySignature method.
β’ Added
sendRawMessage and sendRawMessageReturnForwardFee functions as replacements for their deprecated counterparts.β’ Optimized the
sha256() function to about ~270 less gas used per call and added the keccak256() function that works with arbitrarily long slices.π Bug fixes
There were a lot of those. Remember that last time we started fuzzing the compiler with LLMs to root out bugs? Well, we found many bugs that way and fixed even more β many error messages got way more informative and useful. Some bug fixes allowed for seemingly unrelated UX improvements too.
One nice example of a second-order fix would be that the
require() function now supports constants as its second parameter. You no longer need to provide identical string literals everywhere β define a string constant somewhere and reuse it!See the full release notes for a long list of bugs squished and error messages improved.
βοΈ Documentation updates
β’ Added a "Learn Tact in Y minutes" page, which gives a whirlwind code-first tour of the Tact language.
β’ Any AI vibe coders out there? The docs now generate
llms.txt, llms-full.txt and llms-small.txt files for you to use with your AIs. The small version is particularly interesting as it fits in the 200k context.β’ The "gas best practices" page got updated with new recommendations, such as specialized math functions or the
BasechainAddress struct and related functions.β’ Lots of examples fixed, with more fixes to arrive as we speak.
π§³ Formatter!
You can run it via
npx tact-fmt in your projects β it supports checking the formatting via the --check flag, applying fixes via the --write flag, and can check both individual files and directories of files.Furthermore, it also ships with our official language server and VSCode extensions. See the tact-language-server's README.md for installation details.
π See the full release notes for Tact v1.6.6
π₯ And upgrade Tact in your projects
In about 4 days from now, on April 21 at 12:00 (UTC+3), the Tact Smart Battle will begin! It is the ultimate smart contract challenge powered by Tact and organized by TON Studio & Codeforces. The prize pool is $20,000 in Toncoin, and the top 128 participants will receive exclusive Soulbound Tokens (SBTs). Moreover, the best battlers will be invited for job interviews at TON Studio.
And all participants with valid solutions would also receive a Participant SBT.
π Register, if not already: Codeforces
β’ Here's the registration guide, just in case: Notion
β’ Hop in the community chat to ask questions, receive support and have fun learning and using Tact: @tact_smart_battle
π² flint and tact
β¨οΈ @tact_kitchen from the @ton_studio
π₯15β€11π7π5β‘2π1
All tasks are now live.
The GitHub repo with setup, templates, and participation guide is here:
Dive in, build, and push your skills to the limit
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
TON Contests
π§ Tact Smart Battle π€
Join the ultimate smart contract challenge powered by Tact, organized by TON Studio & Codeforces
π Prize Pool β $20,000 in Toncoin!
π― Challenge Tasks:
1. Simple Voting β basic voting system.
2. Serial Voting β multiple proposals viaβ¦
Join the ultimate smart contract challenge powered by Tact, organized by TON Studio & Codeforces
π Prize Pool β $20,000 in Toncoin!
π― Challenge Tasks:
1. Simple Voting β basic voting system.
2. Serial Voting β multiple proposals viaβ¦
π₯9π4β€1
For you all, JetBrains IDEs lovers: intelli-tact plugin release πΈ
π² got IDEA?
β¨οΈ @tact_kitchen from the @ton_studio
π² got IDEA?
β¨οΈ @tact_kitchen from the @ton_studio
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯18π15β€2
Forwarded from TOLK lang
π«§ Tolk v0.12: structures, generics, and methods
Finally! Or maybe not yet?
This update brings Tolk one step closer to its final form by introducing:
β Notable changes in Tolk v0.12:
1. Structures
2. Generics
3. Methods
4. Stdlib with short naming
5. Fift output enhancements
PR on GitHub with detailed info.
β Structures
Looks like TypeScript β but works in TVM!
Key features:
- Compiler guesses what you mean β automatically:
- Works with shorthand syntax
- Default values for fields are supported
- Nested objects are supported
- No overhead for single-field structs over a plain value
- Nullability, smart casts, union types, all language features β everything works
β Generics
They exist only at the type level (no runtime cost):
The type system becomes powerful enough to express complex scenarios:
β Methods β for any types
For structures:
Or extend built-in types:
Or β tensors, unions, generics, even "any receiver". A method is just an extension function with predictable resolution rules.
β stdlib β with short methods naming
Even more β some global functions are now static methods:
It looks pretty, and since IDE suggest only available methods after dot, it's extremely useful. For a full list of renamings, consider documentation.
β A long-awaited bonus for Fift ninja
Look at the PR and enjoy how readable Fift assembler output is. Yes, it contains original .tolk lines as comments! And yes, it works perfectly.
π³ You now see how Tolk's features are aligning together towards automatic serialization, fully described by the type system. Cell references, constructor prefixes, message sending, and other use cases will be expressed with the features above.
Finally! Or maybe not yet?
This update brings Tolk one step closer to its final form by introducing:
β Notable changes in Tolk v0.12:
1. Structures
2. Generics
3. Methods
4. Stdlib with short naming
5. Fift output enhancements
PR on GitHub with detailed info.
β Structures
Looks like TypeScript β but works in TVM!
struct Point {
x: int;
y: int;
}
fun calcMaxCoord(p: Point) {
return p.x > p.y ? p.x : p.y;
}
// declared like a JS object
var p: Point = { x: 10, y: 20 };
// called like a JS object
calcMaxCoord({ x: 10, y: 20 });
Point a just named tensor β identical to (int, int) at the TVM level.Key features:
- Compiler guesses what you mean β automatically:
fun loadData(): StoredInfo {
return {
counterValue: ...,
ownerAddress: ...,
}
}
- Works with shorthand syntax
{ x, y }- Default values for fields are supported
- Nested objects are supported
- No overhead for single-field structs over a plain value
- Nullability, smart casts, union types, all language features β everything works
β Generics
They exist only at the type level (no runtime cost):
struct Nullable<T> {
item: T? = null;
}
The type system becomes powerful enough to express complex scenarios:
struct Ok<TResult> { result: TResult }
struct Err<TError> { err: TError }
type Response<R, E> = Ok<R> | Err<E>;
match (r) {
Ok => { r.result }
Err => { r.err }
}
β Methods β for any types
For structures:
fun Point.getX(self) {
return self.x
}
fun Point.create(x: int, y: int): Point {
return { x, y }
}
Or extend built-in types:
fun slice.load32(mutate self): int32 {
return self.loadInt(32);
}
Or β tensors, unions, generics, even "any receiver". A method is just an extension function with predictable resolution rules.
β stdlib β with short methods naming
// before
someCell.cellHash();
someTuple.tupleSize();
someBuilder.getBuilderBitsCount();
// now
someCell.hash();
someTuple.size();
someBuilder.bitsCount();
Even more β some global functions are now static methods:
// before
getMyAddress();
setContractData(c);
getLogicalTime();
// now
contract.getAddress();
contract.setData(c);
blockchain.logicalTime();
It looks pretty, and since IDE suggest only available methods after dot, it's extremely useful. For a full list of renamings, consider documentation.
β A long-awaited bonus for Fift ninja
Look at the PR and enjoy how readable Fift assembler output is. Yes, it contains original .tolk lines as comments! And yes, it works perfectly.
π³ You now see how Tolk's features are aligning together towards automatic serialization, fully described by the type system. Cell references, constructor prefixes, message sending, and other use cases will be expressed with the features above.
π29π₯13β€βπ₯8β€5π₯°3
Forwarded from TOLK lang
π«§ Tolk v0.13 (Release candidate): Auto-packing to/from cells
We've finally reached the point we've been working toward for the past six months: automatic (de)serialization of anything into cells. From simple structs to unions, generics, and even nested references β it just works.
The goal? To replace TL/B entirely with declarative, type-safe definitions. The compiler takes care of packing, loading, estimating, error handling, and more.
β Notable changes in Tolk v0.13:
1. Auto-packing to/from cells/slices/builders
2. Type
3. Lateinit variables, default parameters, and other minor features
PR on GitHub with detailed info.
β Auto-serialization: short demo
Key features:
* supports all types: unions, tensors, nullables, generics, atomics, ...
* allows to specify prefixes (particularly, opcodes)
* allows to manage cell references and when to load them
* lets you control error codes and other behavior
* unpacks data from a cell or a slice, mutate it or not
* packs data to a cell or a builder
* warns if data potentially exceeds 1023 bits
* more efficient than manual serialization
* will seamlessly integrate with message sending/receiving in Tolk v1.0
β Pack or unpack β anywhere
β Serialization prefixes and opcodes
They are not limited to 32 bits β you can describe any TL/B constructors:
β Typed cells
Typed cells give you full control over when content is unpacked β nothing is loaded unless you call .load() manually:
// Yes,
β Granular options
Accurately adjust serialization behaviour (for example, error codes):
β Built-in type `address`
* integrated with auto-serialization, while still a slice under the hood
* comparable:
* introspectable: isInternal(), getWorkchain(), etc.
β Some other features
Described in detail in the full changelog and mirrored in the documentation.
π³ We're just a couple of steps away from Tolk v1.0 β with message sending and handling, gas optimizations, and one secret feature. There is still a lot of work ahead, but today we're closer to the release than ever before.
We've finally reached the point we've been working toward for the past six months: automatic (de)serialization of anything into cells. From simple structs to unions, generics, and even nested references β it just works.
The goal? To replace TL/B entirely with declarative, type-safe definitions. The compiler takes care of packing, loading, estimating, error handling, and more.
β Notable changes in Tolk v0.13:
1. Auto-packing to/from cells/slices/builders
2. Type
address3. Lateinit variables, default parameters, and other minor features
PR on GitHub with detailed info.
β Auto-serialization: short demo
struct Point {
x: int8;
y: int8;
}
var value: Point = { x: 10, y: 20 };
// makes a cell containing "0A14"
var c = value.toCell();
// back to { x: 10, y: 20 }
var p = Point.fromCell(c);
Key features:
* supports all types: unions, tensors, nullables, generics, atomics, ...
* allows to specify prefixes (particularly, opcodes)
* allows to manage cell references and when to load them
* lets you control error codes and other behavior
* unpacks data from a cell or a slice, mutate it or not
* packs data to a cell or a builder
* warns if data potentially exceeds 1023 bits
* more efficient than manual serialization
* will seamlessly integrate with message sending/receiving in Tolk v1.0
β Pack or unpack β anywhere
T.fromCell, T.fromSlice, slice.loadAny<T>, builder.storeAny<T>, and other methods give both high-level and low-level API.
// low-level is allowed:
beginCell()
.storeUint(1, 32) // mix manual
.storeAny(myStruct) // with auto
β Serialization prefixes and opcodes
struct (0x7362d09c) TransferNotification {
queryId: uint64;
...
}
They are not limited to 32 bits β you can describe any TL/B constructors:
struct (0b001) AssetSimple { ... }
struct (0b100) AssetBooking { ... }
type Asset = AssetSimple | AssetBooking | ...;
β Typed cells
struct A {
ref1: cell; // untyped ref
ref2: Cell<Inner>; // typed ref
ref3: Cell<int256>?; // maybe ref
}
Typed cells give you full control over when content is unpacked β nothing is loaded unless you call .load() manually:
a.ref2.field // error
a.ref2.load().field // ok
// Yes,
point.toCell() really gives you Cell<Point>β Granular options
Accurately adjust serialization behaviour (for example, error codes):
Point.fromSlice(s, {
assertEndAfterReading: false
})
β Built-in type `address`
struct Wallet {
owner: address;
}
* integrated with auto-serialization, while still a slice under the hood
* comparable:
if (senderAddress == wallet.owner)* introspectable: isInternal(), getWorkchain(), etc.
β Some other features
Described in detail in the full changelog and mirrored in the documentation.
π³ We're just a couple of steps away from Tolk v1.0 β with message sending and handling, gas optimizations, and one secret feature. There is still a lot of work ahead, but today we're closer to the release than ever before.
β€9π₯6π₯°3π1
π Tact Language Server & VS Code Extension v0.8.0 are live!
Smarter code insight, TL-B support, fresh UI touches and a faster, quieter indexer β all wrapped into v0.8.0 release!
π Headline features
Flexible toolchain picker β point the extension at any local Tact toolchain and switch them on the fly.
TL-B first-class citizen β syntax highlighting, completions, document symbols, go-to-references and inline highlighting inside Tact comments.
Next level navigation β search for functions by type, easily navigate with code lenses with go-to places where messages were sent and received
Fresh inspections β
π And that's not all π, check out our changelog to find all the improvements and fixes in the new release!
Also check out X/Twitter thread with announcement.
π₯ Upgrade now
Via VS Code marketplace
or Open VSX
Happy hacking! π οΈβ¨
π² intelli-tact, you're next
β¨οΈ @tact_kitchen from the @ton_studio
Smarter code insight, TL-B support, fresh UI touches and a faster, quieter indexer β all wrapped into v0.8.0 release!
π Headline features
Flexible toolchain picker β point the extension at any local Tact toolchain and switch them on the fly.
TL-B first-class citizen β syntax highlighting, completions, document symbols, go-to-references and inline highlighting inside Tact comments.
Next level navigation β search for functions by type, easily navigate with code lenses with go-to places where messages were sent and received
Fresh inspections β
CanBeInline (with quickfix), DeprecatedSymbolUsage, MissedMembersInContract (with quickfix), NamingConvention, OptimalMathFunctions.π And that's not all π, check out our changelog to find all the improvements and fixes in the new release!
Also check out X/Twitter thread with announcement.
π₯ Upgrade now
Via VS Code marketplace
or Open VSX
Happy hacking! π οΈβ¨
π² intelli-tact, you're next
β¨οΈ @tact_kitchen from the @ton_studio
π₯9π7β€6π4β‘1
Forwarded from TOLK lang
π«§ Tolk v0.99: universal message composition
This update introduces a high-level, type-safe way to compose and send messages to other contracts.
No more manual beginCell().storeUint(...).storeRef(...) boilerplate. Just describe the message in a literal, and let the compiler do the rest.
β Notable changes in Tolk v0.99:
1. Universal
2. Universal
3. Sharding β calculate addresses "close to another contract"
PR on GitHub with detailed info.
β createMessage: short demo
Key features:
1. Supports extra currencies
2. Supports
3. Supports different workchains
4. Supports sharding (formerly splitDepth)
5. Integrated with auto-serialization of
6. Automatically detects "body ref or not"
β Union types as the foundation
Almost every field is a union β flexible API while staying strictly typed:
β Body: inline or ref?
Don't think about refs β the compiler does:
- small structs are inlined
- large ones are wrapped in a ref
- detected at compile-time β no runtime checks
Don't need body? Just leave it out.
β Deployment: a variant of "destination"
The beauty of TON is that it doesn't have a dedicated deployment mechanism. You just send a message to some void β and if this void doesn't exist, but you've attached a way to initialize it β it's initialized immediately, and accepts your message.
β Sharding!
Built-in features to calculate an address "in the shard of contract B."
Perfect for optimized sharded jettons. All the hashing, StateInit packing, and bit-level work is done automatically.
βοΈ What about gas costs?
Even with all this flexibility,
β v0.99? So, what's next?
Yes, it's the last version before the final release. Tolk now covers the entire initial roadmap and is ready for real-world use. On top of that, we'll add several compiler optimizations and rewrite standard contracts from FunC to Tolk β to demonstrate how exactly everything ties together.
This update introduces a high-level, type-safe way to compose and send messages to other contracts.
No more manual beginCell().storeUint(...).storeRef(...) boilerplate. Just describe the message in a literal, and let the compiler do the rest.
β Notable changes in Tolk v0.99:
1. Universal
createMessage β control body, extra currency, stateInit, and more2. Universal
createExternalLogMessage β emit logs efficiently3. Sharding β calculate addresses "close to another contract"
PR on GitHub with detailed info.
β createMessage: short demo
val reply = createMessage({
bounce: false,
value: ton("0.05"),
dest: senderAddress,
body: RequestedInfo { ... }
});
reply.send(SEND_MODE_REGULAR);
Key features:
1. Supports extra currencies
2. Supports
stateInit with automatic address computation3. Supports different workchains
4. Supports sharding (formerly splitDepth)
5. Integrated with auto-serialization of
body6. Automatically detects "body ref or not"
β Union types as the foundation
Almost every field is a union β flexible API while staying strictly typed:
// value: either tons, or tons + extra currencies
value: ton("1.5")
value: (ton("1.5"), extraDict)
// destination: various forms
dest: someAddress
dest: (workchain, hash)
β Body: inline or ref?
Don't think about refs β the compiler does:
- small structs are inlined
- large ones are wrapped in a ref
- detected at compile-time β no runtime checks
// any serializable struct β no toCell!
body: RequestedInfo { ... }
Don't need body? Just leave it out.
β Deployment: a variant of "destination"
dest: {
workchain: BASECHAIN,
stateInit: { code, data },
}
The beauty of TON is that it doesn't have a dedicated deployment mechanism. You just send a message to some void β and if this void doesn't exist, but you've attached a way to initialize it β it's initialized immediately, and accepts your message.
β Sharding!
Built-in features to calculate an address "in the shard of contract B."
dest: {
...
toShard: {
fixedPrefixLength: 8,
closeTo: ownerAddress,
}
}
Perfect for optimized sharded jettons. All the hashing, StateInit packing, and bit-level work is done automatically.
βοΈ What about gas costs?
Even with all this flexibility,
createMessage is not bloated. The compiler unfolds all union branches and constant conditions at compile time, producing flat, minimal code β often more optimal than hand-crafted cell composition.β v0.99? So, what's next?
Yes, it's the last version before the final release. Tolk now covers the entire initial roadmap and is ready for real-world use. On top of that, we'll add several compiler optimizations and rewrite standard contracts from FunC to Tolk β to demonstrate how exactly everything ties together.
π16β€7π₯3β‘2π₯°1π―1π¨βπ»1
Forwarded from TON Tech
π¨ Dev Tools Updates
Fresh updates are out for TON development tools! These releases bring enhanced reliability, a smoother developer experience, and stronger tooling performance. Make sure to upgrade and enjoy the latest improvements!
π @ton/blueprint v0.36.0 β 2025-06-16
π @ton/sandbox v0.33.0 β 2025-06-16
π @ton/test-utils v0.8.0 β 2025-06-16
π₯ Noticeable changes
β’ New Jest matcher: toThrowExitCode for validating exitCode in tests.
β’ New Chai assertion: throwExitCode for similar exit code validation.
β’ ExitCode enum: Introduced for standardizing exit codes
β’ Added fetchConfig and setGlobalVersion utility functions
β’ Added blockchain.randomSeed property to update random seed in transactions or get methods
β’ Added support for updating blockchain config via loadConfig and updateConfig functions
β’ Blockchain.now not updating in blockchain.sendMessageIter is resolved
β’ Immutability fix: Blockchain.snapshot now returns copy, not reference
β’ Switched to Dirent.parentPath from deprecated .path
β’ Network Provider Enhancements. Added getConfig, getContractState and waitForLastTransaction methods
β’ Added utility getNormalizedExtMessageHash functions
β¬ To update, run npm install @ton/blueprint@latest @ton/sandbox@latest @ton/test-utils@latest.
π‘ To learn more, visit GitHub pages: https://github.com/ton-org/blueprint, https://github.com/ton-org/sandbox and https://github.com/ton-org/test-utils.
π¬ Encountered issues? Please report them on GitHub at https://github.com/ton-org/blueprint/issues.
π Your feedback and usage examples are crucial. Share your experiences to help us evolve the SDK!
Fresh updates are out for TON development tools! These releases bring enhanced reliability, a smoother developer experience, and stronger tooling performance. Make sure to upgrade and enjoy the latest improvements!
β’ New Jest matcher: toThrowExitCode for validating exitCode in tests.
β’ New Chai assertion: throwExitCode for similar exit code validation.
β’ ExitCode enum: Introduced for standardizing exit codes
β’ Added fetchConfig and setGlobalVersion utility functions
β’ Added blockchain.randomSeed property to update random seed in transactions or get methods
β’ Added support for updating blockchain config via loadConfig and updateConfig functions
β’ Blockchain.now not updating in blockchain.sendMessageIter is resolved
β’ Immutability fix: Blockchain.snapshot now returns copy, not reference
β’ Switched to Dirent.parentPath from deprecated .path
β’ Network Provider Enhancements. Added getConfig, getContractState and waitForLastTransaction methods
β’ Added utility getNormalizedExtMessageHash functions
Please open Telegram to view this post
VIEW IN TELEGRAM
π4β€1
What Infrastructure do you need to ship faster on TON?
Weβre gathering feedback from the community about whatβs missing, whatβs needed, and what could unlock more building in the TON ecosystem! Fill out the short form:
https://forms.gle/9MMMXDxWha1R6qxN6
Please, take this survey seriously: your input will shape TON Foundation infrastructure strategy priorities for this year.
Please open Telegram to view this post
VIEW IN TELEGRAM
π6π€£2π1
Forwarded from Tonkeeper News
This media is not supported in your browser
VIEW IN TELEGRAM
π»Build with TONAPI β YouTube Contest
Weβre inviting developers to create technical YouTube content that demonstrates how TONAPI, our powerful SaaS tools for building dApps, integrating smart contracts, and crafting custom blockchain solutions, enables real-world use cases.
TONAPI service allows developers to build decentralized applications on top of the TON blockchain without having to deal with the complexity of the underlying technology. Over 80% of projects in the TON ecosystem use TONAPI.
Submissions can include:
- Live coding or walkthroughs
- Deep-dive tutorials
- Project demos
- Comparisons with other tooling
π Top 5 videos will be selected. Total prize pool of 5,000 USDT (Bitrefill Gift Card).
Winning entries will also receive visibility on Tonkeeper social channels, TONAPI discount codes, potential dApp Browser integrations, and invitations to our exclusive mentorship program.
π Submit by emailing contest@tonkeeper.com with subject βTONAPI Contestβ
π Deadline: July 18
Submission guidelines
Weβre inviting developers to create technical YouTube content that demonstrates how TONAPI, our powerful SaaS tools for building dApps, integrating smart contracts, and crafting custom blockchain solutions, enables real-world use cases.
TONAPI service allows developers to build decentralized applications on top of the TON blockchain without having to deal with the complexity of the underlying technology. Over 80% of projects in the TON ecosystem use TONAPI.
Submissions can include:
- Live coding or walkthroughs
- Deep-dive tutorials
- Project demos
- Comparisons with other tooling
Winning entries will also receive visibility on Tonkeeper social channels, TONAPI discount codes, potential dApp Browser integrations, and invitations to our exclusive mentorship program.
π Submit by emailing contest@tonkeeper.com with subject βTONAPI Contestβ
π Deadline: July 18
Submission guidelines
Please open Telegram to view this post
VIEW IN TELEGRAM
π15β€8π1π₯1π1
π£ TON Developers β we need your feedback!
Help us shape the future of TON development. Weβve prepared a detailed survey to understand your experience with:
π§ Smart contract languages (Tact, Func, Tolk)
π Documentation and education
π SDKs, IDEs, and tools
π€ Telegram Mini Apps
π¬ Developer support and pain points
π As a thank you, weβll issue an SBT (Soulbound Token) to your wallet as proof of contribution to the ecosystem.
π Take the survey here:
https://docs.google.com/forms/d/e/1FAIpQLSfDm85Z7YxDw96nMeV9T-b2kmd2qAe8xt0_iag8ZqrgqKuCRw/viewform
π Takes 5 minutes. Every voice matters.
Letβs build a better TON together.
Help us shape the future of TON development. Weβve prepared a detailed survey to understand your experience with:
π§ Smart contract languages (Tact, Func, Tolk)
π Documentation and education
π SDKs, IDEs, and tools
π€ Telegram Mini Apps
π¬ Developer support and pain points
π As a thank you, weβll issue an SBT (Soulbound Token) to your wallet as proof of contribution to the ecosystem.
π Take the survey here:
https://docs.google.com/forms/d/e/1FAIpQLSfDm85Z7YxDw96nMeV9T-b2kmd2qAe8xt0_iag8ZqrgqKuCRw/viewform
π Takes 5 minutes. Every voice matters.
Letβs build a better TON together.
π₯10β€6π2π1π₯°1
Forwarded from Tonutils News
β οΈ If you are still using tonutils-go version below 1.13, you should update ASAP, because after mainnet update
This method is also used during wallet interraction and sending transactions.
GetAccount method becomes incompatible due to changes in blockchain account schema, so your service may stop working. This method is also used during wallet interraction and sending transactions.
π3
Forwarded from gobicycle
https://github.com/gobicycle/bicycle/releases/tag/v0.10.1
Important update!
Changes will soon be applied to the Mainnet that will disrupt some services (including Bicycle). A new version v0.10.1 has been released to support these changes. To maintain the functionality of bicycle, it is recommended to update as soon as possible.
Important update!
Changes will soon be applied to the Mainnet that will disrupt some services (including Bicycle). A new version v0.10.1 has been released to support these changes. To maintain the functionality of bicycle, it is recommended to update as soon as possible.
β€7π2
Forwarded from BotNews
Bot API 9.1
βοΈ Checklists
β’ Introduced support for native checklists.
β’ Out of the box, business bots can create and edit checklists.
β’ Bots can now receive checklists and detect progress via service messages.
π Gifts, Stars and More
β’ Improved gifts with details on their last sale and transfer cooldown.
β’ Bots can now easily check their Telegram Star balance.
β’ Mini Apps can now hide the on-screen keyboard.
β’ Unlocked more poll options, allowing up to 12.
β’ And more, see the full changelog for details:
https://torg.tg-me.sbs/bots/api-changelog#july-3-2025
β’ Introduced support for native checklists.
β’ Out of the box, business bots can create and edit checklists.
β’ Bots can now receive checklists and detect progress via service messages.
β’ Improved gifts with details on their last sale and transfer cooldown.
β’ Bots can now easily check their Telegram Star balance.
β’ Mini Apps can now hide the on-screen keyboard.
β’ Unlocked more poll options, allowing up to 12.
β’ And more, see the full changelog for details:
https://torg.tg-me.sbs/bots/api-changelog#july-3-2025
Please open Telegram to view this post
VIEW IN TELEGRAM
π1π₯1
Forwarded from TOLK lang
π«§ Tolk v1.0: lazy loading, partial updating, AST inlining β and extremely low gas fees
This is happening today.
I managed not only to finish up the compiler, but also to migrate standard contracts from FunC to Tolk.
I covered every contract with gas metrics to check whether it's more efficient than FunC or not. I didn't believe my eyes. I double-checked, triple-checked, but nothing changed. The results are correct. And now I am ready to present them to you.
π§ͺ Benchmarks!
Every contract has several metrics. For example, "basic jetton β mint".
FunC: 19278. Tolk: 11611.
Gas savings: -39.77%
|βββββββββββββββββ-
| 01 β Jetton (mint, transfer, burn, discover)
| -39.77% | -30.32% | -33.66% | -26.75%
|βββββββββββββββββ-
| 02 β NFT (deploy, transfer, onchain get)
| -43.79% | -37.47% | -44.28%
|βββββββββββββββββ-
| 03 β Notcoin
| -35.72% | -27.98% | ...
|βββββββββββββββββ-
| 04 β tgBTC
| -23.94% | -26.99% | ...
|βββββββββββββββββ-
| 05 β Wallet v5
| -21.66% | -22.92% | ...
|βββββββββββββββββ-
| 06 β Vesting
| -45.30% | -29.61% | ...
|βββββββββββββββββ-
| 07 β Telegram gifts
| -54.81% | -39.39% | ...
|βββββββββββββββββ-
I have migrated 7 contracts β preserving the original behavior and passing the same tests.
All benchmarks are open. No cheating. Just a smart compiler β and a language designed to be optimized.
β Even wallet?! But it's very low-level and tricky!
Even wallet. You just express your thoughts without any tricks β and it works automatically.
β But how? How is it possible to achieve such numbers?
Of course, I've put a lot of smartness into the compiler. A strong type system. Automatic inlining. Built-in serialization. The magic
But first of all, Tolk is built for readability. These contracts aren't "just cleaner" than their FunC equivalents β they're elegant. No magic. No low-level intrigues. Just clean, consistent logic β whether it's a Jetton or a Wallet.
And gas savings? They are a consequence. I didn't micro-optimize. Each contract was rewritten in about a day β just focusing on clarity. The core principle is simple: once you make it elegant, it automatically becomes efficient.
β Notable changes in Tolk v1.0:
1. Lazy loading β only read what you actually use
2. AST-based inlining β zero-cost getters and methods
3. Peephole optimizations, TVM-11 β smaller code, lower gas
PR on GitHub with detailed info.
Just take a look:
That's it. Lazy loading and partial updates (calculating immutable slices for writing) β one magic
βοΈ The Release. What's inside
- JetBrains IDE plugin β with completion, resolving, etc... β done
- VS Code Extension β with suggestions, stdlib integration, etc... β done
- Language server β for any LSP-compatible editor... β done
- FunC-to-Tolk converter β migrate a project in 10 seconds... β done
- Documentation β for smooth transition from FunC... β done
And the TOLK language itself β exactly as I've visioned it... 7 months ago
π The essence of Numbers
At this moment, abstract yourself from the text. Take a look at the calendar.
Today is 07/07/25 (I mean 2+5, of course).
After the TON Gateway, throughout all November, I was laying out the roadmap towards Tolk v1.0. On December 1, I started working. It means, that the journey till now took exactly 7 months 7 days. If you scroll this channel to the top, you'll see an announcement... Of Tolk v0.7
πͺ What's next?
I could have written about my plans β for the language, TVM, ABI, TypeScript wrappers... but I won't.
Because today, instead of rushing into the future, maybe we can allow ourselves to look back.
To pause the endless race β just for a moment.
To notice how many beautiful coincidences pass us by β unnoticed in our constant hurry.
Just step outside.
Close your eyes.
Count to seven.
Feel it.
When you're ready β
Let's Tolk
This is happening today.
I managed not only to finish up the compiler, but also to migrate standard contracts from FunC to Tolk.
I covered every contract with gas metrics to check whether it's more efficient than FunC or not. I didn't believe my eyes. I double-checked, triple-checked, but nothing changed. The results are correct. And now I am ready to present them to you.
π§ͺ Benchmarks!
Every contract has several metrics. For example, "basic jetton β mint".
FunC: 19278. Tolk: 11611.
Gas savings: -39.77%
|βββββββββββββββββ-
| 01 β Jetton (mint, transfer, burn, discover)
| -39.77% | -30.32% | -33.66% | -26.75%
|βββββββββββββββββ-
| 02 β NFT (deploy, transfer, onchain get)
| -43.79% | -37.47% | -44.28%
|βββββββββββββββββ-
| 03 β Notcoin
| -35.72% | -27.98% | ...
|βββββββββββββββββ-
| 04 β tgBTC
| -23.94% | -26.99% | ...
|βββββββββββββββββ-
| 05 β Wallet v5
| -21.66% | -22.92% | ...
|βββββββββββββββββ-
| 06 β Vesting
| -45.30% | -29.61% | ...
|βββββββββββββββββ-
| 07 β Telegram gifts
| -54.81% | -39.39% | ...
|βββββββββββββββββ-
I have migrated 7 contracts β preserving the original behavior and passing the same tests.
All benchmarks are open. No cheating. Just a smart compiler β and a language designed to be optimized.
β Even wallet?! But it's very low-level and tricky!
Even wallet. You just express your thoughts without any tricks β and it works automatically.
β But how? How is it possible to achieve such numbers?
Of course, I've put a lot of smartness into the compiler. A strong type system. Automatic inlining. Built-in serialization. The magic
lazy keyword.But first of all, Tolk is built for readability. These contracts aren't "just cleaner" than their FunC equivalents β they're elegant. No magic. No low-level intrigues. Just clean, consistent logic β whether it's a Jetton or a Wallet.
And gas savings? They are a consequence. I didn't micro-optimize. Each contract was rewritten in about a day β just focusing on clarity. The core principle is simple: once you make it elegant, it automatically becomes efficient.
β Notable changes in Tolk v1.0:
1. Lazy loading β only read what you actually use
2. AST-based inlining β zero-cost getters and methods
3. Peephole optimizations, TVM-11 β smaller code, lower gas
PR on GitHub with detailed info.
Just take a look:
val st = lazy Storage.load();
// the compiler skips everything and loads only what you access
return st.publicKey;
That's it. Lazy loading and partial updates (calculating immutable slices for writing) β one magic
lazy keyword to rule them all.βοΈ The Release. What's inside
- JetBrains IDE plugin β with completion, resolving, etc... β done
- VS Code Extension β with suggestions, stdlib integration, etc... β done
- Language server β for any LSP-compatible editor... β done
- FunC-to-Tolk converter β migrate a project in 10 seconds... β done
- Documentation β for smooth transition from FunC... β done
And the TOLK language itself β exactly as I've visioned it... 7 months ago
π The essence of Numbers
At this moment, abstract yourself from the text. Take a look at the calendar.
Today is 07/07/25 (I mean 2+5, of course).
After the TON Gateway, throughout all November, I was laying out the roadmap towards Tolk v1.0. On December 1, I started working. It means, that the journey till now took exactly 7 months 7 days. If you scroll this channel to the top, you'll see an announcement... Of Tolk v0.7
πͺ What's next?
I could have written about my plans β for the language, TVM, ABI, TypeScript wrappers... but I won't.
Because today, instead of rushing into the future, maybe we can allow ourselves to look back.
To pause the endless race β just for a moment.
To notice how many beautiful coincidences pass us by β unnoticed in our constant hurry.
Just step outside.
Close your eyes.
Count to seven.
Feel it.
When you're ready β
Let's Tolk
β€23π₯9β€βπ₯4π2π±1