TransactionSEALED

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

Transaction ID

Timestamp

Jun 21, 2025, 08:30:32 PM UTC
8mo ago

Block Height

117,174,722

Computation

0

Execution Fee

0.00001649 FLOW

Transaction Summary

Contract Call

Called MFLPlayer, MFLAdmin

Script Arguments

0idUInt64
47512
1nameString
Dragan Pušnik
2nationalities[String]
[
  "SLOVENIA"
]
3positions[String]
[
  "CB"
]
4preferredFootString
RIGHT
5ageAtMintUInt32
18
6ageUInt32
23
7heightUInt32
192
8overallUInt32
76
9paceUInt32
70
10shootingUInt32
38
11passingUInt32
49
12dribblingUInt32
55
13defenseUInt32
81
14physicalUInt32
77
15goalkeepingUInt32
0
16potentialString
U2FsdGVkX19UMvcBieyJ4mSzLLLbgSNXnAPrx8ui200=
17longevityString
U2FsdGVkX1/fmEN8trchezE1bJf0LkGWtp5iTbWxnYg=
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}