Skip to content
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

TEP: discoverable jetton wallets #89

Merged

Conversation

EmelyanenkoK
Copy link
Member

No description provided.

@doronaviguy
Copy link

I think this enhancement solves the jetton discovery/circular dependency problem between a new contract and its future jetton wallet.

I currently working on a DEX and I encountered the same problem, and this solution does solve the problem in an elegant way.

@sasha1618
Copy link

sasha1618 commented Sep 9, 2022

This is a crucial feature for the DEX systems that allows a Pool(Pair) rely on Jetton Minter+Jetton Discovery addresses only and do not store jetton wallet address to the init data.

Also, there could be some solutions where this feature is usefull, e.g. a smart contract that is created dynamically and receives payments in jettons.

This proposal solves the missing parts of the current Jetton implementation.

and either throw an exception if amount of incoming value is not enough to calculate wallet address or
response with message (sent with mode 64)

`report_wallet_address#ad30f94a query_id:uint64 wallet_address:MsgAddress owner_address:(Maybe ^MsgAddress) = InternalMsgBody;`

Choose a reason for hiding this comment

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

Please consider naming report_wallet_address return_wallet_address, because report has the context of marking an entity as malicious etc.

Copy link

Choose a reason for hiding this comment

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

other potential terms instead of "report" are "return" / "query" / "get"

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently we mimic names used in NFT for get_static_data.
I don't like return/query naming because I think it will looks a little bit counterintuitive to implement "return_wallet_address" method on recipient side to actually handle the response.
What about a take_static_data? Alternatively we can just use get_static_data op-code with high-bit set to true (to emphasize it is response), however we doesn't have TL-B notation for that.
Anyway, I don't think that this issue is important and any decision will work ok.

Copy link

@sasha1618 sasha1618 Sep 19, 2022

Choose a reason for hiding this comment

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

We realised that op should represent the operation that a receiver should execute.

With that in mind the best way to name our ops is: provide_wallet_address and take_wallet_address.

  • Smart-contract sends op:provide_wallet_address
  • Discoverable minter receives op:provide_wallet_address and sends op:take_wallet_address
  • Smart-contract receives op:take_wallet_address and handles the message

@EmelyanenkoK
Copy link
Member Author

@NickNekilov @ex3ndr As independent but with experience and interest in the field experts, please review this TEP

@NickNekilov
Copy link

@EmelyanenkoK For me, it looks good.
It solves the existing problem of wallet discovery.
Great job!

@hacker-volodya
Copy link
Collaborator

This pull request enters its Final Comment Period. It ends in 10 calendar days, 03.10.2022.

@Gusarich
Copy link
Contributor

LGTM!

@hacker-volodya
Copy link
Collaborator

FCP is over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.