Open ddeclerck opened 3 years ago
I don't like the idea of modifying the TVC image for such a purpose. It means that there will be one different TVC image for every such contract, and so, probably, we have to call it with a different contract name.
It would probably better to manage that at the account level, adding a field 'initial_data' in the account information. This information would be used to compute the address and when the contract is deployed.
Not easy to do, but feasible...
The code is there: #40 but I am too lazy to test it during the week-end...
Quite a big patch indeed. I'll test that tomorrow.
P.S: shouldn't you rest during week-ends ? ;)
When deploying a smart contract via code, one can specify the initial values of static variables by using the
varInit
argument oftvm.buildStateInit
ornew
([https://github.com/tonlabs/TON-Solidity-Compiler/blob/master/API.md#tvmbuildstateinit]).When deploying a smart contract via command line, one can use
tvm_linker init
to specify the initial values of static variables, i.e.:tvm_linker init my_contract.tvm '{ "var1" : "value1", ... }' my_contract.abi.json
Being able to specify the initial values of static variables with
ft contrat --build
orft contract --deploy
(whichever is the most suitable) would be a valuable addition to ft.