TransactionSEALED
▓●$◇▫╲&■%?░^█^~▒■~○░◇▫□■!*●$▓%╱▓○●~╳░◇▪□╳●$╲▒■@▪◆!^╱▪░○@╱○╲?▪▓&╲
Transaction ID
Script Arguments
Cadence Script
1import FastBreakV1 from 0x0b2a3299cc857e29
2
3transaction() {
4
5 let oracleRef: auth(FastBreakV1.Create, FastBreakV1.Update) &FastBreakV1.FastBreakDaemon
6
7 let fastBreakGameID: String
8 let points: UInt64
9 let win: Bool
10 let accountAddress: Address
11 let playerId: UInt64
12
13 prepare(acct: auth(Storage) &Account) {
14 self.fastBreakGameID = "778984e2-a902-42bd-a68d-29bf28bd0327"
15 self.points = 123
16 self.win = false
17 self.accountAddress = 0xec922737540f305e
18
19 let cap = acct.storage.copy<Capability<auth(FastBreakV1.Create, FastBreakV1.Update) &FastBreakV1.FastBreakDaemon>>(from: FastBreakV1.OracleStoragePath)
20 ?? panic("Could not borrow a reference to the oracle resource")
21 self.oracleRef = cap.borrow() ?? panic("Could not borrow a reference to the oracle resource")
22
23 self.playerId = FastBreakV1.getPlayerIdByAccount(accountAddress: self.accountAddress)
24 }
25
26 execute {
27
28 self.oracleRef.updateFastBreakScore(
29 fastBreakGameID: self.fastBreakGameID,
30 playerId: self.playerId,
31 points: self.points,
32 win: self.win
33 )
34 }
35
36}