@flowtyio/flow-contracts 0.1.0-beta.3 → 0.1.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/contracts/Burner.cdc +44 -0
  3. package/contracts/FlowStorageFees.cdc +15 -15
  4. package/contracts/FlowToken.cdc +29 -78
  5. package/contracts/FungibleToken.cdc +80 -53
  6. package/contracts/FungibleTokenMetadataViews.cdc +13 -25
  7. package/contracts/FungibleTokenSwitchboard.cdc +360 -0
  8. package/contracts/MetadataViews.cdc +107 -50
  9. package/contracts/NonFungibleToken.cdc +110 -60
  10. package/contracts/TokenForwarding.cdc +19 -11
  11. package/contracts/ViewResolver.cdc +20 -16
  12. package/contracts/capability-cache/CapabilityCache.cdc +97 -0
  13. package/contracts/dapper/DapperUtilityCoin.cdc +106 -39
  14. package/contracts/dapper/FlowUtilityToken.cdc +107 -40
  15. package/contracts/dapper/TopShot.cdc +323 -259
  16. package/contracts/dapper/TopShotLocking.cdc +41 -15
  17. package/contracts/dapper/offers/DapperOffersV2.cdc +46 -43
  18. package/contracts/dapper/offers/OffersV2.cdc +40 -56
  19. package/contracts/dapper/offers/Resolver.cdc +20 -13
  20. package/contracts/emerald-city/FLOAT.cdc +259 -254
  21. package/contracts/example/ExampleNFT.cdc +18 -21
  22. package/contracts/example/ExampleToken.cdc +68 -1
  23. package/contracts/find/FindViews.cdc +357 -353
  24. package/contracts/flow-utils/AddressUtils.cdc +20 -23
  25. package/contracts/flow-utils/ArrayUtils.cdc +10 -11
  26. package/contracts/flow-utils/ScopedFTProviders.cdc +27 -19
  27. package/contracts/flow-utils/ScopedNFTProviders.cdc +31 -26
  28. package/contracts/flow-utils/StringUtils.cdc +24 -37
  29. package/contracts/flowty-drops/ContractManager.cdc +47 -0
  30. package/contracts/flowty-drops/DropFactory.cdc +75 -0
  31. package/contracts/flowty-drops/DropTypes.cdc +278 -0
  32. package/contracts/flowty-drops/FlowtyAddressVerifiers.cdc +64 -0
  33. package/contracts/flowty-drops/FlowtyDrops.cdc +431 -0
  34. package/contracts/flowty-drops/FlowtyPricers.cdc +48 -0
  35. package/contracts/flowty-drops/FlowtySwitchers.cdc +113 -0
  36. package/contracts/flowty-drops/initializers/ContractBorrower.cdc +14 -0
  37. package/contracts/flowty-drops/initializers/ContractInitializer.cdc +7 -0
  38. package/contracts/flowty-drops/initializers/OpenEditionInitializer.cdc +58 -0
  39. package/contracts/flowty-drops/nft/BaseCollection.cdc +97 -0
  40. package/contracts/flowty-drops/nft/BaseNFT.cdc +107 -0
  41. package/contracts/flowty-drops/nft/ContractFactory.cdc +13 -0
  42. package/contracts/flowty-drops/nft/ContractFactoryTemplate.cdc +48 -0
  43. package/contracts/flowty-drops/nft/NFTMetadata.cdc +119 -0
  44. package/contracts/flowty-drops/nft/OpenEditionNFT.cdc +41 -0
  45. package/contracts/flowty-drops/nft/OpenEditionTemplate.cdc +52 -0
  46. package/contracts/flowty-drops/nft/UniversalCollection.cdc +23 -0
  47. package/contracts/fungible-token-router/FungibleTokenRouter.cdc +105 -0
  48. package/contracts/hybrid-custody/CapabilityDelegator.cdc +28 -26
  49. package/contracts/hybrid-custody/CapabilityFactory.cdc +20 -18
  50. package/contracts/hybrid-custody/CapabilityFilter.cdc +41 -24
  51. package/contracts/hybrid-custody/HybridCustody.cdc +303 -242
  52. package/contracts/hybrid-custody/factories/FTAllFactory.cdc +16 -4
  53. package/contracts/hybrid-custody/factories/FTBalanceFactory.cdc +16 -4
  54. package/contracts/hybrid-custody/factories/FTProviderFactory.cdc +17 -5
  55. package/contracts/hybrid-custody/factories/FTReceiverBalanceFactory.cdc +16 -4
  56. package/contracts/hybrid-custody/factories/FTReceiverFactory.cdc +16 -4
  57. package/contracts/hybrid-custody/factories/FTVaultFactory.cdc +46 -0
  58. package/contracts/hybrid-custody/factories/NFTCollectionFactory.cdc +45 -0
  59. package/contracts/hybrid-custody/factories/NFTCollectionPublicFactory.cdc +16 -4
  60. package/contracts/hybrid-custody/factories/NFTProviderAndCollectionFactory.cdc +22 -0
  61. package/contracts/hybrid-custody/factories/NFTProviderFactory.cdc +16 -4
  62. package/contracts/lost-and-found/LostAndFound.cdc +29 -25
  63. package/contracts/nft-catalog/NFTCatalog.cdc +60 -64
  64. package/contracts/nft-catalog/NFTCatalogAdmin.cdc +28 -27
  65. package/flow.json +189 -5
  66. package/package.json +1 -1
  67. package/contracts/hybrid-custody/factories/NFTProviderAndCollectionPublicFactory.cdc +0 -10
@@ -10,10 +10,10 @@ import "MetadataViews"
10
10
  // To make an addition to the catalog you can propose an NFT and provide its metadata.
11
11
  // An Admin can approve a proposal which would add the NFT to the catalog
12
12
 
13
- pub contract NFTCatalog {
13
+ access(all) contract NFTCatalog {
14
14
  // EntryAdded
15
15
  // An NFT collection has been added to the catalog
16
- pub event EntryAdded(
16
+ access(all) event EntryAdded(
17
17
  collectionIdentifier : String,
18
18
  contractName : String,
19
19
  contractAddress : Address,
@@ -30,7 +30,7 @@ pub contract NFTCatalog {
30
30
 
31
31
  // EntryUpdated
32
32
  // An NFT Collection has been updated in the catalog
33
- pub event EntryUpdated(
33
+ access(all) event EntryUpdated(
34
34
  collectionIdentifier : String,
35
35
  contractName : String,
36
36
  contractAddress : Address,
@@ -47,23 +47,23 @@ pub contract NFTCatalog {
47
47
 
48
48
  // EntryRemoved
49
49
  // An NFT Collection has been removed from the catalog
50
- pub event EntryRemoved(collectionIdentifier : String, nftType: Type)
50
+ access(all) event EntryRemoved(collectionIdentifier : String, nftType: Type)
51
51
 
52
52
  // ProposalEntryAdded
53
53
  // A new proposal to make an addtion to the catalog has been made
54
- pub event ProposalEntryAdded(proposalID : UInt64, collectionIdentifier : String, message: String, status: String, proposer : Address)
54
+ access(all) event ProposalEntryAdded(proposalID : UInt64, collectionIdentifier : String, message: String, status: String, proposer : Address)
55
55
 
56
56
  // ProposalEntryUpdated
57
57
  // A proposal has been updated
58
- pub event ProposalEntryUpdated(proposalID : UInt64, collectionIdentifier : String, message: String, status: String, proposer : Address)
58
+ access(all) event ProposalEntryUpdated(proposalID : UInt64, collectionIdentifier : String, message: String, status: String, proposer : Address)
59
59
 
60
60
  // ProposalEntryRemoved
61
61
  // A proposal has been removed from storage
62
- pub event ProposalEntryRemoved(proposalID : UInt64)
62
+ access(all) event ProposalEntryRemoved(proposalID : UInt64)
63
63
 
64
- pub let ProposalManagerStoragePath: StoragePath
64
+ access(all) let ProposalManagerStoragePath: StoragePath
65
65
 
66
- pub let ProposalManagerPublicPath: PublicPath
66
+ access(all) let ProposalManagerPublicPath: PublicPath
67
67
 
68
68
  access(self) let catalog: {String : NFTCatalog.NFTCatalogMetadata} // { collectionIdentifier -> Metadata }
69
69
  access(self) let catalogTypeData: {String : {String : Bool}} // Additional view to go from { NFT Type Identifier -> {Collection Identifier : Bool } }
@@ -75,17 +75,17 @@ pub contract NFTCatalog {
75
75
  // NFTCatalogProposalManager
76
76
  // Used to authenticate proposals made to the catalog
77
77
 
78
- pub resource interface NFTCatalogProposalManagerPublic {
79
- pub fun getCurrentProposalEntry(): String?
78
+ access(all) resource interface NFTCatalogProposalManagerPublic {
79
+ access(all) fun getCurrentProposalEntry(): String?
80
80
  }
81
- pub resource NFTCatalogProposalManager : NFTCatalogProposalManagerPublic {
81
+ access(all) resource NFTCatalogProposalManager : NFTCatalogProposalManagerPublic {
82
82
  access(self) var currentProposalEntry: String?
83
83
 
84
- pub fun getCurrentProposalEntry(): String? {
84
+ access(all) fun getCurrentProposalEntry(): String? {
85
85
  return self.currentProposalEntry
86
86
  }
87
87
 
88
- pub fun setCurrentProposalEntry(identifier: String?) {
88
+ access(all) fun setCurrentProposalEntry(identifier: String?) {
89
89
  self.currentProposalEntry = identifier
90
90
  }
91
91
 
@@ -95,19 +95,19 @@ pub contract NFTCatalog {
95
95
  }
96
96
 
97
97
 
98
- pub resource Snapshot {
99
- pub var catalogSnapshot: {String : NFTCatalogMetadata}
100
- pub var shouldUseSnapshot: Bool
98
+ access(all) resource Snapshot {
99
+ access(all) var catalogSnapshot: {String : NFTCatalogMetadata}
100
+ access(all) var shouldUseSnapshot: Bool
101
101
 
102
- pub fun setPartialSnapshot(_ snapshotKey: String, _ snapshotEntry: NFTCatalogMetadata) {
102
+ access(all) fun setPartialSnapshot(_ snapshotKey: String, _ snapshotEntry: NFTCatalogMetadata) {
103
103
  self.catalogSnapshot[snapshotKey] = snapshotEntry
104
104
  }
105
105
 
106
- pub fun setShouldUseSnapshot(_ shouldUseSnapshot: Bool) {
106
+ access(all) fun setShouldUseSnapshot(_ shouldUseSnapshot: Bool) {
107
107
  self.shouldUseSnapshot = shouldUseSnapshot
108
108
  }
109
109
 
110
- pub fun getCatalogSnapshot(): {String : NFTCatalogMetadata} {
110
+ access(all) fun getCatalogSnapshot(): {String : NFTCatalogMetadata} {
111
111
  return self.catalogSnapshot
112
112
  }
113
113
 
@@ -117,7 +117,7 @@ pub contract NFTCatalog {
117
117
  }
118
118
  }
119
119
 
120
- pub fun createEmptySnapshot(): @Snapshot {
120
+ access(all) fun createEmptySnapshot(): @Snapshot {
121
121
  return <- create Snapshot()
122
122
  }
123
123
 
@@ -125,13 +125,13 @@ pub contract NFTCatalog {
125
125
  // Represents information about an NFT collection resource
126
126
  // Note: Not suing the struct from Metadata standard due to
127
127
  // inability to store functions
128
- pub struct NFTCollectionData {
128
+ access(all) struct NFTCollectionData {
129
129
 
130
- pub let storagePath : StoragePath
131
- pub let publicPath : PublicPath
132
- pub let privatePath: PrivatePath
133
- pub let publicLinkedType: Type
134
- pub let privateLinkedType: Type
130
+ access(all) let storagePath : StoragePath
131
+ access(all) let publicPath : PublicPath
132
+ access(all) let privatePath: PrivatePath
133
+ access(all) let publicLinkedType: Type
134
+ access(all) let privateLinkedType: Type
135
135
 
136
136
  init(
137
137
  storagePath : StoragePath,
@@ -150,12 +150,12 @@ pub contract NFTCatalog {
150
150
 
151
151
  // NFTCatalogMetadata
152
152
  // Represents data about an NFT
153
- pub struct NFTCatalogMetadata {
154
- pub let contractName : String
155
- pub let contractAddress : Address
156
- pub let nftType: Type
157
- pub let collectionData: NFTCollectionData
158
- pub let collectionDisplay: MetadataViews.NFTCollectionDisplay
153
+ access(all) struct NFTCatalogMetadata {
154
+ access(all) let contractName : String
155
+ access(all) let contractAddress : Address
156
+ access(all) let nftType: Type
157
+ access(all) let collectionData: NFTCollectionData
158
+ access(all) let collectionDisplay: MetadataViews.NFTCollectionDisplay
159
159
 
160
160
  init (contractName : String, contractAddress : Address, nftType: Type, collectionData : NFTCollectionData, collectionDisplay : MetadataViews.NFTCollectionDisplay) {
161
161
  self.contractName = contractName
@@ -169,13 +169,13 @@ pub contract NFTCatalog {
169
169
  // NFTCatalogProposal
170
170
  // Represents a proposal to the catalog
171
171
  // Includes data about an NFT
172
- pub struct NFTCatalogProposal {
173
- pub let collectionIdentifier : String
174
- pub let metadata : NFTCatalogMetadata
175
- pub let message : String
176
- pub let status : String
177
- pub let proposer : Address
178
- pub let createdTime : UFix64
172
+ access(all) struct NFTCatalogProposal {
173
+ access(all) let collectionIdentifier : String
174
+ access(all) let metadata : NFTCatalogMetadata
175
+ access(all) let message : String
176
+ access(all) let status : String
177
+ access(all) let proposer : Address
178
+ access(all) let createdTime : UFix64
179
179
 
180
180
  init(collectionIdentifier : String, metadata : NFTCatalogMetadata, message : String, status : String, proposer : Address) {
181
181
  self.collectionIdentifier = collectionIdentifier
@@ -192,8 +192,8 @@ pub contract NFTCatalog {
192
192
  If obtaining all elements from the catalog is essential, please
193
193
  use the getCatalogKeys and forEachCatalogKey methods instead.
194
194
  */
195
- pub fun getCatalog() : {String : NFTCatalogMetadata} {
196
- let snapshot = self.account.borrow<&NFTCatalog.Snapshot>(from: /storage/CatalogSnapshot)
195
+ access(all) fun getCatalog() : {String : NFTCatalogMetadata} {
196
+ let snapshot = self.account.storage.borrow<&NFTCatalog.Snapshot>(from: /storage/CatalogSnapshot)
197
197
  if snapshot != nil {
198
198
  let snapshot = snapshot!
199
199
  if snapshot.shouldUseSnapshot {
@@ -206,23 +206,23 @@ pub contract NFTCatalog {
206
206
  }
207
207
  }
208
208
 
209
- pub fun getCatalogKeys(): [String] {
209
+ access(all) fun getCatalogKeys(): [String] {
210
210
  return self.catalog.keys
211
211
  }
212
212
 
213
- pub fun forEachCatalogKey(_ function: ((String): Bool)) {
213
+ access(all) fun forEachCatalogKey(_ function: fun (String): Bool) {
214
214
  self.catalog.forEachKey(function)
215
215
  }
216
216
 
217
- pub fun getCatalogEntry(collectionIdentifier : String) : NFTCatalogMetadata? {
217
+ access(all) view fun getCatalogEntry(collectionIdentifier : String) : NFTCatalogMetadata? {
218
218
  return self.catalog[collectionIdentifier]
219
219
  }
220
220
 
221
- pub fun getCollectionsForType(nftTypeIdentifier: String) : {String : Bool}? {
221
+ access(all) fun getCollectionsForType(nftTypeIdentifier: String) : {String : Bool}? {
222
222
  return self.catalogTypeData[nftTypeIdentifier]
223
223
  }
224
224
 
225
- pub fun getCatalogTypeData() : {String : {String : Bool}} {
225
+ access(all) fun getCatalogTypeData() : {String : {String : Bool}} {
226
226
  return self.catalogTypeData
227
227
  }
228
228
 
@@ -231,12 +231,10 @@ pub contract NFTCatalog {
231
231
  // @param metadata: The Metadata for the NFT collection that will be stored in the catalog
232
232
  // @param message: A message to the catalog owners
233
233
  // @param proposer: Who is making the proposition(the address needs to be verified)
234
- pub fun proposeNFTMetadata(collectionIdentifier : String, metadata : NFTCatalogMetadata, message : String, proposer : Address) : UInt64 {
235
- let proposerManagerCap = getAccount(proposer).getCapability<&NFTCatalogProposalManager{NFTCatalog.NFTCatalogProposalManagerPublic}>(NFTCatalog.ProposalManagerPublicPath)
236
-
237
- assert(proposerManagerCap.check(), message : "Proposer needs to set up a manager")
238
-
239
- let proposerManagerRef = proposerManagerCap.borrow()!
234
+ access(all) fun proposeNFTMetadata(collectionIdentifier : String, metadata : NFTCatalogMetadata, message : String, proposer : Address) : UInt64 {
235
+ let proposerManagerRef = getAccount(proposer).capabilities.borrow<&NFTCatalogProposalManager>(
236
+ NFTCatalog.ProposalManagerPublicPath
237
+ ) ?? panic("Proposer needs to set up a manager")
240
238
 
241
239
  assert(proposerManagerRef.getCurrentProposalEntry()! == collectionIdentifier, message: "Expected proposal entry does not match entry for the proposer")
242
240
 
@@ -250,41 +248,39 @@ pub contract NFTCatalog {
250
248
 
251
249
  // Withdraw a proposal from the catalog
252
250
  // @param proposalID: The ID of proposal you want to withdraw
253
- pub fun withdrawNFTProposal(proposalID : UInt64) {
251
+ access(all) fun withdrawNFTProposal(proposalID : UInt64) {
254
252
  pre {
255
253
  self.catalogProposals[proposalID] != nil : "Invalid Proposal ID"
256
254
  }
257
255
  let proposal = self.catalogProposals[proposalID]!
258
256
  let proposer = proposal.proposer
259
257
 
260
- let proposerManagerCap = getAccount(proposer).getCapability<&NFTCatalogProposalManager{NFTCatalog.NFTCatalogProposalManagerPublic}>(NFTCatalog.ProposalManagerPublicPath)
261
-
262
- assert(proposerManagerCap.check(), message : "Proposer needs to set up a manager")
263
-
264
- let proposerManagerRef = proposerManagerCap.borrow()!
258
+ let proposerManagerRef = getAccount(proposer).capabilities.borrow<&NFTCatalogProposalManager>(
259
+ NFTCatalog.ProposalManagerPublicPath
260
+ ) ?? panic("Proposer needs to set up a manager")
265
261
 
266
262
  assert(proposerManagerRef.getCurrentProposalEntry()! == proposal.collectionIdentifier, message: "Expected proposal entry does not match entry for the proposer")
267
263
 
268
264
  self.removeCatalogProposal(proposalID : proposalID)
269
265
  }
270
266
 
271
- pub fun getCatalogProposals() : {UInt64 : NFTCatalogProposal} {
267
+ access(all) fun getCatalogProposals() : {UInt64 : NFTCatalogProposal} {
272
268
  return self.catalogProposals
273
269
  }
274
270
 
275
- pub fun getCatalogProposalEntry(proposalID : UInt64) : NFTCatalogProposal? {
271
+ access(all) view fun getCatalogProposalEntry(proposalID : UInt64) : NFTCatalogProposal? {
276
272
  return self.catalogProposals[proposalID]
277
273
  }
278
274
 
279
- pub fun getCatalogProposalKeys() : [UInt64] {
275
+ access(all) fun getCatalogProposalKeys() : [UInt64] {
280
276
  return self.catalogProposals.keys
281
277
  }
282
278
 
283
- pub fun forEachCatalogProposalKey(_ function: ((UInt64): Bool)) {
279
+ access(all) fun forEachCatalogProposalKey(_ function: fun (UInt64): Bool) {
284
280
  self.catalogProposals.forEachKey(function)
285
281
  }
286
282
 
287
- pub fun createNFTCatalogProposalManager(): @NFTCatalogProposalManager {
283
+ access(all) fun createNFTCatalogProposalManager(): @NFTCatalogProposalManager {
288
284
  return <-create NFTCatalogProposalManager()
289
285
  }
290
286
 
@@ -6,11 +6,13 @@ import "NFTCatalog"
6
6
  // a proxy resource to receive a capability that lets you make changes to the NFT Catalog
7
7
  // and manage proposals
8
8
 
9
- pub contract NFTCatalogAdmin {
9
+ access(all) contract NFTCatalogAdmin {
10
+
11
+ access(all) entitlement CatalogActions
10
12
 
11
13
  // AddProposalAccepted
12
14
  // Emitted when a proposal to add a new catalog item has been approved by an admin
13
- pub event AddProposalAccepted(
15
+ access(all) event AddProposalAccepted(
14
16
  proposer: Address,
15
17
  collectionIdentifier : String,
16
18
  contractName : String,
@@ -20,7 +22,7 @@ pub contract NFTCatalogAdmin {
20
22
 
21
23
  // UpdateProposalAccepted
22
24
  // Emitted when a proposal to update a catalog item has been approved by an admin
23
- pub event UpdateProposalAccepted(
25
+ access(all) event UpdateProposalAccepted(
24
26
  proposer: Address,
25
27
  collectionIdentifier : String,
26
28
  contractName : String,
@@ -30,7 +32,7 @@ pub contract NFTCatalogAdmin {
30
32
 
31
33
  // ProposalRejected
32
34
  // Emitted when a proposal to add or update a catalog item has been rejected.
33
- pub event ProposalRejected(
35
+ access(all) event ProposalRejected(
34
36
  proposer: Address,
35
37
  collectionIdentifier : String,
36
38
  contractName : String,
@@ -38,33 +40,33 @@ pub contract NFTCatalogAdmin {
38
40
  displayName : String
39
41
  )
40
42
 
41
- pub let AdminPrivatePath: PrivatePath
42
- pub let AdminStoragePath: StoragePath
43
+ access(all) let AdminPrivatePath: PrivatePath
44
+ access(all) let AdminStoragePath: StoragePath
43
45
 
44
- pub let AdminProxyPublicPath: PublicPath
45
- pub let AdminProxyStoragePath: StoragePath
46
+ access(all) let AdminProxyPublicPath: PublicPath
47
+ access(all) let AdminProxyStoragePath: StoragePath
46
48
 
47
49
  // Admin
48
50
  // Admin resource to manage NFT Catalog
49
- pub resource Admin {
51
+ access(all) resource Admin {
50
52
 
51
- pub fun addCatalogEntry(collectionIdentifier: String, metadata : NFTCatalog.NFTCatalogMetadata) {
53
+ access(CatalogActions) fun addCatalogEntry(collectionIdentifier: String, metadata : NFTCatalog.NFTCatalogMetadata) {
52
54
  NFTCatalog.addCatalogEntry(collectionIdentifier: collectionIdentifier, metadata : metadata)
53
55
  }
54
56
 
55
- pub fun updateCatalogEntry(collectionIdentifier : String , metadata : NFTCatalog.NFTCatalogMetadata) {
57
+ access(CatalogActions) fun updateCatalogEntry(collectionIdentifier : String , metadata : NFTCatalog.NFTCatalogMetadata) {
56
58
  NFTCatalog.updateCatalogEntry(collectionIdentifier: collectionIdentifier, metadata : metadata)
57
59
  }
58
60
 
59
- pub fun removeCatalogEntry(collectionIdentifier : String) {
61
+ access(CatalogActions) fun removeCatalogEntry(collectionIdentifier : String) {
60
62
  NFTCatalog.removeCatalogEntry(collectionIdentifier : collectionIdentifier)
61
63
  }
62
64
 
63
- pub fun removeCatalogEntryUnsafe(collectionIdentifier : String, nftTypeIdentifier: String) {
65
+ access(CatalogActions) fun removeCatalogEntryUnsafe(collectionIdentifier : String, nftTypeIdentifier: String) {
64
66
  NFTCatalog.removeCatalogEntryUnsafe(collectionIdentifier : collectionIdentifier, nftTypeIdentifier: nftTypeIdentifier)
65
67
  }
66
68
 
67
- pub fun approveCatalogProposal(proposalID : UInt64) {
69
+ access(CatalogActions) fun approveCatalogProposal(proposalID : UInt64) {
68
70
  pre {
69
71
  NFTCatalog.getCatalogProposalEntry(proposalID : proposalID) != nil : "Invalid Proposal ID"
70
72
  NFTCatalog.getCatalogProposalEntry(proposalID : proposalID)!.status == "IN_REVIEW" : "Invalid Proposal"
@@ -94,7 +96,7 @@ pub contract NFTCatalogAdmin {
94
96
  }
95
97
  }
96
98
 
97
- pub fun rejectCatalogProposal(proposalID : UInt64) {
99
+ access(CatalogActions) fun rejectCatalogProposal(proposalID : UInt64) {
98
100
  pre {
99
101
  NFTCatalog.getCatalogProposalEntry(proposalID : proposalID) != nil : "Invalid Proposal ID"
100
102
  NFTCatalog.getCatalogProposalEntry(proposalID : proposalID)!.status == "IN_REVIEW" : "Invalid Proposal"
@@ -111,7 +113,7 @@ pub contract NFTCatalogAdmin {
111
113
  )
112
114
  }
113
115
 
114
- pub fun removeCatalogProposal(proposalID : UInt64) {
116
+ access(CatalogActions) fun removeCatalogProposal(proposalID : UInt64) {
115
117
  pre {
116
118
  NFTCatalog.getCatalogProposalEntry(proposalID : proposalID) != nil : "Invalid Proposal ID"
117
119
  }
@@ -125,16 +127,16 @@ pub contract NFTCatalogAdmin {
125
127
  // AdminProxy
126
128
  // A proxy resource that can store
127
129
  // a capability to admin controls
128
- pub resource interface IAdminProxy {
129
- pub fun addCapability(capability : Capability<&Admin>)
130
- pub fun hasCapability() : Bool
130
+ access(all) resource interface IAdminProxy {
131
+ access(all) fun addCapability(capability : Capability<auth(CatalogActions) &Admin>)
132
+ access(all) fun hasCapability() : Bool
131
133
  }
132
134
 
133
- pub resource AdminProxy : IAdminProxy {
135
+ access(all) resource AdminProxy : IAdminProxy {
134
136
 
135
- access(self) var capability : Capability<&Admin>?
137
+ access(self) var capability : Capability<auth(CatalogActions) &Admin>?
136
138
 
137
- pub fun addCapability(capability : Capability<&Admin>) {
139
+ access(all) fun addCapability(capability : Capability<auth(CatalogActions) &Admin>) {
138
140
  pre {
139
141
  capability.check() : "Invalid Admin Capability"
140
142
  self.capability == nil : "Admin Proxy already set"
@@ -142,11 +144,11 @@ pub contract NFTCatalogAdmin {
142
144
  self.capability = capability
143
145
  }
144
146
 
145
- pub fun getCapability() : Capability<&Admin>? {
147
+ access(all) fun getCapability() : Capability<auth(CatalogActions) &Admin>? {
146
148
  return self.capability
147
149
  }
148
150
 
149
- pub fun hasCapability() : Bool {
151
+ access(all) fun hasCapability() : Bool {
150
152
  return self.capability != nil
151
153
  }
152
154
 
@@ -156,7 +158,7 @@ pub contract NFTCatalogAdmin {
156
158
 
157
159
  }
158
160
 
159
- pub fun createAdminProxy() : @AdminProxy {
161
+ access(all) fun createAdminProxy() : @AdminProxy {
160
162
  return <- create AdminProxy()
161
163
  }
162
164
 
@@ -169,7 +171,6 @@ pub contract NFTCatalogAdmin {
169
171
 
170
172
  let admin <- create Admin()
171
173
 
172
- self.account.save(<-admin, to: self.AdminStoragePath)
173
- self.account.link<&Admin>(self.AdminPrivatePath, target: self.AdminStoragePath)
174
+ self.account.storage.save(<-admin, to: self.AdminStoragePath)
174
175
  }
175
176
  }
package/flow.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "networks": {
3
3
  "emulator": "127.0.0.1:3569",
4
+ "testing": "127.0.0.1:3569",
4
5
  "mainnet": "access.mainnet.nodes.onflow.org:9000",
5
6
  "sandboxnet": "access.sandboxnet.nodes.onflow.org:9000",
6
7
  "testnet": "access.devnet.nodes.onflow.org:9000"
@@ -28,6 +29,14 @@
28
29
  "mainnet": "0x1d7e57aa55817448"
29
30
  }
30
31
  },
32
+ "Burner": {
33
+ "source": "./contracts/Burner.cdc",
34
+ "aliases": {
35
+ "emulator": "0xf8d6e0586b0a20c7",
36
+ "testnet": "0x9a0766d93b6608b7",
37
+ "mainnet": "0xf233dcee88fe0abe"
38
+ }
39
+ },
31
40
  "MetadataViews": {
32
41
  "source": "./contracts/MetadataViews.cdc",
33
42
  "aliases": {
@@ -52,6 +61,14 @@
52
61
  "mainnet": "0xf233dcee88fe0abe"
53
62
  }
54
63
  },
64
+ "FungibleTokenSwitchboard": {
65
+ "source": "./contracts/FungibleTokenSwitchboard.cdc",
66
+ "aliases": {
67
+ "emulator": "0xee82856bf20e2aa6",
68
+ "testnet": "0x9a0766d93b6608b7",
69
+ "mainnet": "0xf233dcee88fe0abe"
70
+ }
71
+ },
55
72
  "ViewResolver": {
56
73
  "source": "./contracts/ViewResolver.cdc",
57
74
  "aliases": {
@@ -132,8 +149,8 @@
132
149
  "mainnet": "0xd8a7e05a7ac670c0"
133
150
  }
134
151
  },
135
- "NFTProviderAndCollectionPublicFactory": {
136
- "source": "./contracts/hybrid-custody/factories/NFTProviderAndCollectionPublicFactory.cdc",
152
+ "NFTProviderAndCollectionFactory": {
153
+ "source": "./contracts/hybrid-custody/factories/NFTProviderAndCollectionFactory.cdc",
137
154
  "aliases": {
138
155
  "emulator": "0xf8d6e0586b0a20c7",
139
156
  "testnet": "0x294e44e1ec6993c6",
@@ -177,7 +194,7 @@
177
194
  "aliases": {
178
195
  "emulator": "0xf8d6e0586b0a20c7",
179
196
  "testnet": "0x8c5303eaa26202d6",
180
- "mainnet": "0xf919ee77447b7497"
197
+ "mainnet": "0xe467b9dd11fa00df"
181
198
  }
182
199
  },
183
200
  "TokenForwarding": {
@@ -337,11 +354,166 @@
337
354
  "emulator": "0xf8d6e0586b0a20c7",
338
355
  "testing": "0x0000000000000007"
339
356
  }
357
+ },
358
+ "ContractManager": {
359
+ "source": "./contracts/flowty-drops/ContractManager.cdc",
360
+ "aliases": {
361
+ "testing": "0x0000000000000006",
362
+ "testnet": "0xd20430774404a7e8",
363
+ "emulator": "0xf8d6e0586b0a20c7"
364
+ }
365
+ },
366
+ "ContractInitializer": {
367
+ "source": "./contracts/flowty-drops/initializers/ContractInitializer.cdc",
368
+ "aliases": {
369
+ "testing": "0x0000000000000006",
370
+ "testnet": "0xd20430774404a7e8",
371
+ "emulator": "0xf8d6e0586b0a20c7"
372
+ }
373
+ },
374
+ "ContractBorrower": {
375
+ "source": "./contracts/flowty-drops/initializers/ContractBorrower.cdc",
376
+ "aliases": {
377
+ "testing": "0x0000000000000006",
378
+ "testnet": "0xd20430774404a7e8",
379
+ "emulator": "0xf8d6e0586b0a20c7"
380
+ }
381
+ },
382
+ "OpenEditionInitializer": {
383
+ "source": "./contracts/flowty-drops/initializers/OpenEditionInitializer.cdc",
384
+ "aliases": {
385
+ "testing": "0x0000000000000006",
386
+ "testnet": "0xd20430774404a7e8",
387
+ "emulator": "0xf8d6e0586b0a20c7"
388
+ }
389
+ },
390
+ "BaseCollection": {
391
+ "source": "./contracts/flowty-drops/nft/BaseCollection.cdc",
392
+ "aliases": {
393
+ "testing": "0x0000000000000006",
394
+ "testnet": "0xd20430774404a7e8",
395
+ "emulator": "0xf8d6e0586b0a20c7"
396
+ }
397
+ },
398
+ "ContractFactoryTemplate": {
399
+ "source": "./contracts/flowty-drops/nft/ContractFactoryTemplate.cdc",
400
+ "aliases": {
401
+ "testing": "0x0000000000000006",
402
+ "testnet": "0xd20430774404a7e8",
403
+ "emulator": "0xf8d6e0586b0a20c7"
404
+ }
405
+ },
406
+ "ContractFactory": {
407
+ "source": "./contracts/flowty-drops/nft/ContractFactory.cdc",
408
+ "aliases": {
409
+ "testing": "0x0000000000000006",
410
+ "testnet": "0xd20430774404a7e8",
411
+ "emulator": "0xf8d6e0586b0a20c7"
412
+ }
413
+ },
414
+ "OpenEditionTemplate": {
415
+ "source": "./contracts/flowty-drops/nft/OpenEditionTemplate.cdc",
416
+ "aliases": {
417
+ "testing": "0x0000000000000006",
418
+ "testnet": "0xd20430774404a7e8",
419
+ "emulator": "0xf8d6e0586b0a20c7"
420
+ }
421
+ },
422
+ "UniversalCollection": {
423
+ "source": "./contracts/flowty-drops/nft/UniversalCollection.cdc",
424
+ "aliases": {
425
+ "testing": "0x0000000000000006",
426
+ "testnet": "0xd20430774404a7e8",
427
+ "emulator": "0xf8d6e0586b0a20c7"
428
+ }
429
+ },
430
+ "BaseNFT": {
431
+ "source": "./contracts/flowty-drops/nft/BaseNFT.cdc",
432
+ "aliases": {
433
+ "testing": "0x0000000000000006",
434
+ "testnet": "0xd20430774404a7e8",
435
+ "emulator": "0xf8d6e0586b0a20c7"
436
+ }
437
+ },
438
+ "NFTMetadata": {
439
+ "source": "./contracts/flowty-drops/nft/NFTMetadata.cdc",
440
+ "aliases": {
441
+ "testing": "0x0000000000000006",
442
+ "testnet": "0xd20430774404a7e8",
443
+ "emulator": "0xf8d6e0586b0a20c7"
444
+ }
445
+ },
446
+ "FlowtyDrops": {
447
+ "source": "./contracts/flowty-drops/FlowtyDrops.cdc",
448
+ "aliases": {
449
+ "testing": "0x0000000000000006",
450
+ "testnet": "0xd20430774404a7e8",
451
+ "emulator": "0xf8d6e0586b0a20c7"
452
+ }
453
+ },
454
+ "DropFactory": {
455
+ "source": "./contracts/flowty-drops/DropFactory.cdc",
456
+ "aliases": {
457
+ "testing": "0x0000000000000006",
458
+ "testnet": "0xd20430774404a7e8",
459
+ "emulator": "0xf8d6e0586b0a20c7"
460
+ }
461
+ },
462
+ "FlowtySwitchers": {
463
+ "source": "./contracts/flowty-drops/FlowtySwitchers.cdc",
464
+ "aliases": {
465
+ "testing": "0x0000000000000006",
466
+ "testnet": "0xd20430774404a7e8",
467
+ "emulator": "0xf8d6e0586b0a20c7"
468
+ }
469
+ },
470
+ "FlowtyPricers": {
471
+ "source": "./contracts/flowty-drops/FlowtyPricers.cdc",
472
+ "aliases": {
473
+ "testing": "0x0000000000000006",
474
+ "testnet": "0xd20430774404a7e8",
475
+ "emulator": "0xf8d6e0586b0a20c7"
476
+ }
477
+ },
478
+ "FlowtyAddressVerifiers": {
479
+ "source": "./contracts/flowty-drops/FlowtyAddressVerifiers.cdc",
480
+ "aliases": {
481
+ "testing": "0x0000000000000006",
482
+ "testnet": "0xd20430774404a7e8",
483
+ "emulator": "0xf8d6e0586b0a20c7"
484
+ }
485
+ },
486
+ "DropTypes": {
487
+ "source": "./contracts/flowty-drops/DropTypes.cdc",
488
+ "aliases": {
489
+ "testing": "0x0000000000000006",
490
+ "testnet": "0x3d49bb33997bd91e",
491
+ "emulator": "0xf8d6e0586b0a20c7"
492
+ }
493
+ },
494
+ "CapabilityCache": {
495
+ "source": "./contracts/capability-cache/CapabilityCache.cdc",
496
+ "aliases": {
497
+ "testing": "0x0000000000000007",
498
+ "emulator": "0xf8d6e0586b0a20c7",
499
+ "testnet": "0x83d75469f66d2ee6",
500
+ "mainnet": "0xacc5081c003e24cf"
501
+ }
502
+ },
503
+ "FungibleTokenRouter": {
504
+ "source": "./contracts/fungible-token-router/FungibleTokenRouter.cdc",
505
+ "aliases": {
506
+ "testing": "0x0000000000000007",
507
+ "emulator": "0xf8d6e0586b0a20c7",
508
+ "testnet": "0x83231f90a288bc35",
509
+ "mainnet": "0x707c0b39a8d689cb"
510
+ }
340
511
  }
341
512
  },
342
513
  "deployments": {
343
514
  "emulator": {
344
515
  "emulator-account": [
516
+ "Burner",
345
517
  "NonFungibleToken",
346
518
  "MetadataViews",
347
519
  "ViewResolver",
@@ -367,11 +539,23 @@
367
539
  "FindViews",
368
540
  "FLOAT",
369
541
  "ExampleNFT",
370
- "ExampleToken"
542
+ "ExampleToken",
543
+ "HybridCustody",
544
+ "CapabilityFactory",
545
+ "CapabilityDelegator",
546
+ "CapabilityFilter",
547
+ "FTAllFactory",
548
+ "FTBalanceFactory",
549
+ "FTProviderFactory",
550
+ "FTReceiverFactory",
551
+ "NFTCollectionPublicFactory",
552
+ "NFTProviderAndCollectionFactory",
553
+ "NFTProviderFactory"
371
554
  ],
372
555
  "emulator-ft": [
373
556
  "FungibleToken",
374
- "FungibleTokenMetadataViews"
557
+ "FungibleTokenMetadataViews",
558
+ "FungibleTokenSwitchboard"
375
559
  ],
376
560
  "emulator-flowtoken": [
377
561
  "FlowToken"