TVM-Solidity-Compiler icon indicating copy to clipboard operation
TVM-Solidity-Compiler copied to clipboard

Proposal: Add the ability to attach stateinit when calling contract interface

Open pyAndr3w opened this issue 2 years ago • 2 comments

Adding stateinit when calling the contract interface will allow you to "deploy" contracts without using a constructor. This will make it possible to create more flexible systems using more blockchain features (in TVM-based blockchains there is no concept of "deploy" as such)

expected syntax:

IContract(address).testFunction{ value: 1 ever, stateInit: cell }();

or

IContract(address).testFunction{ value: 1 ever, stateInit: builder }();

or

IContract(address).testFunction{ value: 1 ever, stateInit: slice }();

pyAndr3w avatar Jun 06 '23 10:06 pyAndr3w

ability to specify stateinit with different data types will allow to optimize the code for building a message cell

pyAndr3w avatar Jun 06 '23 10:06 pyAndr3w

Sounds reasonable. Thank you!

BorisI avatar Jun 06 '23 11:06 BorisI

Thank you! Added to 0.75 release https://github.com/everx-labs/TVM-Solidity-Compiler/blob/master/API.md#external-function-calls

IgorKoval avatar Jul 01 '24 12:07 IgorKoval