Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Apr 15, 2024
1 parent 68c66a2 commit a0d5ecc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions contracts/NonFungibleToken.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ access(all) contract interface NonFungibleToken: ViewResolver {
///
access(all) resource interface Collection: Provider, Receiver, CollectionPublic, ViewResolver.ResolverCollection {

/// Cadence allows implementing types to specify less restrictive access
/// so implementing contracts can have this as `access(all)` with no problem
access(contract) var ownedNFTs: @{UInt64: {NonFungibleToken.NFT}}

/// deposit takes a NFT as an argument and stores it in the collection
Expand All @@ -201,9 +203,9 @@ access(all) contract interface NonFungibleToken: ViewResolver {
return self.ownedNFTs.length
}

/// Returns an iterator that allows callers to iterate
/// through the list of owned NFT IDs in a collection
/// without having to load the entire list first
/// Allows a given function to iterate through the list
/// of owned NFT IDs in a collection without first
/// having to load the entire list into memory
access(all) fun forEachID(_ f: fun (UInt64): Bool): Void {
self.ownedNFTs.forEachKey(f)
}
Expand Down
Loading

0 comments on commit a0d5ecc

Please sign in to comment.