tx · 4NvqBe7vFzRNwqz3w9Fwsc17AhS8bfdDutudKtaYHh8m 3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2: -0.00200000 Waves 2022.08.02 16:24 [2166922] smart account 3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2 > SELF 0.00000000 Waves
{ "type": 13, "id": "4NvqBe7vFzRNwqz3w9Fwsc17AhS8bfdDutudKtaYHh8m", "fee": 200000, "feeAssetId": null, "timestamp": 1659446702049, "version": 2, "chainId": 84, "sender": "3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2", "senderPublicKey": "3rvQsNbK5fc274oTJXxit5LUfVpNUHyPrKiaJZbmJ7zx", "proofs": [ "5XwonyYMKJPMqTK4uWiRrh3dBgKehDXuV57ngBewFWUQFoJq84vKCoLoh42FtwYUkSjzuPcSVKBt8bUFds2g6SUK" ], "script": "base64:BgIRCAISBgoECAgICBIDCgEIEgAOAAdrQ29tbW9uAgZjb21tb24ABWtSYXJlAgRyYXJlAAprTGVnZW5kYXJ5AglsZWdlbmRhcnkABmtQcmljZQIKcHJpY2VMZXZlcgAJc2VwYXJhdG9yAgF8AAdrQWN0aXZlAgZhY3RpdmUABmFjdGl2ZQkBEUBleHRyTmF0aXZlKDEwNTEpAgUEdGhpcwUHa0FjdGl2ZQAJY291bnRSYXJlCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFBWtSYXJlAAAAC2NvdW50Q29tbW9uCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFB2tDb21tb24AAAAOY291bnRMZWdlbmRhcnkJAGQCAAEJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUKa0xlZ2VuZGFyeQAAAQhpc0FjdGl2ZQADBQZhY3RpdmUFBHVuaXQJAAIBAg9TdG9yZSBpcyBhY3RpdmUBCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxC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VwYXJhdG9yCQCkAwEJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMFBnJhcml0eQUDbmlsAJcfXrg=", "height": 2166922, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4XQo9vUurvxsoaFXLMJE2bnnHDJCTf2J6Jago5N4M3wa Next: 4yKh41bfZY9LEjr5AyUphWkyfr6aBDLq9vStNrCcqp2g Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | else { | |
57 | 57 | let newToken = Issue(name, desc, 1, 0, false) | |
58 | 58 | let issueId = calculateAssetId(newToken) | |
59 | - | [newToken | |
59 | + | [newToken] | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kCommon = "common" | |
5 | 5 | ||
6 | 6 | let kRare = "rare" | |
7 | 7 | ||
8 | 8 | let kLegendary = "legendary" | |
9 | 9 | ||
10 | 10 | let kPrice = "priceLever" | |
11 | 11 | ||
12 | 12 | let separator = "|" | |
13 | 13 | ||
14 | 14 | let kActive = "active" | |
15 | 15 | ||
16 | 16 | let active = getBooleanValue(this, kActive) | |
17 | 17 | ||
18 | 18 | let countRare = (1 + valueOrElse(getInteger(this, kRare), 0)) | |
19 | 19 | ||
20 | 20 | let countCommon = (1 + valueOrElse(getInteger(this, kCommon), 0)) | |
21 | 21 | ||
22 | 22 | let countLegendary = (1 + valueOrElse(getInteger(this, kLegendary), 0)) | |
23 | 23 | ||
24 | 24 | func isActive () = if (active) | |
25 | 25 | then unit | |
26 | 26 | else throw("Store is active") | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func randomize (bytes,range) = { | |
30 | 30 | let hash = sha256(bytes) | |
31 | 31 | let index = toInt(hash) | |
32 | 32 | (index % range) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func extraCount (rare) = if ((rare == kCommon)) | |
37 | 37 | then IntegerEntry(kCommon, countCommon) | |
38 | 38 | else if ((rare == kRare)) | |
39 | 39 | then IntegerEntry(kRare, countCommon) | |
40 | 40 | else IntegerEntry(kLegendary, countLegendary) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func calculationRarity (transactionId) = { | |
44 | 44 | let tokenRare = randomize(transactionId, 100) | |
45 | 45 | if ((5 >= tokenRare)) | |
46 | 46 | then kLegendary | |
47 | 47 | else if ((tokenRare >= 80)) | |
48 | 48 | then kRare | |
49 | 49 | else kCommon | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func issueNft (name,desc,rarity,prefix) = if ((i.caller != this)) | |
55 | 55 | then throw("Only owner") | |
56 | 56 | else { | |
57 | 57 | let newToken = Issue(name, desc, 1, 0, false) | |
58 | 58 | let issueId = calculateAssetId(newToken) | |
59 | - | [newToken | |
59 | + | [newToken] | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(i) | |
65 | 65 | func setPrice (price) = if ((i.caller != this)) | |
66 | 66 | then throw("Only owner") | |
67 | 67 | else [StringEntry(kPrice, price)] | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | ||
71 | 71 | @Callable(i) | |
72 | 72 | func pullTheLever () = { | |
73 | 73 | let rarity = calculationRarity(i.transactionId) | |
74 | 74 | let structRare = extraCount(rarity) | |
75 | 75 | [structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(getIntegerValue(this, rarity))))))] | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 |
github/deemru/w8io/026f985 45.32 ms ◑