Skip to content

Commit

Permalink
remove access contract section and fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Apr 16, 2024
1 parent c7c05b6 commit 4b28c01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/project-development-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ They have the clearest understanding of the code paths and edge cases.

Tests should be **mandatory**, not optional, even if the contract is copied from somewhere else.
There should be thorough emulator unit tests in the public repo.
[See the flow fungible token repo](https://github.com/onflow/flow-ft/tree/master/lib/js/test)
for an example of unit tests in javascript.
[See the flow fungible token repo](https://github.com/onflow/flow-ft/tree/master/tests)
for an example of unit tests in cadence.


Every time there is a new Cadence version or emulator version,
Expand Down
17 changes: 0 additions & 17 deletions versioned_docs/version-1.0/cadence-migration-guide/nft-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,6 @@ access(all) resource Collection: NonFungibleToken.Collection {
`NonFungibleToken.Collection` will be automatically migrated to use the interface type `{NonFungibleToken.Collection}`
as part of the Flow team's custom state migrations.

### Change the access specification of `ownedNFTs` to `access(contract)`

This one is EXTREMELY important. With the addition of entitlements and safe downcasting,
now anyone with a reference to your collection can downcast it to its concrete type
even if the reference is just of an interface type. This means that you have to be
very careful about which fields and functions are declared as public.

`ownedNFTs` used to be `access(all)`, but it should be changed to `access(contract)`
which means that only code from your contract can access it.
If this isn't done, then anyone would be able to access that field, which could be dangerous.

### Remove Project-Specific Events

Standard events are being added to the token standards! These are events
Expand Down Expand Up @@ -373,12 +362,6 @@ and [`Collection`](https://github.com/onflow/flow-nft/pull/126/files#diff-0f42f9
so that holders of any of those objects could create a new collection of the correct type,
no matter if they imported the contract or knew the type ahead of time.

### Make Collection.ownedNFTs access(contract)

`ownedNFTs` was removed as a requirement for Collections, so this change is completely optional,
but it is recommended to make fields and functions as restrictive as possible,
so `ownedNFTs` should be `access(contract)`

### Add getSupportedNFTTypes() and isSupportedNFTType()

All resources that implement `NonFungibleToken.Receiver` now have to include these
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-1.0/project-development-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ They have the clearest understanding of the code paths and edge cases.

Tests should be **mandatory**, not optional, even if the contract is copied from somewhere else.
There should be thorough emulator unit tests in the public repo.
[See the flow fungible token repo](https://github.com/onflow/flow-ft/tree/master/lib/js/test)
[See the flow fungible token repo](https://github.com/onflow/flow-ft/tree/master/tests)
for an example of unit tests in javascript.


Expand Down

0 comments on commit 4b28c01

Please sign in to comment.