hi everyone, am I reading and checking the op code in the right way?
also is it the right place to put accept_message() if I want my contract to accept an external message at its own expense?
() recv_external(slice in_msg) impure {
accept_message();
int op = in_msg~load_uint(32);
if(op == 0x9df10277) {
Dec 28, 2023, 12:47 PM
make sure you read query_id right after you read op to make sure you don't mess up reading futher data, and I would accept_message() after all checks to make sure the contract cover gas costs for legitimate messages only
Dec 28, 2023, 1:16 PM
thanks a lot, also, what is the usage of query_id?
in this problem which is from tsc5 I don't see an application, so I wonder why is it even there?
in this problem which is from tsc5 I don't see an application, so I wonder why is it even there?
Dec 28, 2023, 1:27 PM
it's common convention but isn't used in tc5 but tests expects it there. just read it and ignore
Dec 28, 2023, 1:47 PM