TransactionSEALED
#▪&○?^╳@$?●█!◆&▒░&╲▒#^□#%░#◇@■%%▒●╲▪*◆!◇@▓◇^◆!%%█◇○▓╲~□◆◆□□▪○░▓▫
Transaction ID
Transaction Summary
Contract CallCalled NonFungibleToken, Pinnacle, PackNFT +1 more
Script Arguments
Cadence Script
1import NonFungibleToken from 0x1d7e57aa55817448
2import Pinnacle from 0xedf9df96c92f4595
3import PackNFT from 0xedf9df96c92f4595
4import MetadataViews from 0x1d7e57aa55817448
5
6/// This transaction sets up the signer's account to hold Pinnacle NFTs and PackNFTs if it hasn't already been configured.
7///
8transaction {
9 prepare(signer: auth(Storage, Capabilities) &Account) {
10 // Return early if the account already has a collection
11 if signer.storage.borrow<&Pinnacle.Collection>(from: Pinnacle.CollectionStoragePath) != nil {
12 return
13 }
14
15 // Create a new collection and save it to the account storage
16 signer.storage.save(<- Pinnacle.createEmptyCollection(nftType: Type<@Pinnacle.NFT>()), to: Pinnacle.CollectionStoragePath)
17
18 // Create a public capability for the collection
19 signer.capabilities.unpublish(Pinnacle.CollectionPublicPath)
20 signer.capabilities.publish(
21 signer.capabilities.storage.issue<&Pinnacle.Collection>(Pinnacle.CollectionStoragePath),
22 at: Pinnacle.CollectionPublicPath
23 )
24
25 // Return early if the account already has a collection
26 if signer.storage.borrow<&PackNFT.Collection>(from: PackNFT.CollectionStoragePath) != nil {
27 return
28 }
29
30 // Create a new collection and save it to the account storage
31 signer.storage.save(<- PackNFT.createEmptyCollection(nftType: Type<@PackNFT.NFT>()), to: PackNFT.CollectionStoragePath)
32
33 // Create a public capability for the collection
34 signer.capabilities.unpublish(PackNFT.CollectionPublicPath)
35 signer.capabilities.publish(
36 signer.capabilities.storage.issue<&PackNFT.Collection>(PackNFT.CollectionStoragePath),
37 at: PackNFT.CollectionPublicPath
38 )
39 }
40}