tx · AqKTR1t4LkFBp4rpgixGbk4ZjCzWqs6Potb3eWEfmE1y 3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1: -0.01000000 Waves 2022.05.18 11:30 [2056860] smart account 3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1 > SELF 0.00000000 Waves
{ "type": 13, "id": "AqKTR1t4LkFBp4rpgixGbk4ZjCzWqs6Potb3eWEfmE1y", "fee": 1000000, "feeAssetId": null, "timestamp": 1652862685119, "version": 2, "chainId": 84, "sender": "3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1", "senderPublicKey": "8rTCUHVm1p6iEchTjpJ1a7SbCaayaRrp4FegpAsirYag", "proofs": [ "zBJf7QhQnCP2E9TyijyCp8p7R8cUcq5mSLxpTqWFpYFTaAzhjvghL8Kv4mtk5tveum3yhVuxnLGHPmkV5uF2rW5" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAA8AAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAABBTVEFLSU5HX0NPTlRSQUNUCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUjw3ifhq9EIoKzVKH33tj+QNuo3mChI2IAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAAAA9CQAAAAAAUUkVXQVJEX1BPT0xfRElWSVNJT04AAAAAAAAAAAQAAAAAElRPX1RIRV9SRVdBUkRfUE9PTAkAAGkAAAACBQAAAA1SRVdBUkRfQU1PVU5UBQAAABRSRVdBUkRfUE9PTF9ESVZJU0lPTgAAAAAM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EFZTUVOVF9BU1NFVAAAAAAAAAAAAAUAAAADbmlsAwkAAAAAAAACBQAAAANyZXMFAAAAA3JlcwQAAAAHJG1hdGNoMAUAAAADcmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1SRVdBUkRfQU1PVU5UBQAAAAZwaXhlbHMJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgUAAAAGd2FsbGV0BQAAAAR2ZXJpBQAAAANuaWwJAAACAAAAAQIAAAAXSW5jb3JyZWN0IGludm9rZSByZXN1bHQJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAHVdyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0CQAAAgAAAAECAAAADm91dCBvZiBjb250ZXh0CQAAAgAAAAECAAAAC3dyb25nIGNvbG9yCQAAAgAAAAECAAAAHGdhbWUgaXMgbm90IGFjdGl2ZSByaWdodCBub3cAAAAAz+uA1Q==", "height": 2056860, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C5uE7yvEZAgLQFPEvixbb9CAS3Z64sB8pbngZsVMhQhf Next: 7fiq4GCrg3WBmJYCu2jdpUn8aS4V3WxboegJRJbMdv1 Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | ||
18 | 18 | let yMAX = 601 | |
19 | 19 | ||
20 | - | let REWARD_AMOUNT = | |
20 | + | let REWARD_AMOUNT = 1000000 | |
21 | 21 | ||
22 | 22 | let REWARD_POOL_DIVISION = 4 | |
23 | 23 |
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 STAKING_CONTRACT = Address(base58'3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf') | |
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 | - | let REWARD_AMOUNT = | |
20 | + | let REWARD_AMOUNT = 1000000 | |
21 | 21 | ||
22 | 22 | let REWARD_POOL_DIVISION = 4 | |
23 | 23 | ||
24 | 24 | let TO_THE_REWARD_POOL = (REWARD_AMOUNT / REWARD_POOL_DIVISION) | |
25 | 25 | ||
26 | 26 | let START_HEIGHT = 2028020 | |
27 | 27 | ||
28 | 28 | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
29 | 29 | ||
30 | 30 | 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 | 31 | ||
32 | 32 | func isPaymentOk (i) = { | |
33 | 33 | let acceptableAssetId = PAYMENT_ASSET | |
34 | 34 | if ((size(i.payments) == 0)) | |
35 | 35 | then throw("Payment not attached") | |
36 | 36 | else { | |
37 | 37 | let p = i.payments[0] | |
38 | 38 | match p.assetId { | |
39 | 39 | case assetId: ByteVector => | |
40 | 40 | if ((assetId == acceptableAssetId)) | |
41 | 41 | then (p.amount == 1000000) | |
42 | 42 | else false | |
43 | 43 | case _ => | |
44 | 44 | throw("Wrong payment asset") | |
45 | 45 | } | |
46 | 46 | } | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
52 | 52 | then (END_HEIGHT > height) | |
53 | 53 | else false) | |
54 | 54 | then { | |
55 | 55 | let color = containsElement(colors, veri) | |
56 | 56 | if (color) | |
57 | 57 | then { | |
58 | 58 | let currentKey = toBase58String(i.caller.bytes) | |
59 | 59 | let splitter = split(xy, "_") | |
60 | 60 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
61 | 61 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
62 | 62 | if (if (((x % 8) != 0)) | |
63 | 63 | then ((y % 8) != 0) | |
64 | 64 | else false) | |
65 | 65 | then throw("not cool.") | |
66 | 66 | else { | |
67 | 67 | let xy_new = ((toString(x) + "_") + toString(y)) | |
68 | 68 | let wallet = (((currentKey + "_") + xy_new) + "_c") | |
69 | 69 | if (if (if (if ((x >= xMIN)) | |
70 | 70 | then (xMAX > x) | |
71 | 71 | else false) | |
72 | 72 | then (y >= yMIN) | |
73 | 73 | else false) | |
74 | 74 | then (yMAX > y) | |
75 | 75 | else false) | |
76 | 76 | then if (isPaymentOk(i)) | |
77 | 77 | then { | |
78 | 78 | let rewardKey = "reward_pool" | |
79 | 79 | let rewardAmount = TO_THE_REWARD_POOL | |
80 | 80 | let rewardHeight = height | |
81 | 81 | let rewardPoolIfEmpty = ("0_" + toString(height)) | |
82 | 82 | let rewardData = valueOrElse(getString(this, "reward_pool"), rewardPoolIfEmpty) | |
83 | 83 | let splitRewardData = split(rewardData, "_") | |
84 | 84 | let amount = valueOrElse(parseInt(splitRewardData[0]), 0) | |
85 | 85 | let lastRewardBlock = valueOrElse(parseInt(splitRewardData[1]), height) | |
86 | 86 | let newAmount = (amount + rewardAmount) | |
87 | 87 | let insert = ((toString(newAmount) + "_") + toString(height)) | |
88 | 88 | let res = invoke(STAKING_CONTRACT, "rewardPool", [insert], [AttachedPayment(PAYMENT_ASSET, 0)]) | |
89 | 89 | if ((res == res)) | |
90 | 90 | then match res { | |
91 | 91 | case r: Int => | |
92 | 92 | [ScriptTransfer(i.caller, REWARD_AMOUNT, pixels), StringEntry(wallet, veri)] | |
93 | 93 | case _ => | |
94 | 94 | throw("Incorrect invoke result") | |
95 | 95 | } | |
96 | 96 | else throw("Strict value is not equal to itself.") | |
97 | 97 | } | |
98 | 98 | else throw("Wrong payment amount or asset") | |
99 | 99 | else throw("out of context") | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 | else throw("wrong color") | |
103 | 103 | } | |
104 | 104 | else throw("game is not active right now") | |
105 | 105 | ||
106 | 106 |
github/deemru/w8io/026f985 30.45 ms ◑