tx · JB2dPyxFbf7qq27aZ57vP21U9CiRKR1hTg3LUQHRqEKS 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7: -0.01000000 Waves 2022.11.07 10:49 [2306440] smart account 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7 > SELF 0.00000000 Waves
{ "type": 13, "id": "JB2dPyxFbf7qq27aZ57vP21U9CiRKR1hTg3LUQHRqEKS", "fee": 1000000, "feeAssetId": null, "timestamp": 1667807340121, "version": 2, "chainId": 84, "sender": "3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7", "senderPublicKey": "DTmTTp6Rb9XUrniBAnWwdNc39UfdmzmtFCBgey4hsnE", "proofs": [ "4nx3UECfmkntTMZFoDkKNoGjmcWeRDYif2hq3mqLMJ7xDgeG8RNTqV5shrrVrhqCYW2qdCBSXMQZ5kiuuuwBYQRW" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgUKAwEBARIECgIICBIDCgEIAAAAEgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgITlE6Sl8X8+K+DOSOPUkvq8L9vq51QOPRS3GqFK/+rkAAAAABmFkbVB1YgEAAAAgAzE8E3rcXzF1OuMAzzMaXCnJteRr390CYXJiTeh4zHcAAAAABnBpeGVscwUAAAAMUkVXQVJEX0FTU0VUAAAAAAR4TUlOAAAAAAAAAAAAAAAAAAR4TUFYAAAAAAAAAASxAAAAAAR5TUlOAAAAAAAAAAAAAAAAAAR5TUFYAAAAAAAAAAJZAAAAAA1SRVdBUkRfQU1PVU5UAAAAAAAAD0JAAAAAAA5SRUlTU1VFX0FNT1VOVAAAAAAAABbjYAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAIw91AAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAA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ACCQABLAAAAAICAAAABmNvdW50XwkAAaQAAAABBQAAAAdzZXNzaW9uAgAAAAFfBQAAAApjdXJyZW50S2V5CQAAZAAAAAIFAAAAC3dhbGxldENvdW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAAMUkVXQVJEX0FTU0VUBQAAAA5SRUlTU1VFX0FNT1VOVAYJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1SRVdBUkRfQU1PVU5UBQAAAAxSRVdBUkRfQVNTRVQFAAAAA25pbAkAAAIAAAABAgAAAB1Xcm9uZyBwYXltZW50IGFtb3VudCBvciBhc3NldAkAAAIAAAABAgAAAA5vdXQgb2YgY29udGV4dAkAAAIAAAABAgAAAAt3cm9uZyBjb2xvcgkAAAIAAAABAgAAABxnYW1lIGlzIG5vdCBhY3RpdmUgcmlnaHQgbm93AAAAAWkBAAAABmRlbGV0ZQAAAAEAAAADYXJnCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2FyZwUAAAADbmlsAAAAAI9SMwQ=", "height": 2306440, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HYBL2Nmumkix3Md7QDHHEijPUVEueWPr1yUVWEu97bWY Next: FmRZQiAMcGTTamFkZhTBhgwq2ixiMAnK62AApcmRa6QK Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let REWARD_ASSET = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | 8 | let admPub = base58'DTmTTp6Rb9XUrniBAnWwdNc39UfdmzmtFCBgey4hsnE' | |
9 | 9 | ||
10 | 10 | let pixels = REWARD_ASSET | |
11 | 11 | ||
12 | 12 | let xMIN = 0 | |
13 | 13 | ||
14 | 14 | let xMAX = 1201 | |
15 | 15 | ||
16 | 16 | let yMIN = 0 | |
17 | 17 | ||
18 | 18 | let yMAX = 601 | |
19 | 19 | ||
20 | 20 | let REWARD_AMOUNT = 1000000 | |
21 | 21 | ||
22 | 22 | let REISSUE_AMOUNT = 1500000 | |
23 | 23 | ||
24 | 24 | let START_HEIGHT = 2297717 | |
25 | 25 | ||
26 | 26 | let END_HEIGHT = (START_HEIGHT + (1440 * 7)) | |
27 | 27 | ||
28 | 28 | let paymentFee = 100000 | |
29 | 29 | ||
30 | 30 | let activeSessionKey = "active_session" | |
31 | 31 | ||
32 | 32 | let maxPixel = 22500 | |
33 | 33 | ||
34 | 34 | let maxWallet = 1000 | |
35 | 35 | ||
36 | 36 | let colors = ["7076E9", "5FD8F1", "D30831", "183937", "FFD345", "B04249", "FFB087", "360A90", "000000", "969696", "FF0200", "800080", "020080", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "9F7E69", "FFEEE2", "983C95"] | |
37 | 37 | ||
38 | 38 | func isPaymentOk (i) = { | |
39 | 39 | let acceptableAssetId = PAYMENT_ASSET | |
40 | 40 | if ((size(i.payments) == 0)) | |
41 | 41 | then throw("Payment not attached") | |
42 | 42 | else { | |
43 | 43 | let p = i.payments[0] | |
44 | 44 | match p.assetId { | |
45 | 45 | case assetId: ByteVector => | |
46 | 46 | if ((assetId == acceptableAssetId)) | |
47 | 47 | then (p.amount == paymentFee) | |
48 | 48 | else false | |
49 | 49 | case _ => | |
50 | 50 | throw("Wrong payment asset") | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func activeSession (session) = if ((i.callerPublicKey == admPub)) | |
58 | 58 | then [IntegerEntry(activeSessionKey, session)] | |
59 | 59 | else throw("you are not allowed") | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func settings (session,startHeight,duration) = if ((i.callerPublicKey == admPub)) | |
65 | 65 | then { | |
66 | 66 | let endHeight = (startHeight + (1440 * duration)) | |
67 | 67 | [IntegerEntry((("settings_" + toString(session)) + "_startHeight"), startHeight), IntegerEntry((("settings_" + toString(session)) + "_endHeight"), endHeight)] | |
68 | 68 | } | |
69 | 69 | else throw("you are not allowed") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func coordinates (veri,xy) = { | |
75 | 75 | let session = valueOrElse(getInteger(this, activeSessionKey), 0) | |
76 | 76 | let currentKey = toBase58String(i.caller.bytes) | |
77 | 77 | let startHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_startHeight")), START_HEIGHT) | |
78 | 78 | let endHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_endHeight")), END_HEIGHT) | |
79 | 79 | let walletCount = valueOrElse(getInteger(this, ((("count_" + toString(session)) + "_") + currentKey)), 0) | |
80 | 80 | if (if ((height > startHeight)) | |
81 | 81 | then (endHeight > height) | |
82 | 82 | else false) | |
83 | 83 | then { | |
84 | 84 | let color = containsElement(colors, veri) | |
85 | 85 | if (color) | |
86 | 86 | then { | |
87 | 87 | let splitter = split(xy, "_") | |
88 | 88 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
89 | 89 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
90 | 90 | if (if (((x % 8) != 0)) | |
91 | 91 | then ((y % 8) != 0) | |
92 | 92 | else false) | |
93 | 93 | then throw("not cool.") | |
94 | 94 | else { | |
95 | 95 | let xy_new = ((toString(x) + "_") + toString(y)) | |
96 | 96 | let veri_count = valueOrElse(getInteger(this, ("stats_" + toString(session))), 0) | |
97 | 97 | let wallet = (((((currentKey + "_") + xy_new) + "_") + toString(session)) + "_c") | |
98 | 98 | if (if (if (if (if (if ((x >= xMIN)) | |
99 | 99 | then (xMAX > x) | |
100 | 100 | else false) | |
101 | 101 | then (y >= yMIN) | |
102 | 102 | else false) | |
103 | 103 | then (yMAX > y) | |
104 | 104 | else false) | |
105 | 105 | then (maxPixel >= veri_count) | |
106 | 106 | else false) | |
107 | 107 | then (maxWallet >= walletCount) | |
108 | 108 | else false) | |
109 | 109 | then if (isPaymentOk(i)) | |
110 | 110 | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1)), IntegerEntry(((("count_" + toString(session)) + "_") + currentKey), (walletCount + 1)), Reissue(REWARD_ASSET, REISSUE_AMOUNT, true), ScriptTransfer(i.caller, REWARD_AMOUNT, REWARD_ASSET)] | |
111 | 111 | else throw("Wrong payment amount or asset") | |
112 | 112 | else throw("out of context") | |
113 | 113 | } | |
114 | 114 | } | |
115 | 115 | else throw("wrong color") | |
116 | 116 | } | |
117 | 117 | else throw("game is not active right now") | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | 122 | @Callable(i) | |
123 | 123 | func delete (arg) = [DeleteEntry(arg)] | |
124 | 124 | ||
125 | 125 |
github/deemru/w8io/026f985 37.74 ms ◑