cadence
cadence copied to clipboard
remove and re-deploy may implement the ability like "update" but without some restrictions.
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