TransactionSEALED
▓○▒~&^◆▫▪□■▫^$@╱╳╱!!^#▪▓◇$$#◆@▪*^~!╱○~╳▪#!◇%▫╲#█╲*●□%!●●~^◇□$□&╲
Transaction ID
Execution Fee
0.0017 FLOWScript Arguments
0idUInt64
148973
1nameString
Lukas Ferenc
2nationalities[String]
[ "SLOVAKIA" ]
3positions[String]
[ "ST", "LW" ]
4preferredFootString
LEFT
5ageAtMintUInt32
21
6ageUInt32
25
7heightUInt32
190
8overallUInt32
53
9paceUInt32
65
10shootingUInt32
48
11passingUInt32
60
12dribblingUInt32
52
13defenseUInt32
35
14physicalUInt32
59
15goalkeepingUInt32
0
16potentialString
U2FsdGVkX1+Pq3tqJku284205MUPOe8L91i7/mZ+/9Q=
17longevityString
U2FsdGVkX192xOuEvxPQ8POIb+xcOp4AI1qoQ44XLgs=
18resistanceUInt32
0
19ownerAddrAddress
Cadence Script
1import MFLPlayer from 0x8ebcbfd516b1da27
2import MFLAdmin from 0x8ebcbfd516b1da27
3
4
5/**
6 This tx updates a player NFT metadata.
7**/
8
9transaction(
10 id: UInt64,
11 name: String,
12 nationalities: [String],
13 positions: [String],
14 preferredFoot: String,
15 ageAtMint: UInt32,
16 age: UInt32,
17 height: UInt32,
18 overall: UInt32,
19 pace: UInt32,
20 shooting: UInt32,
21 passing: UInt32,
22 dribbling: UInt32,
23 defense: UInt32,
24 physical: UInt32,
25 goalkeeping: UInt32,
26 potential: String,
27 longevity: String,
28 resistance: UInt32,
29 ownerAddr: Address
30) {
31 let adminProxyRef: auth(MFLAdmin.AdminProxyAction) &MFLAdmin.AdminProxy
32 let ownerCollectionRef: &MFLPlayer.Collection
33
34 prepare(acct: auth(BorrowValue) &Account) {
35 self.adminProxyRef = acct.storage.borrow<auth(MFLAdmin.AdminProxyAction) &MFLAdmin.AdminProxy>(from: MFLAdmin.AdminProxyStoragePath) ?? panic("Could not borrow admin proxy reference")
36 self.ownerCollectionRef = getAccount(ownerAddr).capabilities.borrow<&MFLPlayer.Collection>(
37 MFLPlayer.CollectionPublicPath
38 ) ?? panic("Could not get receiver reference to the NFT Collection")
39 }
40
41 execute {
42 let playerAdminClaimCap = self.adminProxyRef.getClaimCapability(name: "PlayerAdminClaim") ?? panic("PlayerAdminClaim capability not found")
43 let playerAdminClaimRef = playerAdminClaimCap.borrow<auth(MFLPlayer.PlayerAdminAction) &MFLPlayer.PlayerAdmin>() ?? panic("Could not borrow PlayerAdmin")
44
45 let metadata: {String: AnyStruct} = {}
46 metadata.insert(key: "name", name)
47 metadata.insert(key: "overall", overall)
48 metadata.insert(key: "nationalities", nationalities)
49 metadata.insert(key: "positions", positions)
50 metadata.insert(key: "preferredFoot", preferredFoot)
51 metadata.insert(key: "ageAtMint", ageAtMint)
52 metadata.insert(key: "age", age)
53 metadata.insert(key: "height", height)
54 metadata.insert(key: "pace", pace)
55 metadata.insert(key: "shooting", shooting)
56 metadata.insert(key: "passing", passing)
57 metadata.insert(key: "dribbling", dribbling)
58 metadata.insert(key: "defense", defense)
59 metadata.insert(key: "physical", physical)
60 metadata.insert(key: "goalkeeping", goalkeeping)
61 metadata.insert(key: "potential", potential)
62 metadata.insert(key: "longevity", longevity)
63 metadata.insert(key: "resistance", resistance)
64
65 playerAdminClaimRef.updatePlayerMetadata(
66 id: id,
67 metadata: metadata,
68 collectionRefOptional: self.ownerCollectionRef
69 )
70 }
71}