tx · H2m5cDoMv9HCDafSmPedST3RQ7U4e1WF9ZachcXzSZyo 3N1HdGqmcf4nVsUgmWiwB8p6p8ErWBmvQua: -0.01000000 Waves 2023.11.02 17:03 [2825812] smart account 3N1HdGqmcf4nVsUgmWiwB8p6p8ErWBmvQua > SELF 0.00000000 Waves
{ "type": 13, "id": "H2m5cDoMv9HCDafSmPedST3RQ7U4e1WF9ZachcXzSZyo", "fee": 1000000, "feeAssetId": null, "timestamp": 1698933813301, "version": 2, "chainId": 84, "sender": "3N1HdGqmcf4nVsUgmWiwB8p6p8ErWBmvQua", "senderPublicKey": "JAEVvs5E9kGyXWx3YQaivUpUP3vb3pgr2eS6UrYr1A8P", "proofs": [ "9gmqUqjU1Q8UN9TNpQp4CjXinHK7EPtRMh5KLPZBKrY3fumsozUhmtkgH9P5LFDfaYFGrGAdzwr1G5Ad7n5CgVX" ], "script": "base64:BgIXCAISAwoBAhIICgYICAEBAQESBAoCCAgJAANTRVACAl9fAQZuZnRLZXkBBW5mdElkCQC5CQIJAMwIAgIDbmZ0CQDMCAIJANgEAQUFbmZ0SWQFA25pbAUDU0VQARVuZnRUeXBlRGVzY3JpcHRpb25LZXkBCW5mdFR5cGVJZAkAuQkCCQDMCAICCG5mdF90eXBlCQDMCAIFCW5mdFR5cGVJZAUDbmlsBQNTRVABBnNldE5mdAQFbmZ0SWQJbmZ0VHlwZUlkBmhlYWx0aAZkYW1hZ2UJAQtTdHJpbmdFbnRyeQIJAQZuZnRLZXkBBQVuZnRJZAkAuQkCCQDMCAIFCW5mdFR5cGVJZAkAzAgCCQCkAwEFBmhlYWx0aAkAzAgCCQCkAwEFBmRhbWFnZQUDbmlsBQNTRVABFWdldE5mdFR5cGVEZXNjcmlwdGlvbgEJbmZ0VHlwZUlkBAtzYXZlZFN0cmluZwkAtQkCBAckbWF0Y2gwCQCdCAIFBHRoaXMJARVuZnRUeXBlRGVzY3JpcHRpb25LZXkBBQluZnRUeXBlSWQDCQABAgUHJG1hdGNoMAIGU3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wdFRyYW5zZmVyAwkBBXZhbHVlAQkApggBBQJ0bwABBQdhc3NldElkBQNuaWwJANgEAQUHYXNzZXRJZAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmIKW/w", "height": 2825812, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9JyGvi2cajgrAiCdvb3QXZUuLy6BFWFozeTSyjm4oswr Next: BJhTASPJVsB7HV1w1ZNDVLaKvs6JCjbpTEzNRhYki5ni Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | ||
57 | 57 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
58 | 58 | then $a | |
59 | - | else throw("List size exceeds | |
59 | + | else throw("List size exceeds 100") | |
60 | 60 | ||
61 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
61 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
62 | 62 | }) | |
63 | 63 | ||
64 | 64 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func nftKey (nftId) = makeString(["nft", toBase58String(nftId)], SEP) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func nftTypeDescriptionKey (nftTypeId) = makeString(["nft_type", nftTypeId], SEP) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func setNft (nftId,nftTypeId,health,damage) = StringEntry(nftKey(nftId), makeString([nftTypeId, toString(health), toString(damage)], SEP)) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getNftTypeDescription (nftTypeId) = { | |
16 | 16 | let savedString = split( match getString(this, nftTypeDescriptionKey(nftTypeId)) { | |
17 | 17 | case s: String => | |
18 | 18 | s | |
19 | 19 | case _ => | |
20 | 20 | throw("nft type not found") | |
21 | 21 | }, SEP) | |
22 | 22 | $Tuple5(savedString[0], parseIntValue(savedString[1]), parseIntValue(savedString[2]), parseIntValue(savedString[3]), parseIntValue(savedString[4])) | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func randomizer (inv,salt) = { | |
27 | 27 | let rand = (((((salt + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
28 | 28 | $Tuple2(sha256(rand), rand) | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func internalGetNft (address) = match getString(this, nftKey(address)) { | |
33 | 33 | case s: String => | |
34 | 34 | let splittedString = split(s, SEP) | |
35 | 35 | $Tuple3(splittedString[0], parseIntValue(splittedString[1]), parseIntValue(splittedString[2])) | |
36 | 36 | case _ => | |
37 | 37 | nil | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func map (accum,nextNftAddress) = match internalGetNft(nextNftAddress) { | |
42 | 42 | case s: (String, Int, Int) => | |
43 | 43 | s :: accum | |
44 | 44 | case _ => | |
45 | 45 | accum | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getNfts (address) = $Tuple2(nil, { | |
50 | 50 | let $l = address | |
51 | 51 | let $s = size($l) | |
52 | 52 | let $acc0 = nil | |
53 | 53 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
54 | 54 | then $a | |
55 | 55 | else map($a, $l[$i]) | |
56 | 56 | ||
57 | 57 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
58 | 58 | then $a | |
59 | - | else throw("List size exceeds | |
59 | + | else throw("List size exceeds 100") | |
60 | 60 | ||
61 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
61 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
62 | 62 | }) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(i) | |
66 | 66 | func getNft (address) = $Tuple2(nil, internalGetNft(address)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(i) | |
71 | 71 | func setNftTypeDescription (nftTypeId,img,minHealth,maxHealth,minDamage,maxDamage) = [StringEntry(nftTypeDescriptionKey(nftTypeId), makeString([img, toString(minHealth), toString(maxHealth), toString(minDamage), toString(maxDamage)], SEP))] | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func mint (nftTypeId,to) = { | |
77 | 77 | let typeDescription = getNftTypeDescription(nftTypeId) | |
78 | 78 | let healthT = randomizer(i, base58'') | |
79 | 79 | let damageT = randomizer(i, healthT._2) | |
80 | 80 | let health = if (((typeDescription._3 - typeDescription._2) == 0)) | |
81 | 81 | then typeDescription._3 | |
82 | 82 | else (typeDescription._3 + (toInt(healthT._1) % (typeDescription._3 - typeDescription._2))) | |
83 | 83 | let damage = if (((typeDescription._5 - typeDescription._4) == 0)) | |
84 | 84 | then typeDescription._5 | |
85 | 85 | else (typeDescription._4 + (toInt(damageT._1) % (typeDescription._5 - typeDescription._4))) | |
86 | 86 | let description = (((("{\"initHealth\": \"" + toString(health)) + "\", \"initDamage\": ") + toString(damage)) + "}") | |
87 | 87 | let asset = Issue(nftTypeId, description, 1, 0, false) | |
88 | 88 | let assetId = calculateAssetId(asset) | |
89 | 89 | $Tuple2([setNft(assetId, nftTypeId, health, damage), asset, ScriptTransfer(value(addressFromString(to)), 1, assetId)], toBase58String(assetId)) | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Verifier(tx) | |
94 | 94 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
95 | 95 |
github/deemru/w8io/026f985 43.07 ms ◑