Skip to content

Commit

Permalink
fix bug publishing the same capability twice (#32)
Browse files Browse the repository at this point in the history
* fix bug publishing the same capability twice

* extend ViewResolver explicitly
  • Loading branch information
austinkline authored Aug 28, 2024
1 parent 4251ef0 commit c872f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions contracts/ContractManager.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ access(all) contract ContractManager {
assert(receiver.check(), message: "invalid switchboard receiver capability")
acct.capabilities.publish(receiver, at: FungibleTokenRouter.PublicPath)

acct.capabilities.publish(
acct.capabilities.storage.issue<&FungibleTokenRouter.Router>(FungibleTokenRouter.StoragePath),
at: FungibleTokenRouter.PublicPath
)

self.routerCap = acct.capabilities.storage.issue<auth(FungibleTokenRouter.Owner) &FungibleTokenRouter.Router>(FungibleTokenRouter.StoragePath)

self.data = {}
Expand Down
5 changes: 3 additions & 2 deletions contracts/nft/OpenEditionTemplate.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ access(all) contract OpenEditionTemplate: ContractFactoryTemplate {
"NFTMetadata",
"UniversalCollection",
"ContractBorrower",
"BaseCollection"
"BaseCollection",
"ViewResolver"
]).concat("\n\n")
.concat("access(all) contract ").concat(name).concat(": BaseCollection {\n")
.concat("access(all) contract ").concat(name).concat(": BaseCollection, ViewResolver {\n")
.concat(" access(all) var MetadataCap: Capability<&NFTMetadata.Container>\n")
.concat(" access(all) var totalSupply: UInt64\n")
.concat("\n\n")
Expand Down

0 comments on commit c872f67

Please sign in to comment.