Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthAccount capabilities #53

Merged
merged 7 commits into from
Mar 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
account links must be private
  • Loading branch information
turbolent committed Mar 3, 2023
commit 8b7c584d14a492c369bf7aa58df121d98daeddde
9 changes: 6 additions & 3 deletions cadence/2022-12-07-authaccount-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| **FLIP #** | [53](https://github.com/onflow/flips/pull/53) |
| **Author(s)** | Bastian Müller (bastian@dapperlabs.com) |
| **Sponsor** | Bastian Müller (bastian@dapperlabs.com) |
| **Updated** | 2022-12-07 |
| **Updated** | 2022-03-02 |

## Objective

Expand All @@ -29,10 +29,13 @@ in their smart contracts, dapps, user agents, etc.
This proposal suggest adding a new function to the type `AuthAccount`:

```cadence
fun linkAccount(_ newCapabilityPath: CapabilityPath): Capability<&AuthAccount>?
fun linkAccount(_ newCapabilityPath: PrivatePath): Capability<&AuthAccount>?
```

This new function behaves like the existing function `link`, but instead of creating a link to a value in storage, it creates links to the account.
This new function behaves like the existing function `link`, but

- It creates a link to the account, instead of creating a link to a value in account storage.
- It only supports private paths (`/private`).

Existing functions that work with links/capabilities, like `getCapability`, `borrow`, `unlink`, etc., can be used with account capabilities,
just like they currently can be used for storage path links.
Expand Down