Closed mnill closed 2 weeks ago
Thanks for the suggestion! We don't think that adding new built-in "magic" functions will solve the problem, and we're moving towards expanding the possibilities of the language, with which it will be possible to describe the solution to almost any situation.
You can use Deploy the contract with no constructor
https://github.com/everx-labs/TVM-Solidity-Compiler/blob/master/API.md#deploy-the-contract-with-no-constructor
Hi. In Distributed programming paradigm we have a problem with gas management when we trying to redeploy an already deployed contract.
I'll try to explain it with by using tip-3 architecture. When some application transfers tokens from one wallet to another we always firstly deploy the target wallet, then we send an onAcceptTokensTransfer call with amount of tokens to transfer. If target wallet is already deployed - constructor will throw an error and gas will be bounce back to the contract which one tried to deploy the wallet. But we would like to send remain gas to the user's wallet which one started the transaction.
So we have a constructor like this:
If contract already deployed, message will bounce back to the msg.sender. Will be nice to to have an opportunity to declare such special function:
Because an attempt to re-deploy is a regular situation for our application.
If you need more details I can try to draw a scheme of some real application.