Skip to content

Commit

Permalink
fix var / entitlements
Browse files Browse the repository at this point in the history
  • Loading branch information
fkenji committed Aug 28, 2024
1 parent 4b37734 commit 49055cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/go/templates/internal/assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions transactions/marketV3/create_start_sale.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ transaction(tokenReceiverPath: PublicPath, beneficiaryAccount: Address, cutPerce
let ownerCapability = acct.capabilities.get<&{FungibleToken.Receiver}>(tokenReceiverPath)!
let beneficiaryCapability = getAccount(beneficiaryAccount).capabilities.get<&{FungibleToken.Receiver}>(tokenReceiverPath)!

let ownerCollection = acct.storage.copy<Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &TopShot.Collection>>(/storage/MomentCollectionCap)
var ownerCollection = acct.storage.copy<Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &TopShot.Collection>>(from: /storage/MomentCollectionCap)
if ownerCollection == nil {
ownerCollection = acct.capabilities.storage.issue<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &TopShot.Collection>(/storage/MomentCollection)
acct.storage.save(ownerCollection, to: /storage/MomentCollectionCap)
}

// get a capability for the v1 collection
var v1SaleCollection = acct.storage.copy<Capability<auth(Market.Create, NonFungibleToken.Withdraw, Market.Update) &Market.SaleCollection>>(/storage/topshotSaleCollectionCap)
var v1SaleCollection = acct.storage.copy<Capability<auth(Market.Create, NonFungibleToken.Withdraw, Market.Update) &Market.SaleCollection>>(from: /storage/topshotSaleCollectionCap)
if v1SaleCollection == nil {
v1SaleCollection = acct.capabilities.storage.issue<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &TopShot.Collection>(/storage/topshotSaleCollection)
v1SaleCollection = acct.capabilities.storage.issue<auth(Market.Create, NonFungibleToken.Withdraw, Market.Update) &Market.SaleCollection>(/storage/topshotSaleCollection)
acct.storage.save(v1SaleCollection, to: /storage/topshotSaleCollectionCap)
}
}

// create a new sale collection
let topshotSaleCollection <- TopShotMarketV3.createSaleCollection(ownerCollection: ownerCollection,
ownerCapability: ownerCapability,
Expand Down

0 comments on commit 49055cf

Please sign in to comment.