Can we update solidity smart contract which is deployed in Hedera TestNet?

169 Views Asked by At

As of now I need to deploy new contract for every change in solidity. We loss all the previous data which is in old contract. https://docs.hedera.com/guides/docs/sdks/smart-contracts/update-a-smart-contract for reference

1

There are 1 best solutions below

0
On BEST ANSWER

Since contracts are immutable, you'll need to create a proxy contract that retains the data between deploys.

You create a contract that points to the main one and that also exposes a function that lets you change which main one it points to. See Using the UUPS proxy pattern to upgrade smart contracts.