Skip to content

feat(stdlib): add jetton support #2509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

feat(stdlib): add jetton support #2509

wants to merge 34 commits into from

Conversation

Kaladin13
Copy link
Contributor

Issue

Closes #1562

@novusnota novusnota added this to the v1.6.5 milestone Mar 27, 2025
@novusnota novusnota self-requested a review March 27, 2025 12:27
@novusnota novusnota modified the milestones: v1.6.5, v1.6.6 Mar 28, 2025
@Kaladin13 Kaladin13 marked this pull request as ready for review April 1, 2025 15:03
@Kaladin13 Kaladin13 requested a review from a team as a code owner April 1, 2025 15:03
Copy link
Member

@novusnota novusnota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat start! Currently editing the docs after which we'll be very close to merging this.

By the way, don't forget to add yourself and a new jetton-related entry to the CHANGELOG (I can do that too :)

@novusnota
Copy link
Member

novusnota commented Apr 9, 2025

Kaladin13 please fix the merge conflicts here

doing just that

UPD: 75% ready, cleaning up remaining parts
UPD: ~85%
UPD: ~95%
UPD: DONE!

@novusnota novusnota marked this pull request as ready for review April 9, 2025 21:29
@novusnota
Copy link
Member

novusnota commented Apr 9, 2025

ALL ABOARD, THE TIME HAS FINALLY COME TO REVIEW!!1!

A couple of notes:

  1. The message struct TakeWalletAddress doesn't have usage examples added because instead of using an extension function Message.toCell(), it is manually composed both in our benchmarks and in tact-lang/jetton, and the message struct itself serves merely as a reference.
  2. I've removed the default value of 0 for the queryId fields because, while convenient, nearly all benchmarks got worse: there was about 300 to 500 gas usage growth when setting the defaults for queryId!

@Kaladin13 if you want to add any messages and/or rename some fields (minter → master), this is the time to do it. Otherwise, we can keep the minter field and "Jetton Minter" terminology brought by you to this PR, as I believe is the better naming. Our benchmarks can use the old one, since they need to stay close to FunC.

Copy link
Contributor Author

@Kaladin13 Kaladin13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @novusnota!

A few comments:

@Gusarich Gusarich requested a review from i582 April 10, 2025 14:07
@novusnota
Copy link
Member

@Kaladin13 @Shvandre @skywardboundd @i582 RFC, where C = Reviews

@Shvandre
Copy link
Contributor

Shvandre commented Apr 11, 2025

It was a big review. We discussed docs changes with @novusnota internally, not to lose time on github review, as I really want it to be added in 1.6.6. Great job from @novusnota and @Kaladin13 . Thank you guys!

P.S. Approve will be right here - right after changes :)

@novusnota
Copy link
Member

novusnota commented Apr 11, 2025

It was a big review. We discussed docs changes with novusnota internally, not to lose time on github review, as I really want it to be added in 1.6.6.

Applying changes right now! 🐗

@novusnota
Copy link
Member

ping @skywardboundd

Shvandre
Shvandre previously approved these changes Apr 11, 2025
Copy link
Contributor

@Shvandre Shvandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my comments have been resolved so here is the approval
🚀🚀🚀

@novusnota
Copy link
Member

novusnota commented Apr 11, 2025

@Kaladin13 @Shvandre @skywardboundd Sorry for tagging you guys once again, but if there are any things you'd like to fix regarding to benchmarked gas usage or contract sizes, then please do.

The burn got more expensive because the upstream type of responseDestination is Address, not Address?, and therefore is incorrect. This PR fixes it, which increases its gas usage for burn relative to the last benchmark PR.

@novusnota
Copy link
Member

novusnota commented Apr 11, 2025

Awaits #2734 and some better Address type...

UPD: And we might also set the Mint opcode to 0x642b7d07, see tact-lang/jetton#125 (comment)

@novusnota novusnota modified the milestones: v1.6.6, v1.7.0, v1.6.7, v1.8.0 Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a @stdlib/jetton library composed of standard Jetton Messages
4 participants