Skip to content

Commit

Permalink
update distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
judezhu committed Jun 5, 2024
1 parent 44de38b commit 6a4cb32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pds/transactions/pds/create_distribution.cdc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import PDS from "PDS"
import {{.PackNFTName}} from "PackNFT"
import PackNFT from "PackNFT"
import IPackNFT from "IPackNFT"
import NonFungibleToken from "NonFungibleToken"

transaction(title: String, metadata: {String: String}) {
transaction(NFTProviderPathIdentifier: string, title: String, metadata: {String: String}) {
prepare (issuer: auth(BorrowValue, Capabilities) &Account) {

let i = issuer.storage.borrow<auth(PDS.CreateDist) &PDS.PackIssuer>(from: PDS.PackIssuerStoragePath)
?? panic ("issuer does not have PackIssuer resource")

// issuer must have a PackNFT collection
let withdrawCap = issuer.capabilities.storage.issue<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider}>(StoragePath(identifier: "cadenceExampleNFTCollection")!);
let operatorCap = issuer.capabilities.storage.issue<auth(IPackNFT.Operate) &{IPackNFT.IOperator}>({{.PackNFTName}}.OperatorStoragePath);
let withdrawCap = issuer.capabilities.storage.issue<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider}>(StoragePath(identifier: NFTProviderPathIdentifier)!);
let operatorCap = issuer.capabilities.storage.issue<auth(IPackNFT.Operate) &{IPackNFT.IOperator}>(PackNFT.OperatorStoragePath);
assert(withdrawCap.check(), message: "cannot borrow withdraw capability")
assert(operatorCap.check(), message: "cannot borrow operator capability")

Expand Down

0 comments on commit 6a4cb32

Please sign in to comment.