Skip to content

Commit

Permalink
Merge pull request #95 from onflow/remove-owner-entitlement
Browse files Browse the repository at this point in the history
Remove Owner entitlement from NFT migration guide
  • Loading branch information
j1010001 committed May 3, 2024
2 parents 1d74202 + bcf13c1 commit 5fc48f6
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -442,7 +442,7 @@ so they can query collections to get the updated metadata to show in their user

```cadence
access(all) event Updated(type: String, id: UInt64, uuid: UInt64, owner: Address?)
access(all) view fun emitNFTUpdated(_ nftRef: auth(Update | Owner) &{NonFungibleToken.NFT})
access(all) view fun emitNFTUpdated(_ nftRef: auth(Update) &{NonFungibleToken.NFT})
{
emit Updated(type: nftRef.getType().identifier, id: nftRef.id, uuid: nftRef.uuid, owner: nftRef.owner?.address)
}
Expand All @@ -465,7 +465,7 @@ they could do it in the `deposit()` function:
access(all) contract ExampleNFT {
access(all) resource Collection: NonFungibleToken.Collection {
access(contract) var ownedNFTs: @{UInt64: ExampleNFT.NFT}
access(all) var ownedNFTs: @{UInt64: ExampleNFT.NFT}
...
Expand Down Expand Up @@ -519,7 +519,7 @@ you don't want everyone in the network to be able to have access to should be
restricted by an entitlement so that people cannot downcast the reference to access
these privledged functions.

### Add Withdraw and Owner Entitlements to withdraw()
### Add Withdraw Entitlement to withdraw()

Now that unrestricted casting is possible in Cadence, it is necessary to use
[entitlements](https://cadence-lang.org/docs/1.0/language/access-control#entitlements)
Expand Down

0 comments on commit 5fc48f6

Please sign in to comment.