diff --git a/cadence/contracts/Recipe.cdc b/cadence/contracts/Recipe.cdc index 684576f..a559beb 100644 --- a/cadence/contracts/Recipe.cdc +++ b/cadence/contracts/Recipe.cdc @@ -178,12 +178,12 @@ access(all) contract Recipe { let numInPlay = self.numberMintedPerPlay[playID]! let newMoment: @TopShot.NFT <- create TopShot.NFT( - serialNumber: numInPlay + UInt32(1), + serialNumber: numInPlay + 1, playID: playID, setID: self.setID, subeditionID: 0 ) - self.numberMintedPerPlay[playID] = numInPlay + UInt32(1) + self.numberMintedPerPlay[playID] = numInPlay + 1 return <-newMoment } } @@ -194,7 +194,7 @@ access(all) contract Recipe { // Create a new Set access(all) fun createSet(name: String): UInt32 { var newSet <- create Set(name: name) - Recipe.nextSetID = Recipe.nextSetID + UInt32(1) + Recipe.nextSetID = Recipe.nextSetID + 1 let newID = newSet.setID emit SetCreated(setID: newID, series: TopShot.currentSeries) diff --git a/cadence/transactions/create_set.cdc b/cadence/transactions/create_set.cdc index 8d628eb..3a56347 100644 --- a/cadence/transactions/create_set.cdc +++ b/cadence/transactions/create_set.cdc @@ -4,12 +4,10 @@ transaction { let admin: &TopShot.Admin - prepare(signer: auth(Storage, Capabilities) &Account) { - - let adminCap = signer.capabilities.storage.borrow<&TopShot.Admin>(/storage/TopShotAdmin) + prepare(signer: auth(Storage) &Account) { + // Borrow the Admin resource from the specified storage path + self.admin = signer.storage.borrow<&TopShot.Admin>(from: /storage/TopShotAdmin) ?? panic("Cannot borrow admin resource") - - self.admin = adminCap } execute {