Skip to content

Commit

Permalink
Add back the type assertion for the deposited token
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Mar 22, 2024
1 parent d95554d commit 6b9ee41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/ExampleNFT.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6b9ee41

Please sign in to comment.