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

The reference (FunC) implementation of Jetton allows TokenBurn to have zero response_address, while this doesn't. #11

Open
Shvandre opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@Shvandre
Copy link
Collaborator

burn#595f07bc query_id:uint64 amount:(VarUInteger 16)
              response_destination:MsgAddress custom_payload:(Maybe ^Cell)
              = InternalMsgBody;

According to TEP-74, if burnNotification is received,

Jetton master should send all excesses of incoming message coins to response_destination with the following layout:
TL-B schema: excesses#d53276db query_id:uint64 = InternalMsgBody;
query_id should be equal with request's query_id.

So responce_destination should not probably be addr_none. But the thing is that if it is addr_none the action will fail. And everything will work as expected.

However reference FunC implementation does this.

slice response_address = in_msg_body~load_msg_addr();
        if (response_address.preload_uint(2) != 0) {
            var msg = begin_cell()
                    .store_uint(0x10, 6)
                    .store_slice(response_address)
                    .store_coins(0)
                    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
                    .store_uint(op::excesses(), 32)
                    .store_uint(query_id, 64);
            send_raw_message(msg.end_cell(), 2 + 64);
        }
        return ();

And maybe we should add similar handling of addr_none.

@Shvandre Shvandre added enhancement New feature or request invalid This doesn't seem right labels Dec 10, 2024
@Shvandre Shvandre self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant