5

I wrote one smart contract without upgradable logic, now I want to update the same smart contract with some changes. Is it possible to copy the data from old contract storage to a new one?

Muthukumar K
  • 544
  • 4
  • 13

1 Answers1

-1

There's no automatic way to do this. Either your new contract will need to accept the data values in the constructor (which you populate by fetching the values from the old contract) or the new contract takes the address of the old one and retrieves the values itself.

Satpal Sandhu
  • 429
  • 2
  • 5