tx · HqbspicDkNotWLjfPktmfA9qKviod8xy8c1qeoKGh53o 3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD: -0.00500000 Waves 2022.08.02 14:16 [2166798] smart account 3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD > SELF 0.00000000 Waves
{ "type": 13, "id": "HqbspicDkNotWLjfPktmfA9qKviod8xy8c1qeoKGh53o", "fee": 500000, "feeAssetId": null, "timestamp": 1659439013813, "version": 2, "chainId": 84, "sender": "3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD", "senderPublicKey": "DuG16HmDLNnqp4eX1MeM1DX5DuWxFCARi1TAXvrekhGb", "proofs": [ "3VfRBi3BYeJdPGq6oUcbhsd8iCtoxEeepcFMrwFQYGEdFnHCLvkK3GEuweRu5YHxhpqQgMuPyToNXooYuhpsoxrA" ], "script": "base64:AAIFAAAAAAAAABQIAhIECgIBARIECgIECBIECgIICAAAABcAAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAthZG1pblB1YktleQEAAAAgqLWmf98toNE9vqPG9aON6EpqB9vXYJJsZXUlC8eDPgUAAAAADlBBWU1FTlRfQU1PVU5UAAAAAAAAD0JAAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAINEjAAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAAOAAAAAAdNQVhFQUNIAAAAAAA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AAECAAAAEGFsbCBzb2xkLiB0aGFueC4JAAACAAAAAQIAAAALd3JvbmcgY29sb3IJAAACAAAAAQIAAAAcZ2FtZSBpcyBub3QgYWN0aXZlIHJpZ2h0IG5vdwAAAADlJRE9", "height": 2166798, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6hBVYB2pvmpeH75aKWcEPPyYvKTb2oUkp1qYqL5GxKmT Next: 5dTRutLZtGeqSQGHR53tzMy7SRjAPsJ9WhAFuy6RJMMX Diff:
Old | New | Differences | |
---|---|---|---|
81 | 81 | func coordinates (veri,xy) = { | |
82 | 82 | let isOpen = valueOrElse(getBoolean(this, isOpenKey), true) | |
83 | 83 | let endBlock = (firstBlock + period) | |
84 | - | let activeElseValue = (((toString(firstBlock) + "_") + toString(endBlock)) + "_ | |
84 | + | let activeElseValue = ((((toString(firstBlock) + "_") + toString(endBlock)) + "_") + toString(ACTIVE_SESSION)) | |
85 | 85 | let activeBlock = valueOrElse(getString(this, activeBlockKey), activeElseValue) | |
86 | 86 | let splitBlock = split(activeBlock, "_") | |
87 | 87 | let start_height = valueOrErrorMessage(parseInt(splitBlock[0]), "int_str err") |
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'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | 7 | ||
8 | 8 | let adminPubKey = base58'CMa9TJH8JthRv8Uq8pZc4FSpgZ9bvpk6XRsZktUm2ivx' | |
9 | 9 | ||
10 | 10 | let PAYMENT_AMOUNT = 1000000 | |
11 | 11 | ||
12 | 12 | let pixels = REWARD_ASSET | |
13 | 13 | ||
14 | 14 | let xMIN = 0 | |
15 | 15 | ||
16 | 16 | let xMAX = 1201 | |
17 | 17 | ||
18 | 18 | let yMIN = 0 | |
19 | 19 | ||
20 | 20 | let yMAX = 601 | |
21 | 21 | ||
22 | 22 | let REWARD_AMOUNT = 100000000 | |
23 | 23 | ||
24 | 24 | let START_HEIGHT = 2150691 | |
25 | 25 | ||
26 | 26 | let END_HEIGHT = (START_HEIGHT + (1440 * 14)) | |
27 | 27 | ||
28 | 28 | let MAXEACH = 1000 | |
29 | 29 | ||
30 | 30 | let MAXIMUM = 2250000000000 | |
31 | 31 | ||
32 | 32 | let activeSessionKey = "activeSession" | |
33 | 33 | ||
34 | 34 | let activeBlockKey = "activeBlock" | |
35 | 35 | ||
36 | 36 | let isOpenKey = "isOpen" | |
37 | 37 | ||
38 | 38 | let shutDownReasonKey = "shutDownReason" | |
39 | 39 | ||
40 | 40 | let firstBlock = 2166753 | |
41 | 41 | ||
42 | 42 | let period = (1440 * 7) | |
43 | 43 | ||
44 | 44 | let ACTIVE_SESSION = 1 | |
45 | 45 | ||
46 | 46 | let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"] | |
47 | 47 | ||
48 | 48 | func isPaymentOk (i) = { | |
49 | 49 | let acceptableAssetId = PAYMENT_ASSET | |
50 | 50 | if ((size(i.payments) == 0)) | |
51 | 51 | then throw("Payment not attached") | |
52 | 52 | else { | |
53 | 53 | let p = i.payments[0] | |
54 | 54 | match p.assetId { | |
55 | 55 | case assetId: ByteVector => | |
56 | 56 | if ((assetId == acceptableAssetId)) | |
57 | 57 | then (p.amount == 1000000) | |
58 | 58 | else false | |
59 | 59 | case _ => | |
60 | 60 | throw("Wrong payment asset") | |
61 | 61 | } | |
62 | 62 | } | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(i) | |
67 | 67 | func activeSession (session,block) = if ((adminPubKey != i.callerPublicKey)) | |
68 | 68 | then throw("you can not") | |
69 | 69 | else [IntegerEntry(activeSessionKey, session), StringEntry(activeBlockKey, ((((toString(block) + "_") + toString((block + period))) + "_") + toString(session)))] | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func shutdown (req,reason) = if ((adminPubKey != i.callerPublicKey)) | |
75 | 75 | then throw("you can not") | |
76 | 76 | else [BooleanEntry(isOpenKey, req), StringEntry(shutDownReasonKey, reason)] | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func coordinates (veri,xy) = { | |
82 | 82 | let isOpen = valueOrElse(getBoolean(this, isOpenKey), true) | |
83 | 83 | let endBlock = (firstBlock + period) | |
84 | - | let activeElseValue = (((toString(firstBlock) + "_") + toString(endBlock)) + "_ | |
84 | + | let activeElseValue = ((((toString(firstBlock) + "_") + toString(endBlock)) + "_") + toString(ACTIVE_SESSION)) | |
85 | 85 | let activeBlock = valueOrElse(getString(this, activeBlockKey), activeElseValue) | |
86 | 86 | let splitBlock = split(activeBlock, "_") | |
87 | 87 | let start_height = valueOrErrorMessage(parseInt(splitBlock[0]), "int_str err") | |
88 | 88 | let end_height = valueOrErrorMessage(parseInt(splitBlock[1]), "int_str err") | |
89 | 89 | let session = valueOrErrorMessage(parseInt(splitBlock[2]), "int_str err") | |
90 | 90 | if (if (if ((height > start_height)) | |
91 | 91 | then (end_height > height) | |
92 | 92 | else false) | |
93 | 93 | then isOpen | |
94 | 94 | else false) | |
95 | 95 | then { | |
96 | 96 | let color = containsElement(colors, veri) | |
97 | 97 | if (color) | |
98 | 98 | then { | |
99 | 99 | let currentKey = toBase58String(i.caller.bytes) | |
100 | 100 | let splitter = split(xy, "_") | |
101 | 101 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
102 | 102 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
103 | 103 | if (if (((x % 8) != 0)) | |
104 | 104 | then true | |
105 | 105 | else ((y % 8) != 0)) | |
106 | 106 | then throw("not cool.") | |
107 | 107 | else { | |
108 | 108 | let xy_new = ((toString(x) + "_") + toString(y)) | |
109 | 109 | let wallet = (((((currentKey + "_") + xy_new) + "_c") + "_") + toString(session)) | |
110 | 110 | let count_key = ((currentKey + "_count") + toString(session)) | |
111 | 111 | let pixels_count_key = ("pixels_count" + toString(session)) | |
112 | 112 | let count = valueOrElse(getInteger(this, count_key), 0) | |
113 | 113 | let pixels_count = valueOrElse(getInteger(this, pixels_count_key), 0) | |
114 | 114 | if ((MAXIMUM >= pixels_count)) | |
115 | 115 | then if ((MAXEACH >= count)) | |
116 | 116 | then if (if (if (if ((x >= xMIN)) | |
117 | 117 | then (xMAX > x) | |
118 | 118 | else false) | |
119 | 119 | then (y >= yMIN) | |
120 | 120 | else false) | |
121 | 121 | then (yMAX > y) | |
122 | 122 | else false) | |
123 | 123 | then if (isPaymentOk(i)) | |
124 | 124 | then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
125 | 125 | else throw("wrong payment amount or asset") | |
126 | 126 | else throw("out of context") | |
127 | 127 | else throw((("max " + toString(MAXEACH)) + " pixels for each wallet!")) | |
128 | 128 | else throw("all sold. thanx.") | |
129 | 129 | } | |
130 | 130 | } | |
131 | 131 | else throw("wrong color") | |
132 | 132 | } | |
133 | 133 | else throw("game is not active right now") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 |
github/deemru/w8io/026f985 31.21 ms ◑