Does updating/redeploying a smart contract on Flow reset its state on mainnet?

Viewed 22
1 Answers

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

Related