-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure hybrid custody for creators (#45)
* when saving a new ContractManager.Manager resource, configure hybrid custody for the owner of the account * add helper method to configure vaults on the contract manager account
- Loading branch information
1 parent
b6d1393
commit 66c279e
Showing
14 changed files
with
438 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import "FungibleToken" | ||
|
||
access(all) fun main(addr: Address, path: StoragePath): UInt64 { | ||
let acct = getAuthAccount<auth(Capabilities) &Account>(addr) | ||
|
||
let type = Type<auth(FungibleToken.Withdraw) &{FungibleToken.Provider}>() | ||
for controller in acct.capabilities.storage.getControllers(forPath: path) { | ||
if controller.borrowType.isSubtype(of: type) { | ||
return controller.capabilityID | ||
} | ||
} | ||
|
||
panic("no withdraw capability ID found") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.