-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87d9746
commit 435ab69
Showing
3 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
import TopShot from 0x01 | ||
|
||
|
||
transaction { | ||
|
||
let admin: &TopShot.Admin | ||
|
||
let admin: auth(AdminEntitlement) &TopShot.Admin | ||
let borrowedSet: &TopShot.Set | ||
|
||
prepare(acct: AuthAccount) { | ||
|
||
self.admin = acct.borrow<&TopShot.Admin>(from: /storage/TopShotAdmin) | ||
?? panic("Cant borrow admin resource") | ||
prepare(acct: auth(Storage, Capabilities) &Account) { | ||
// Borrow the admin resource | ||
self.admin = acct.capabilities.storage.borrow<&TopShot.Admin>( | ||
from: /storage/TopShotAdmin | ||
) ?? panic("Can't borrow admin resource") | ||
|
||
// Borrow the Set resource | ||
self.borrowedSet = self.admin.borrowSet(setID: 1) | ||
|
||
let recieverRef = acct.getCapability<&{TopShot.MomentCollectionPublic}>(/public/MomentCollection).borrow() ?? panic("Can't borrow collection ref") | ||
// Borrow the recipient's MomentCollectionPublic capability | ||
let receiverRef = acct.capabilities.borrow<&{TopShot.MomentCollectionPublic}>( | ||
/public/MomentCollection | ||
) ?? panic("Can't borrow collection reference") | ||
|
||
// Mint moments and return them as a collection | ||
let collection <- self.borrowedSet.batchMintMoment(playID: 3, quantity: 3) | ||
|
||
recieverRef.batchDeposit(tokens: <- collection) | ||
// Deposit the minted moments into the recipient's collection | ||
receiverRef.batchDeposit(tokens: <-collection) | ||
} | ||
|
||
execute{ | ||
log("plays minted") | ||
execute { | ||
log("Plays minted") | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters