TransactionSEALED
@▓◆$╲╲█$█●^○◆░╱%■●$*╱░▫▫%■%╱╳!◇▫╳▫○▫▫▫*□□@□$◇◇#╳&█#~^^╲▒%&■╱░~#╲
Transaction ID
Execution Fee
0.00166 FLOWScript Arguments
0idUInt64
191460
1nameString
Dean Langlois
2nationalities[String]
[ "CANADA" ]
3positions[String]
[ "CB", "RB" ]
4preferredFootString
RIGHT
5ageAtMintUInt32
17
6ageUInt32
20
7heightUInt32
180
8overallUInt32
45
9paceUInt32
24
10shootingUInt32
16
11passingUInt32
43
12dribblingUInt32
36
13defenseUInt32
42
14physicalUInt32
62
15goalkeepingUInt32
0
16potentialString
U2FsdGVkX1+LOaxZXwnoWtjZLNicaBGd/tfv48Sr4og=
17longevityString
U2FsdGVkX1/8M5dogiL2mJivHd/21kcSzY+ySOCaJ7I=
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}