0

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 1

1

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.

5
  • so how can I add a new function on a existing contract?
    – Kin
    Nov 8, 2022 at 1:32
  • If the contract is deployed, you likely cannot.
    – iguerNL
    Nov 8, 2022 at 6:53
  • 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?
    – Kin
    Nov 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.
    – iguerNL
    Nov 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?
    – Kin
    Nov 10, 2022 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.