Hi everyone
I was wondering, how do inputs of recv_internal (or external) work?
For example if I want to get op code of an incoming message, can I put an input? ( Like recv_external(int op))
Or should I just read the first 32 bits of data?
Dec 26, 2023, 8:47 PM
each of the following recv_internal declarations is correct, but those with fewer variables will spend slightly less gas (each unused argument adds additional DROP instructions).
() recv_internal(int balance, int msg_value, cell in_msg_cell, slice in_msg) {}
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) {}
() recv_internal(cell in_msg_cell, slice in_msg) {}
() recv_internal(slice in_msg) {}
You have to parse in_msg_body to retrieve the op code based on how sender stored op code in the message.
Ususally, it is stored as the first 32 bit inside in_msg_body.
() recv_internal(int balance, int msg_value, cell in_msg_cell, slice in_msg) {}
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) {}
() recv_internal(cell in_msg_cell, slice in_msg) {}
() recv_internal(slice in_msg) {}
You have to parse in_msg_body to retrieve the op code based on how sender stored op code in the message.
Ususally, it is stored as the first 32 bit inside in_msg_body.
Dec 26, 2023, 9:00 PM
Thanks a lot
Is there any specific source where I can find such details?
Also in the recent challenge there's the following tl-b scheme for an external message:
storage$_ public_key:uint256 execution_time:uint32 receiver:MsgAddressInt seqno:uint32 = Storage;
It's supposed to work all the same right?
Is there any specific source where I can find such details?
Also in the recent challenge there's the following tl-b scheme for an external message:
storage$_ public_key:uint256 execution_time:uint32 receiver:MsgAddressInt seqno:uint32 = Storage;
It's supposed to work all the same right?
Dec 26, 2023, 10:28 PM
Yw.
Yes, check docs.ton.org
Yes, check docs.ton.org
It's for the data storage of you contract
Dec 26, 2023, 10:30 PM
Oh my bad, I copied the wrong scheme!
update#9df10277 query_id:uint64 signature:bits512 ^[ locked_for:uint32 new_seqno:uint32 ] = ExtInMsgBody
This is what I meant
update#9df10277 query_id:uint64 signature:bits512 ^[ locked_for:uint32 new_seqno:uint32 ] = ExtInMsgBody
This is what I meant
Dec 27, 2023, 7:16 PM
Yes, the message you will receive will have a uint32 op code and other information followed by this op in the order with the specific type.
Dec 27, 2023, 7:20 PM
nice!
Jan 20, 2024, 8:07 AM