0

Following this official guide here

https://developers.flow.com/flow/dapp-development/mainnet-deployment#updatere-deploy-a-contract-on-mainnet-using-the-cli

I would like to make some updates to a smart contract I've got on Mainnet and there's a bunch of existing NFTs in there in an array that lives on the contract, would updating the contract via the CLI following the guide above just... erase those NFTs and reset the contract's data?

Aylii
  • 525
  • 4
  • 10

1 Answers1

2

Great question! Updating a contract only updates the code deployed in the contract. It does not update any objects or other state stored in the contract. This is why you can't do any updates to a contract such as adding or removing fields, changing the type of a field, and other such changes. See the upgrade docs for more information: https://developers.flow.com/cadence/language/contract-updatability

  • Hey! Yeah seems they updated those docs to reflect the functions part too since what i wanted to do essentially was implement the new MetadataViews standard – Aylii Sep 10 '22 at 02:05