I am new in tezos and I am trying to find a way to upgrade my smart contract. I found out we will be able to upgrade a contract using proxy delegate contract or storing lambdas on the contract. Basically, I just want to add a new function on already deployed contract. I need a detailed information on this process. Is there any documentation or template that guides us through the update procedure of a smart contract.
1 Answer
There is no pre-defined mechanism to upgrade a smart contract once it's deployed. You have to include the ability of "upgrading" in the logic of your smart contract when developing it. If you didn't, it'll likely not be possible to upgrade.
-
-
-
so can we take data from old contract, and create a new contract with a new function, pointing to the old contract storage? Is this possible?– KinNov 8, 2022 at 10:51
-
You can populate the new contract's storage with the same items in the storage of the old one. But you can not directly reuse the storage of the old contract in the new one.– iguerNLNov 9, 2022 at 12:32
-
so you mean , if in my old storage, there is x=5 and y =10, and now I want to introduce a new function that uses variable z, then I have to create a new contract and set x=5 and y= 10 directly on a new contract instead of pointing to old storage. Is this correct?– KinNov 10, 2022 at 5:56