◇%%◇░▪^■╲!◇▓●!╳○▒*●^▓◇!◇@*▒◆●▓▫□▓$!~!○%╳^▫█^@~&%╱▫$▓▫█○#■!╲#▒!~!
Transaction ID
Execution Fee
0.00000374 FLOWExecution Error
panic: Could not get receiver reference to the NFT Collection
24 let recipient = address
25
26 // Borrow the recipient's public NFT collection reference
27 var cap = (getAccount(recipient).capabilities.borrow<&AnyResource>(
28 collectionData.publicPath) ?? panic("Could not get receiver reference to the NFT Collection"))
29 self.recipientCollectionRef = cap as! &{NonFungibleToken.Receiver}
30 }
31
32 execute {
33
34 // Create a new NFTRaw Error
[Error Code: 1101] error caused by: 1 error occurred: * transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed: error: panic: Could not get receiver reference to the NFT Collection --> 43000ade7801e591f4ea1ae044752042f0e3b460a6f7b3fe6f5b252094f3076c:29:62 | 29 | collectionData.publicPath) ?? panic("Could not get receiver reference to the NFT Collection")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Was this error unhelpful? Consider suggesting an improvement here: https://github.com/onflow/cadence/issues.
Transaction Summary
Contract CallCalled MLS, NonFungibleToken, MetadataViews
Contracts
Script Arguments
Cadence Script
1import MLS from 0x4cf4c4ee474ac04b
2 import NonFungibleToken from 0x1d7e57aa55817448
3 import MetadataViews from 0x1d7e57aa55817448
4
5 transaction(link: String, batch: UInt32, sequence: UInt16, limit: UInt16, address: Address) {
6
7 /// Local variable for storing the minter reference
8 let minterRef: &MLS.NFTMinter
9
10 /// Reference to the receiver's collection
11 let recipientCollectionRef: &{NonFungibleToken.Receiver}
12
13 prepare(signer: auth(BorrowValue) &Account) {
14
15 // Resolve NFT collection data from the contract
16 let collectionData = MLS.resolveContractView(resourceType: nil, viewType: Type<MetadataViews.NFTCollectionData>()) as! MetadataViews.NFTCollectionData?
17 ?? panic("ViewResolver does not resolve NFTCollectionData view")
18
19 // Borrow a reference to the NFTMinter resource in storage
20 self.minterRef = signer.storage.borrow<&MLS.NFTMinter>(from: MLS.MinterStoragePath)
21 ?? panic("Could not borrow minter reference")
22
23 // Borrow the recipient's public NFT collection reference
24 let recipient = address
25
26 // Borrow the recipient's public NFT collection reference
27 var cap = (getAccount(recipient).capabilities.borrow<&AnyResource>(
28 collectionData.publicPath) ?? panic("Could not get receiver reference to the NFT Collection"))
29 self.recipientCollectionRef = cap as! &{NonFungibleToken.Receiver}
30 }
31
32 execute {
33
34 // Create a new NFT
35 let newNFT <- self.minterRef.mintNFT(glink: link, gbatch: batch, glimit: limit, gsequence: sequence)
36
37 // Deposit the NFT into the recipient's collection
38 self.recipientCollectionRef.deposit(token: <-newNFT)
39 log("NFT Minted and deposited to recipient's Collection")
40 }
41 }