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
When a function "throws" in FunC, is the transaction cancelled?

When "throwing" inside a function, is the transaction cancelled? For example, if I send 10 TON from a main account but in a smart contract there an error is thrown if there are less than 20 TON received, is the transaction rejected? After the transaction is rejected, I should still have those 10 TON on my main account, right?


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

  
  
Posted one year ago
Votes Newest

Answers


It depends on whether or not a transaction is internal or external.

If a transaction is internal, it depends on the bounce flag. If the address that the internal transaction is directed to is bounceable, then that 10 TON amount minus gas will be returned to the original address. The transaction will still be recoreded in the blockchain.

If a transaction is external, then it depends on the accept call in the code. If the throw is before the accept, then it will not be recoreded in the blockchain and thus the 10 TON will stay where it was originally.

In the example you gave, there is likely a wallet middleman:

Main account -> wallet -> contract, so an external transaction and an internal transaction.

  
  
Posted one year ago
Edited one year ago
Jeremy
404 × 5 Administrator
7K Views
1 Answer
one year ago
one year ago
Tags