Hey,
Is there any way to write an init function that would run only once when the contract would be deployed?
To add some context, I want to be able to edit some information from the wallet only via one address, which would be stored when I deploy the deploy the contract.
Mar 1, 2023, 10:33 PM
Just insert that address to StateInit (data cell)
Mar 2, 2023, 4:15 AM
On top of recv_internal you can check if contract data is empty; if it is, run init function.
Mar 2, 2023, 4:22 AM
checkout the nft contract
it has this logic
https://github.com/ton-blockchain/token-contract/tree/main/nft
Mar 2, 2023, 5:23 AM