tx · 4qnRHdcZffviYiMBbK3JiwXPtoQg1xLJZMskRp6m18mU 3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1: -0.01000000 Waves 2022.05.18 10:14 [2056782] smart account 3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1 > SELF 0.00000000 Waves
{ "type": 13, "id": "4qnRHdcZffviYiMBbK3JiwXPtoQg1xLJZMskRp6m18mU", "fee": 1000000, "feeAssetId": null, "timestamp": 1652858106720, "version": 2, "chainId": 84, "sender": "3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1", "senderPublicKey": "8rTCUHVm1p6iEchTjpJ1a7SbCaayaRrp4FegpAsirYag", "proofs": [ "5kyVq7WLwmE5Jkf4ZR2W7j2MtnmoP4m6eAmzhFjGYtHzULz2nPR2HWGSg96opJAKWwExiAzzZEVeiTikrn9Rberq" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAA4AAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAUUkVXQVJEX1BPT0xfRElWSVNJT04AAAAAAAAAAAQAAAAAElRPX1RIRV9SRVdBUkRfUE9PTAkAAGkAAAACBQAAAA1SRVdBUkRfQU1PVU5UBQAAABRSRVdBUkRfUE9PTF9ESVZJU0lPTgAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAHvH0AAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAA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F5bWVudCBhbW91bnQgb3IgYXNzZXQJAAACAAAAAQIAAAAOb3V0IG9mIGNvbnRleHQJAAACAAAAAQIAAAALd3JvbmcgY29sb3IJAAACAAAAAQIAAAAcZ2FtZSBpcyBub3QgYWN0aXZlIHJpZ2h0IG5vdwAAAADwRFRm", "height": 2056782, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gs88oAQvtkpTRnjQFsrF5GezNL7fh5CnoUVD5P4Nd81z Next: 4dj42gwoP8PmJ1skb67H6qwZ9PT4FNWyn7dUpNbkEGZ3 Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | - | ||
8 | - | let REWARD_POOL = Address(base58'3N4FJncKAHRAiEz6Thz2FLpVSDnRR3w15xV') | |
9 | 7 | ||
10 | 8 | let pixels = REWARD_ASSET | |
11 | 9 | ||
84 | 82 | let amount = valueOrElse(parseInt(splitRewardData[0]), 0) | |
85 | 83 | let lastRewardBlock = valueOrElse(parseInt(splitRewardData[1]), height) | |
86 | 84 | let newAmount = (amount + rewardAmount) | |
87 | - | [StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels) | |
85 | + | [StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
88 | 86 | } | |
89 | 87 | else throw("Wrong payment amount or asset") | |
90 | 88 | else throw("out of context") |
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 | - | ||
8 | - | let REWARD_POOL = Address(base58'3N4FJncKAHRAiEz6Thz2FLpVSDnRR3w15xV') | |
9 | 7 | ||
10 | 8 | let pixels = REWARD_ASSET | |
11 | 9 | ||
12 | 10 | let xMIN = 0 | |
13 | 11 | ||
14 | 12 | let xMAX = 1201 | |
15 | 13 | ||
16 | 14 | let yMIN = 0 | |
17 | 15 | ||
18 | 16 | let yMAX = 601 | |
19 | 17 | ||
20 | 18 | let REWARD_AMOUNT = 100000000 | |
21 | 19 | ||
22 | 20 | let REWARD_POOL_DIVISION = 4 | |
23 | 21 | ||
24 | 22 | let TO_THE_REWARD_POOL = (REWARD_AMOUNT / REWARD_POOL_DIVISION) | |
25 | 23 | ||
26 | 24 | let START_HEIGHT = 2028020 | |
27 | 25 | ||
28 | 26 | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
29 | 27 | ||
30 | 28 | 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"] | |
31 | 29 | ||
32 | 30 | func isPaymentOk (i) = { | |
33 | 31 | let acceptableAssetId = PAYMENT_ASSET | |
34 | 32 | if ((size(i.payments) == 0)) | |
35 | 33 | then throw("Payment not attached") | |
36 | 34 | else { | |
37 | 35 | let p = i.payments[0] | |
38 | 36 | match p.assetId { | |
39 | 37 | case assetId: ByteVector => | |
40 | 38 | if ((assetId == acceptableAssetId)) | |
41 | 39 | then (p.amount == 1000000) | |
42 | 40 | else false | |
43 | 41 | case _ => | |
44 | 42 | throw("Wrong payment asset") | |
45 | 43 | } | |
46 | 44 | } | |
47 | 45 | } | |
48 | 46 | ||
49 | 47 | ||
50 | 48 | @Callable(i) | |
51 | 49 | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
52 | 50 | then (END_HEIGHT > height) | |
53 | 51 | else false) | |
54 | 52 | then { | |
55 | 53 | let color = containsElement(colors, veri) | |
56 | 54 | if (color) | |
57 | 55 | then { | |
58 | 56 | let currentKey = toBase58String(i.caller.bytes) | |
59 | 57 | let splitter = split(xy, "_") | |
60 | 58 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
61 | 59 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
62 | 60 | if (if (((x % 8) != 0)) | |
63 | 61 | then ((y % 8) != 0) | |
64 | 62 | else false) | |
65 | 63 | then throw("not cool.") | |
66 | 64 | else { | |
67 | 65 | let xy_new = ((toString(x) + "_") + toString(y)) | |
68 | 66 | let wallet = (((currentKey + "_") + xy_new) + "_c") | |
69 | 67 | if (if (if (if ((x >= xMIN)) | |
70 | 68 | then (xMAX > x) | |
71 | 69 | else false) | |
72 | 70 | then (y >= yMIN) | |
73 | 71 | else false) | |
74 | 72 | then (yMAX > y) | |
75 | 73 | else false) | |
76 | 74 | then if (isPaymentOk(i)) | |
77 | 75 | then { | |
78 | 76 | let rewardKey = "reward_pool" | |
79 | 77 | let rewardAmount = TO_THE_REWARD_POOL | |
80 | 78 | let rewardHeight = height | |
81 | 79 | let rewardPoolIfEmpty = ("0_" + toString(height)) | |
82 | 80 | let rewardData = valueOrElse(getString(this, "reward_pool"), rewardPoolIfEmpty) | |
83 | 81 | let splitRewardData = split(rewardData, "_") | |
84 | 82 | let amount = valueOrElse(parseInt(splitRewardData[0]), 0) | |
85 | 83 | let lastRewardBlock = valueOrElse(parseInt(splitRewardData[1]), height) | |
86 | 84 | let newAmount = (amount + rewardAmount) | |
87 | - | [StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels) | |
85 | + | [StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
88 | 86 | } | |
89 | 87 | else throw("Wrong payment amount or asset") | |
90 | 88 | else throw("out of context") | |
91 | 89 | } | |
92 | 90 | } | |
93 | 91 | else throw("wrong color") | |
94 | 92 | } | |
95 | 93 | else throw("game is not active right now") | |
96 | 94 | ||
97 | 95 |
github/deemru/w8io/026f985 26.19 ms ◑