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-137: Jetton Wallet Balance Query #137

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0kenx
Copy link

@0kenx 0kenx commented Jan 9, 2024

No description provided.

Signed-off-by: 0kenx <km@nxfi.app>
Signed-off-by: 0kenx <km@nxfi.app>
Signed-off-by: 0kenx <km@nxfi.app>
@0kenx 0kenx changed the title TEP-x: Jetton Wallet Balance Query TEP-137: Jetton Wallet Balance Query Jan 9, 2024
@mr-tron
Copy link

mr-tron commented Jan 18, 2024

It will never be accepted.

For example in situations where the smart contract knows that no outbound transfer can happen between the get_balance call and the get_balance_response reply (for example when a smart contract queries its own balance), the smart contract can know the minimum amount of Jetton tokens it holds.

In this case contract should block processing all over messages which can change balance until it receives get_balance_response. In can require up to few minutes. Very easy to make mistake for developers without big experience in async networks.

@0kenx
Copy link
Author

0kenx commented Jan 26, 2024

In this case contract should block processing all over messages which can change balance until it receives get_balance_response. In can require up to few minutes.

This is simply not true. In my example where the contract just wants to make sure its balance is greater than x, as long as the contract doesn't transfer funds out (i.e. the balance doesn't reduce) it can keep processing other messages, and if it receives a response that is at least x it can proceed.

Very easy to make mistake for developers without big experience in async networks.

As I have stated multiple times in the document, it should up to the dapp developer to correctly use this feature. You can't cripple experienced async developers for the reason that the feature can "potentially be misused by inexperienced developers". We can mitigate the misuse risk by providing clear explanations in the documentation (which I have already done in the standard).

@0kenx
Copy link
Author

0kenx commented May 31, 2024

Bumping this since we've again run into issues related to this design flaw.

Saying "you can't query the balance since the balance might change" is equivalent to your bank or credit card company refusing to give you an account statement because "someone might have charged your card in the meantime".

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.

None yet

2 participants