forked from onflow/hybrid-custody
-
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.
FungibleToken Factory Manager Setup Transaction (onflow#152)
Closes: onflow#151
- Loading branch information
1 parent
dd77f1b
commit 604e872
Showing
16 changed files
with
229 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "CapabilityFactory" | ||
import "FungibleToken" | ||
|
||
pub contract FTReceiverBalanceFactory { | ||
pub struct Factory: CapabilityFactory.Factory { | ||
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability { | ||
return acct.getCapability<&{FungibleToken.Receiver, FungibleToken.Balance}>(path) | ||
} | ||
} | ||
} |
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,13 @@ | ||
import "FungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let ftAllFactory = managerRef.getFactory(Type<&{FungibleToken.Provider, FungibleToken.Receiver, FungibleToken.Balance}>()) | ||
|
||
return ftAllFactory != nil | ||
} |
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,13 @@ | ||
import "FungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let balanceFactory = managerRef.getFactory(Type<&{FungibleToken.Balance}>()) | ||
|
||
return balanceFactory != nil | ||
} |
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,13 @@ | ||
import "FungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let providerFactory = managerRef.getFactory(Type<&{FungibleToken.Provider}>()) | ||
|
||
return providerFactory != nil | ||
} |
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,13 @@ | ||
import "FungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let receiverBalanceFactory = managerRef.getFactory(Type<&{FungibleToken.Receiver, FungibleToken.Balance}>()) | ||
|
||
return receiverBalanceFactory != nil | ||
} |
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,13 @@ | ||
import "FungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let receiverFactory = managerRef.getFactory(Type<&{FungibleToken.Receiver}>()) | ||
|
||
return receiverFactory != nil | ||
} |
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,13 @@ | ||
import "NonFungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let collectionPublicFactory = managerRef.getFactory(Type<&{NonFungibleToken.CollectionPublic}>()) | ||
|
||
return collectionPublicFactory != nil | ||
} |
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,13 @@ | ||
import "NonFungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let providerCollectionFactory = managerRef.getFactory(Type<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>()) | ||
|
||
return providerCollectionFactory != nil | ||
} |
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,13 @@ | ||
import "NonFungibleToken" | ||
|
||
import "CapabilityFactory" | ||
|
||
pub fun main(address: Address): Bool { | ||
|
||
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(from: CapabilityFactory.StoragePath) | ||
?? panic("CapabilityFactory Manager not found") | ||
|
||
let providerFactory = managerRef.getFactory(Type<&{NonFungibleToken.Provider}>()) | ||
|
||
return providerFactory != nil | ||
} |
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
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.