MarketplaceSEALED

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

Transaction ID

Timestamp

Feb 26, 2026, 09:43:01 PM UTC
4h ago

Block Height

143,515,188

Computation

0

Transaction Summary

Marketplace

Called FungibleToken, NonFungibleToken, DapperUtilityCoin +2 more

Script Arguments

0saleItemIDUInt64
163556
1saleItemPriceUFix64
4.00000000
2royaltyPercentUFix64
0.05000000
3expiryUInt64
2087674949483

Cadence Script

1import FungibleToken from 0xf233dcee88fe0abe
2import NonFungibleToken from 0x1d7e57aa55817448
3import DapperUtilityCoin from 0xead892083b3e2c6c
4import MFLPack from 0x8ebcbfd516b1da27
5import NFTStorefrontV2 from 0x4eb8a10cb9f87357
6
7transaction(
8    saleItemID: UInt64,
9    saleItemPrice: UFix64,
10    royaltyPercent: UFix64,
11    expiry: UInt64,
12) {
13  	let sellerPaymentReceiver: Capability<&{FungibleToken.Receiver}>
14	let nftProviderCap: Capability<auth(NonFungibleToken.Withdraw) &MFLPack.Collection>
15	let storefront: auth(NFTStorefrontV2.CreateListing, NFTStorefrontV2.RemoveListing) &NFTStorefrontV2.Storefront
16	let dappAddress: Address
17
18    prepare(dapp: &Account, seller: auth(BorrowValue, CopyValue, LoadValue, SaveValue, IssueStorageCapabilityController, PublishCapability, GetStorageCapabilityController) &Account) {
19        self.dappAddress = dapp.address
20
21        // If the account doesn't already have a Storefront
22        // Create a new empty Storefront
23        if seller.storage.borrow<&NFTStorefrontV2.Storefront>(from: NFTStorefrontV2.StorefrontStoragePath) == nil {
24
25            // Create a new empty Storefront
26            let storefront <- NFTStorefrontV2.createStorefront() as! @NFTStorefrontV2.Storefront
27
28            // save it to the account
29            seller.storage.save(<-storefront, to: NFTStorefrontV2.StorefrontStoragePath)
30
31            // create a public capability for the Storefront
32            let storefrontPublicCap = seller.capabilities.storage.issue<&{NFTStorefrontV2.StorefrontPublic}>(
33                    NFTStorefrontV2.StorefrontStoragePath
34                )
35            seller.capabilities.publish(storefrontPublicCap, at: NFTStorefrontV2.StorefrontPublicPath)
36        }
37
38        // Get a reference to the receiver that will receive the fungible tokens if the sale executes.
39        self.sellerPaymentReceiver = seller.capabilities.get<&{FungibleToken.Receiver}>(/public/dapperUtilityCoinReceiver)
40        assert(self.sellerPaymentReceiver.check(), message: "Missing or mis-typed DapperUtilityCoin receiver")
41
42    	// Get a capability to access the user's NFT collection.
43		var nftProviderCap: Capability<auth(NonFungibleToken.Withdraw) &MFLPack.Collection>? = nil
44        let nftProviderControllers = seller.capabilities.storage.getControllers(forPath: MFLPack.CollectionStoragePath)
45        for controller in nftProviderControllers {
46            if let maybeProviderCap = controller.capability as? Capability<auth(NonFungibleToken.Withdraw) &MFLPack.Collection>? {
47                nftProviderCap = maybeProviderCap
48                break
49            }
50        }
51
52        // if there are no capabilities created for that storage path
53        // or if existing capability is no longer valid, issue a new one
54        if nftProviderCap == nil || nftProviderCap?.check() ?? false {
55            nftProviderCap = seller.capabilities.storage.issue<auth(NonFungibleToken.Withdraw) &MFLPack.Collection>(MFLPack.CollectionStoragePath)
56        }
57        assert(nftProviderCap?.check() ?? false, message: "Missing or mis-typed collection provider")
58		self.nftProviderCap = nftProviderCap!
59
60        self.storefront = seller.storage.borrow<auth(NFTStorefrontV2.CreateListing, NFTStorefrontV2.RemoveListing) &NFTStorefrontV2.Storefront>(
61                from: NFTStorefrontV2.StorefrontStoragePath
62            ) ?? panic("Could not get a Storefront from the signer's account at path (NFTStorefrontV2.StorefrontStoragePath)!"
63                        .concat("Make sure the signer has initialized their account with a NFTStorefrontV2 storefront!"))
64    }
65
66    // Make sure dapp is actually the dapp and not some random account
67    pre {
68        self.dappAddress == 0x15e71a9f7fe7d53d : "Requires valid authorizing signature"
69    }
70
71    execute {
72    	let nftType = Type<@MFLPack.NFT>()
73    	let salePaymentVaultType = Type<@DapperUtilityCoin.Vault>()
74
75        let amountSeller = saleItemPrice * (1.0 - royaltyPercent)
76        let saleCutSeller = NFTStorefrontV2.SaleCut(
77            receiver: self.sellerPaymentReceiver,
78            amount: amountSeller
79        )
80
81        // Get the royalty recipient's public account object
82        let royaltyRecipient = getAccount(0x15e71a9f7fe7d53d)
83        // Get a reference to the royalty recipient's Receiver
84        let royaltyReceiverRef = royaltyRecipient.capabilities.get<&{FungibleToken.Receiver}>(/public/dapperUtilityCoinReceiver)
85        assert(royaltyReceiverRef.borrow() != nil, message: "Missing or mis-typed DapperUtilityCoin royalty receiver")
86        let amountRoyalty = saleItemPrice - amountSeller
87        let saleCutRoyalty = NFTStorefrontV2.SaleCut(
88            receiver: royaltyReceiverRef,
89            amount: amountRoyalty
90        )
91
92  		// check for existing listings of the NFT
93        var existingListingIDs = self.storefront.getExistingListingIDs(
94            nftType: nftType,
95            nftID: saleItemID
96        )
97        // remove existing listings
98        for listingID in existingListingIDs {
99            self.storefront.removeListing(listingResourceID: listingID)
100        }
101
102        // Create listing
103        self.storefront.createListing(
104            nftProviderCapability: self.nftProviderCap,
105            nftType: nftType,
106            nftID: saleItemID,
107            salePaymentVaultType: salePaymentVaultType,
108            saleCuts: [saleCutSeller, saleCutRoyalty],
109            marketplacesCapability: nil,
110			customID: nil,
111			commissionAmount: 0.0,
112			expiry: expiry
113        )
114    }
115}