onflow / cadence

Cadence, the resource-oriented smart contract programming language 🏃‍♂️
https://cadence-lang.org
Apache License 2.0
534 stars 138 forks source link

remove and re-deploy may implement the ability like "update" but without some restrictions. #1569

Closed xiyu1984 closed 2 years ago

xiyu1984 commented 2 years ago

Instructions

I found that remove and re-deploy a contract may implement the ability like contract "update" but without some restrictions.

Problem

I made a test for the lifespan of a resource on Flow. When I was testing it, I found some interesting things.

As we know from the doc, contracts update has many restrictions.

We found a more flexible way to do the "update", that is, by remove the contract and re-deploy it.

The resource created by the older contract is just the same(with the same uuid and can be visited as before) after the contract has been removed, re-written with some features breaking the restrictions of update, and re-deployed.

Steps to Reproduce

The details of this issue can be seen here

j1010001 commented 2 years ago

duplicate of https://github.com/onflow/cadence-lang.org/issues/163, closing