TransactionSEALED
▒□╳╳◇○╳▓▫~?▓▫●&~@●○#█▒□▪$░□○%▫╱*#▓%^~%~╳▪▫!█▫●■◇□╱^█^╲▫@!■$▫▫╱#~
Transaction ID
Execution Fee
0.00000479 FLOWTransaction Summary
UpdatingContract Call
Called NonFungibleToken, Pinnacle, PackNFT +1 more
Script Arguments
Copy:
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: AuthAccount) {
10 // Create a collection and public capability for that collection if the account doesn't already have one
11 if signer.borrow<&Pinnacle.Collection>(from: Pinnacle.CollectionStoragePath) == nil {
12 signer.save(<- Pinnacle.createEmptyCollection(), to: Pinnacle.CollectionStoragePath)
13 }
14
15 // Create collection public capability if it doesn't already exist
16 if !signer.getCapability<&{
17 NonFungibleToken.Receiver,
18 NonFungibleToken.CollectionPublic,
19 Pinnacle.PinNFTCollectionPublic,
20 MetadataViews.ResolverCollection
21 }>(Pinnacle.CollectionPublicPath).check() {
22 signer.unlink(Pinnacle.CollectionPublicPath)
23 signer.link<&Pinnacle.Collection{NonFungibleToken.Receiver, NonFungibleToken.CollectionPublic, Pinnacle.PinNFTCollectionPublic, MetadataViews.ResolverCollection}>(
24 Pinnacle.CollectionPublicPath,
25 target: Pinnacle.CollectionStoragePath
26 ) ?? panic("Could not link Pinnacle Collection Public Path");
27 }
28
29
30
31 // Create a PackNFT collection in the signer account if it doesn't already have one
32 if signer.borrow<&PackNFT.Collection>(from: PackNFT.CollectionStoragePath) == nil {
33 signer.save(<- PackNFT.createEmptyCollection(), to: PackNFT.CollectionStoragePath);
34 signer.link<&{NonFungibleToken.CollectionPublic}>(PackNFT.CollectionPublicPath, target: PackNFT.CollectionStoragePath)
35 }
36
37 // Create collection public capability if it doesn't already exist
38 if !signer.getCapability<&{
39 NonFungibleToken.CollectionPublic
40 }>(PackNFT.CollectionPublicPath).check() {
41 signer.unlink(PackNFT.CollectionPublicPath)
42 signer.link<&{NonFungibleToken.CollectionPublic}>(PackNFT.CollectionPublicPath, target: PackNFT.CollectionStoragePath)
43 ?? panic("Could not link Pinnacle PackNFT Collection Public Path");
44 }
45 }
46}