Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
What is the recv_internal function, and what are its arguments for?

Is the function recv_internal required to have certain arguments or is it completely up to what you want the message sender to send you?

I've noticed some FunC programs have signature, int msg_value, cell in_msg_cell, slice in_msg while others only have slice in_msg.


This question was imported from Telegram Chat: https://t.me/tondev_eng/1072

Votes Newest

Answers 2


There are always 4 arguments on stack when recv_internal is called.

By declaring recv_internal with less than 4 arguments you force FunC to ignore most deep variables (they still will be there, but your code will be unaware for the whole TVM execution).


in_msg_full - cell with raw message cell that contains all the flags and additional fields

in_msg_body - slice that only contain body of the message

Please check https://ton.org/docs/learn/tvm-instructions/tvm-overview#initialization-of-tvm for more informations.

2
2
Posted one year ago
Edited one year ago

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.

  
  
Posted 2 months ago
Edited 2 months ago
17K Views
2 Answers
one year ago
2 months ago
Tags