Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
240 stars 79 forks source link

Warn if `_tag` is empty and not `AddFunds` #1142

Closed anton-trunov closed 2 years ago

anton-trunov commented 2 years ago

Programmers often times use _tag: "" but this does not work for wallet contracts. E.g. refunds to wallets won't be possible if the empty tag is used. See https://github.com/Zilliqa/ZRC/blob/main/zrcs/zrc-5.md

jubnzv commented 2 years ago

In which cases we want to warn about an empty _tag? Or should it have a low warning level and always be enabled?

anton-trunov commented 2 years ago

I think we should always warn about this. If the recipient is a user address the blockchain transfer funds no matter what _tag is; and if the recipient is a contract, then the empty tag does not correspond to any transition and the message will be dropped. But most people interact with the blockchain via wallets which rely on smart contracts, so a warning by default seems better (later we can implement a mechanism to disable specific warnings locally).