TransactionSEALED

□&@▫◇*&◆■▓▒○**@?~▪●▒●#■╱╳●@◆~█$○▫?%$▪╱■╳*■□●□!&□&*○□!■╱□▒╲▓^▒▫╳~

Transaction ID

Timestamp

Jul 13, 2025, 04:39:16 PM UTC
7mo ago

Block Height

119,527,292

Computation

0

Execution Fee

0.00003224 FLOW

Transaction Summary

Contract Call

Called NonFungibleToken, NFTCatalog, HybridCustody

Script Arguments

Copy:
0tokenIDUInt64
4333
2nftProviderAddressAddress
3nftProviderControllerIDUInt64
27
4collectionIdentifierString
Driverz

Cadence Script

1import NonFungibleToken from 0x1d7e57aa55817448
2import NFTCatalog from 0x49a7cda3a1eecc29
3
4import HybridCustody from 0xd8a7e05a7ac670c0
5
6/*
7Flowty - NFT Transfer - Catalog w/ TopShot special handling
8Transfer an NFT from the nftProvider (childAccount) to a specified recipient.
9 */
10
11transaction(tokenID: UInt64, to: Address, nftProviderAddress: Address, nftProviderControllerID: UInt64, collectionIdentifier: String) {
12  let nftProvider: auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}
13  prepare(signer: auth(Capabilities, Storage) &Account) {
14    let catalogEntry = NFTCatalog.getCatalogEntry(collectionIdentifier: collectionIdentifier) ?? panic("Provided collection is not in the NFT Catalog.")
15
16    if nftProviderAddress == signer.address {
17      self.nftProvider = signer.storage.borrow<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(from: catalogEntry.collectionData.storagePath)
18        ?? panic("could not find sender collection")
19    } else {
20      let manager = signer.storage.borrow<auth(HybridCustody.Manage) &HybridCustody.Manager>(from: HybridCustody.ManagerStoragePath)
21        ?? panic("manager does not exist")
22      let childAcct = manager.borrowAccount(addr: nftProviderAddress) ?? panic("nftProvider account not found")
23
24      let providerCap = childAcct.getCapability(controllerID: nftProviderControllerID, type: Type<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>()) ?? panic("no cap found")
25      let nftProviderCap = providerCap as! Capability<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>
26      self.nftProvider = nftProviderCap.borrow() ?? panic("unable to borrow child account collection provider")
27    }
28
29    let nft <- self.nftProvider.withdraw(withdrawID: tokenID)
30    let recipient = getAccount(to)
31
32    let standardCap = recipient.capabilities.get<&{NonFungibleToken.CollectionPublic}>(catalogEntry.collectionData.publicPath)
33    if standardCap.check() {
34      let r = standardCap.borrow() ?? panic("invalid receiver collection")
35      r.deposit(token: <-nft)
36      return
37    }
38    
39    // we should not reach here.
40    panic("no valid receiver found")
41  }
42}