TransactionSEALED
%╳○~&╱▪●█%%╳╱*█■█■@▒╳?◆◇#^#$●▫■◆@&$▫╲▪□╲▒■●▒&╳▓░■?*$?■◇░@?╳^╳╳╳█
Transaction ID
Execution Fee
0.00001099 FLOWTransaction Summary
Contract Call
Called NonFungibleToken, MetadataViews, HouseBadge
Script Arguments
Copy:
0nameString
APEIRON Badge
1descriptionString
Cadence Script
1import NonFungibleToken from 0x1d7e57aa55817448
2 import MetadataViews from 0x1d7e57aa55817448
3 import HouseBadge from 0xe217638793f1e461
4
5 transaction(name: String, description: String) {
6 let minter: &HouseBadge.Minter
7 let receiver: Capability<&{NonFungibleToken.Receiver}>
8 prepare(acct: auth(BorrowValue, SaveValue, IssueStorageCapabilityController, PublishCapability) &Account) {
9 // Setup Collection
10 if acct.storage.borrow<&HouseBadge.Collection>(from: HouseBadge.collectionStoragePath) == nil {
11 let collection <- HouseBadge.createEmptyCollection(nftType: Type<@HouseBadge.NFT>())
12 acct.storage.save(<- collection, to: HouseBadge.collectionStoragePath)
13 let cap: Capability = acct.capabilities.storage.issue<&HouseBadge.Collection>(HouseBadge.collectionStoragePath)
14 acct.capabilities.publish(cap, at: HouseBadge.collectionPublicPath)
15 }
16 self.minter = acct.storage.borrow<&HouseBadge.Minter>(from: HouseBadge.minterStoragePath) ?? panic("Could not borrow minter reference")
17 self.receiver = acct.capabilities.get<&{NonFungibleToken.Receiver}>(HouseBadge.collectionPublicPath)
18 }
19 execute {
20 self.minter.mintTo(creator: self.receiver, metadata: {"name": name, "description": description})
21 }
22 }