Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add support for tvm_linker init in ft contrat --build or ft contract --deploy #38

Open
ddeclerck opened this issue Jul 2, 2021 · 3 comments
Labels
Fixed Issue fixed, closed soon

Comments

@ddeclerck
Copy link

When deploying a smart contract via code, one can specify the initial values of static variables by using the varInit argument of tvm.buildStateInit or new ([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 or ft contract --deploy (whichever is the most suitable) would be a valuable addition to ft.

@lefessan
Copy link
Member

lefessan commented Jul 3, 2021

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...

@lefessan
Copy link
Member

lefessan commented Jul 4, 2021

The code is there: #40
but I am too lazy to test it during the week-end...

@ddeclerck
Copy link
Author

Quite a big patch indeed. I'll test that tomorrow.

P.S: shouldn't you rest during week-ends ? ;)

@lefessan lefessan added the Fixed Issue fixed, closed soon label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Issue fixed, closed soon
Projects
None yet
Development

No branches or pull requests

2 participants