Breaking changes coming with Secure Cadence release!

thanks solved!

Yep works, thanks @sideninja!!! :grinning:

Is there a flow-cli version that has the 0.34.X changes and stable cadence

to satisfy the stricter type checking. However, to benefit from the increased safety of this change, it would be preferred to write the above code this way instead:

pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT? {
	return &self.ownedNFTs[id] as &NonFungibleToken.NFT?
}

To clarify the NFT interface will not change? Having an example of how ExampleNFT would look like for secure cadence would be a great help to very many people.

1 Like

Btw if returning optional vs returning type (or panic) fight has a clear winner, I somehow wish we could have removed โ€˜panicโ€™ in contract context with secure cadence.

+1, I think @turbolent confirmed that the FT/NFT standards are not going to change for stable cadence. So I suppose that this means that NFT projects defining their own collections to be NonFungibleToken compliant would need to define their borrowNFT function in a bit of a strange way because of the new changes. Something like:

pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT {
    return (&self.ownedNFTs[id] as &NonFungibleToken.NFT?)!
}

@bastian please confirm the assumption is right and the standard wonโ€™t change to return NFT? instead of NFT.