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 3954fbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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
Loading

0 comments on commit 3954fbc

Please sign in to comment.