tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
394 stars 110 forks source link

bounced function not getted field from message #940

Closed Tinh96nb closed 1 month ago

Tinh96nb commented 1 month ago

Are you using the latest released (or pre-released, a.k.a. "next") version?

Tact source code

message(0x0f8a7ea5) JettonTransfer {
    destination: Address;
    query_id: Int as uint64;
    amount: Int as coins;
    response_destination: Address;
    custom_payload: Cell?;
    forward_ton_amount: Int as coins;
    forward_payload: Slice as remaining;
}
...

bounced(msg: bounced<JettonTransfer>){
   dump(msg.destination); // error, can not compiled
}

Relevant Tact/build system log output

Type bounced<"JettonTransfer"> does not have a field named "destination"

What happened?

Can not get field from bounce message! photo_2024-10-10 15 59 10

What did you expect?

Can get all field from bounce message!

Steps to reproduce

No response

How do you run Tact?

Blueprint

Anything else?

No response

anton-trunov commented 1 month ago

https://docs.tact-lang.org/book/bounced/#caveats

Currently, bounced messages in TON have only 224 usable data bits in the message body and don’t have any references.

And addresses usually need 267 bits, so you cannot recover it from a bounced message