Smart Contract
FindForgeStruct
A.097bafa4e0b48eef.FindForgeStruct
1import MetadataViews from 0x1d7e57aa55817448
2
3access(all) contract FindForgeStruct {
4
5 access(all) event ContractInitialized()
6
7 // for all traits in info :
8 /*
9 We stores needed data in maps, if max / scores are also needed, we create key-value pairs : key_max / key_score for storing that
10 if descriptions are added, we put that in description with prefix of the map variable, e.g. : scalar_key
11 */
12
13 access(all) struct FindDIM {
14 access(all) let name: String
15 access(all) let description: String
16 access(all) let thumbnailHash: String
17 access(all) let externalURL: String
18 access(all) let edition: UInt64
19 access(all) let maxEdition: UInt64
20 access(all) let descriptions: {String: String}
21 // stores number traits, max can be added
22 access(all) let scalars: {String: UFix64}
23 // stores boost traits, max can be added
24 access(all) let boosts: {String: UFix64}
25 // stores boost percentage traits
26 access(all) let boostPercents: {String: UFix64}
27 // stores level traits, max can be stored
28 access(all) let levels: {String: UFix64}
29 // stores string traits
30 access(all) let traits: {String: String}
31 // stores date traits
32 access(all) let dates: {String: UFix64}
33 access(all) let medias: {String: String}
34 access(all) let extras: {String: AnyStruct}
35
36 init(name: String, description: String, thumbnailHash: String, edition:UInt64, maxEdition:UInt64, externalURL:String, descriptions: {String: String}, scalars: {String: UFix64},boosts: {String: UFix64}, boostPercents: {String: UFix64}, levels: {String: UFix64}, traits: {String: String}, dates: {String: UFix64}, medias: {String: String}) {
37 self.name=name
38 self.description=description
39 self.thumbnailHash=thumbnailHash
40 self.edition=edition
41 self.maxEdition=maxEdition
42 self.traits = traits
43 self.levels=levels
44 self.scalars=scalars
45 self.dates=dates
46 self.externalURL=externalURL
47 self.medias=medias
48 self.descriptions=descriptions
49 self.boosts=boosts
50 self.boostPercents=boostPercents
51 self.extras={}
52 }
53 }
54
55
56 init() {
57 emit ContractInitialized()
58 }
59}
60
61