Skip to content

Commit

Permalink
Update cadence/20230913-restrict-capabilities-publish.md
Browse files Browse the repository at this point in the history
Co-authored-by: Bastian Müller <[email protected]>
  • Loading branch information
bluesign and turbolent committed Oct 24, 2023
1 parent 00a8baa commit 6ce1817
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cadence/20230913-restrict-capabilities-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ Before the introduction of the new controller-based capabilities API, public cap

A lot of scenarios, such as voting and gating using the proof of Non-Fungible Token (NFT) ownership, usually involve checking if an account owns a certain balance or resource by verifying the public path capability. Now, the responsibility of protection falls on the developers, which is an extra burden and holds the potential of introducing bugs and security issues.

The current suggested method of defence against this issue is always checking for the `address` of the capability or the `owner` of the resource after borrowing. Unfortunately, this is an error-prone approach that developers can easily forget.
The current suggested method of defence against this issue is always checking for the `address` of the capability or the `owner` of the resource after borrowing.
Unfortunately, this is an error-prone approach that developers can easily forget.
In addition, the new `capabilities.borrow` convenience function gets the capability and borrows it in one call.
Developers will likely forget to still `get` and check the address of the capability, when needed.

## User Benefit

Expand Down

0 comments on commit 6ce1817

Please sign in to comment.