TransactionSEALED
%╲●░○^╳■■╱░?^▓!▫◆%%▫#▫@□%%╱■!●@**◆■~◇%*□?▓&▓#@▪●▪@^◆#░█▫╱◇○█&╲▓#
Transaction ID
Transaction Summary
Contract CallCalled NonFungibleToken, FastBreakV1
Contracts
Script Arguments
Cadence Script
1import NonFungibleToken from 0x1d7e57aa55817448
2import FastBreakV1 from 0x0b2a3299cc857e29
3
4transaction() {
5
6 let gameRef: auth(FastBreakV1.Play) &FastBreakV1.Player
7 let recipient: &{FastBreakV1.FastBreakNFTCollectionPublic}
8 let playerName: String
9 let fastBreakGameID: String
10 let topShotMomentIds: [UInt64]
11
12
13 prepare(acct: auth(Storage, Capabilities) &Account) {
14
15 self.playerName = "JoeyBriXxX"
16 self.fastBreakGameID = "0a750398-0993-4dab-b364-59e4791de655"
17 self.topShotMomentIds = [45170596,45170596,10516006,10516006,42171775,42171775,45274916,45274916,40528106,40528106]
18
19 if acct.storage.borrow<&FastBreakV1.Collection>(from: FastBreakV1.CollectionStoragePath) == nil {
20
21 let collection <- FastBreakV1.createEmptyCollection(nftType: Type<@FastBreakV1.NFT>())
22 acct.storage.save(<-collection, to: FastBreakV1.CollectionStoragePath)
23 acct.capabilities.publish(
24 acct.capabilities.storage.issue<&FastBreakV1.Collection>(FastBreakV1.CollectionStoragePath),
25 at: FastBreakV1.CollectionPublicPath
26 )
27
28 }
29
30 if acct.storage.borrow<auth(FastBreakV1.Play) &FastBreakV1.Player>(from: FastBreakV1.PlayerStoragePath) == nil {
31
32 let player <- FastBreakV1.createPlayer(playerName: self.playerName)
33 acct.storage.save(<-player, to: FastBreakV1.PlayerStoragePath)
34 }
35
36 self.gameRef = acct.storage.borrow<auth(FastBreakV1.Play) &FastBreakV1.Player>(from: FastBreakV1.PlayerStoragePath)
37 ?? panic("could not copy a reference to the accounts player")
38
39
40 self.recipient = acct.capabilities.borrow<&{FastBreakV1.FastBreakNFTCollectionPublic}>(FastBreakV1.CollectionPublicPath)
41 ?? panic("could not borrow a reference to the collection receiver")
42
43 }
44
45 execute {
46 let nft <- self.gameRef.play(
47 fastBreakGameID: self.fastBreakGameID,
48 topShots: self.topShotMomentIds
49 )
50 self.recipient.deposit(token: <- (nft as @{NonFungibleToken.NFT}))
51 }
52}