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
Understanding the Purpose of the "force_chain" Function in Ston.fi's Core Contract

In the Ston.fi core contract GitHub repository (https://github.com/ston-fi/dex-core), there is a line of FunC code as shown below:

force_chain(WORKCHAIN, sender_address, WRONG_WORKCHAIN);

Why is this function used to restrict the WORKCHAIN?

Posted one year ago
Howard Peng
10 × 1 Administrator
Votes Newest


In general, if we follow the code in common/utils.func (https://github.com/ston-fi/dex-core/blob/main/contracts/common/utils.func), we will get the following code:

() force_chain(int workchain, slice address, int error_code) impure inline {
  (int wc) = get_workchain(address);
  throw_unless(error_code, wc == workchain);

As far as my knowledge goes, this function ensures that the contract code executes only in a specific workchain. Since TVM is a multi-chain-based design, i.e., the shard-chain, it is limited to only one side-chain at the moment. I am unsure about how we can expand on this.

For more information, you can check:

Posted one year ago
Howard Peng
10 × 1 Administrator
1 Answer
one year ago
one year ago