Closed SupunS closed 3 months ago
I'm hesitant to make any more breaking changes to the standard because we said that it was finalized. Is this something we really need to do?
So the problem for the migrations is that developers now have two options to go with (could either use INFT
or NFT
), and that will create ambiguity for the migrations.
I opened this PR: https://github.com/onflow/cadence/pull/3193, to add a restriction to the contract update validation, such that it will enforce the developers to use the new NFT
when updating conformance in their contracts. So removing it here physically would not be required, but people will have to switch to start using the new one when updating their code.
Would that going to be OK? Or do you think we should still let them use the old one?
Just to be clear, as an alternative solution, we can let people use both INFT
and NFT
for conformances. But if we take this path, then anyone who wants to change their conformance from the old INFT
to the new NFT
would not be able to do so.
i.e: converting
https://github.com/onflow/flow-nft/blob/4c0c684baed98e2ffd7a8f9d27973c1db5dd1239/contracts/ExampleNFT.cdc#L39
will not be supported. They would have to keep using the NFT: NonFungibleToken.INFT
conformance as is.
Even though this change is not required, it would be great to still get it in.
It would improve the situation for existing code, which currently may and will have to keep using INFT
, while new code will likely use NFT
. Old code can currently not switch to using NFT
. This leaves a confusing situation where some code uses INFT
and other code uses NFT
. We might want to make this cleaner.
The proposed change, the removal of the INFT
type, was already previously agreed on in the FLIP, and it was only re-introduced as a work-around to keep the migration simple.
It isn't about whether or not I agree with the change, it is that we told everyone that the standards were finalized and that we wouldn't be making any more breaking changes to them and I'm trying to figure out if it is okay to go back on that.
After thinking a little bit, I believe it is probably okay. I made the change in supun's branch. Nobody has staged any updates yet, right?
I guess this issue can be closed now?
Issue To Be Solved
I guess the reason for keeping that was to make the
NonFungibleToken
backward compatible, and to make the life easier for the migrations.Now that the migrations and contract update validator support changing the type from
NonFungibleToken.INFT
toNonFungibleToken.NFT
(added in https://github.com/onflow/flow-go/pull/5564), we could remove the oldINFT
interface, and ask developers to start using the newNFT
.In-fact now it is also unsafe from migrations point of view, to have both the
INFT
and theNFT
around, because it could theoretically cause "type confusion" for certain migrated values. So removing theINFT
interface, and requiring people to start usingNFT
instead seems the best option.