tact-lang / tact-docs

Tact main documentation
https://docs.tact-lang.org
40 stars 36 forks source link

Explain that contracts return excessive funds upon deployment #240

Open novusnota opened 1 month ago

novusnota commented 1 month ago

And that it's done automatically.

Also, mention that receivers don't do that by default — in order to do refunds in receivers one has to use, say, self.notify("Cashback".asComment()); or alike by the end of their body.

anton-trunov commented 4 weeks ago

Actually, refunding on deployment should not be done, this is a bug and should be fixed. The contract should manage its gas so that it has enough funds to pay for storage at all times. And a good practice is to introduce a "topup" receiver that can be used to top up the contract's balance in case there is still not enough gas to pay for storage.