From 6b9ee411feef9ab7996bb2295773b6193385644a Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Fri, 22 Mar 2024 09:00:51 -0700 Subject: [PATCH] Add back the type assertion for the deposited token --- contracts/ExampleNFT.cdc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/ExampleNFT.cdc b/contracts/ExampleNFT.cdc index 582eece..0b2bf56 100644 --- a/contracts/ExampleNFT.cdc +++ b/contracts/ExampleNFT.cdc @@ -164,6 +164,8 @@ access(all) contract ExampleNFT: NonFungibleToken { /// deposit takes a NFT and adds it to the collections dictionary /// and adds the ID to the id array access(all) fun deposit(token: @{NonFungibleToken.NFT}) { + let token <- token as! @ExampleNFT.NFT + // add the new token to the dictionary which removes the old one let oldToken <- self.ownedNFTs[token.id] <- token