tx · 7J6HDs7Vp3q4zCY6Fhqo8iDqtyQfEKUu74b3yRr5tLDD 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o: -0.01000000 Waves 2022.04.29 14:22 [2029703] smart account 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o > SELF 0.00000000 Waves
{ "type": 13, "id": "7J6HDs7Vp3q4zCY6Fhqo8iDqtyQfEKUu74b3yRr5tLDD", "fee": 1000000, "feeAssetId": null, "timestamp": 1651231374355, "version": 2, "chainId": 84, "sender": "3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o", "senderPublicKey": "E3TwKTkJRoqHq8mpKDYP1GvftP8ECfnCUT5atXuMXq53", "proofs": [ "2JGZUrDb7ZZR6GM1jqdToRexhCCdN5rBSfsZwXPvJr9XusgTFLgQ5meywGVv1kbKqY9CtjZAABkkshenZMf9fcE2" ], "script": "base64:AAIFAAAAAAAAAAoIAhIECgIICBIAAAAADAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgLTcTgdMkN12f4W9209EPk+8sLPTdia1cSlbofMkBchsAAAAABnBpeGVscwUAAAAMUkVXQVJEX0FTU0VUAAAAAAR4TUlOAAAAAAAAAAAAAAAAAAR4TUFYAAAAAAAAAASxAAAAAAR5TUlOAAAAAAAAAAAAAAAAAAR5TUFYAAAAAAAAAAJZAAAAAA1SRVdBUkRfQU1PVU5UAAAAAAAF9eEAAAAAAAxTVEFSVF9IRUlHSFQAAAAAAAAe8fQAAAAACkVORF9IRUlHSFQJAABkAAAAAgUAAAAMU1RBUlRfSEVJR0hUCQAAaAAAAAIAAAAAAAAABaAAAAAAAAAAAB4AAAAABmNvbG9ycwkABEwAAAACAgAAAAMwMDAJAARMAAAAAgIAAAADZmZmCQAETAAAAAICAAAABjAwMDAwMAkABEwAAAACAgAAAAZmZmZmZmYJAARMAAAAAgIAAAAGR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AAAALaXNQYXltZW50T2sAAAABBQAAAAFpCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAABndhbGxldAUAAAAEdmVyaQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADVJFV0FSRF9BTU9VTlQFAAAABnBpeGVscwUAAAADbmlsCQAAAgAAAAECAAAAHVdyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0CQAAAgAAAAECAAAADm91dCBvZiBjb250ZXh0CQAAAgAAAAECAAAAC3dyb25nIGNvbG9yCQAAAgAAAAECAAAAHGdhbWUgaXMgbm90IGFjdGl2ZSByaWdodCBub3cAAAABaQEAAAAIc2h1dGRvd24AAAAACQAAAgAAAAECAAAABHRlc3QAAAAARz06vA==", "height": 2029703, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A8FLxY7xbtgRHVY26pCvB7R17CsCGiZntkjqAP9vXasd Next: 9Q6St1LAtYkkGCzKkUt2DWLEAKETMbz8qimZYWeoJRqb Diff:
Old | New | Differences | |
---|---|---|---|
50 | 50 | if (color) | |
51 | 51 | then { | |
52 | 52 | let currentKey = toBase58String(i.caller.bytes) | |
53 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
54 | 53 | let splitter = split(xy, "_") | |
55 | 54 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
56 | 55 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
56 | + | let diffX = (x % (xMAX - 1)) | |
57 | + | let diffY = (y % (yMAX - 1)) | |
58 | + | let coX = (x - diffX) | |
59 | + | let coY = (y - diffY) | |
60 | + | let xy_new = ((toString(coX) + "_") + toString(coY)) | |
61 | + | let wallet = (((currentKey + "_") + xy_new) + "_c") | |
57 | 62 | if (if (if (if ((x >= xMIN)) | |
58 | 63 | then (xMAX > x) | |
59 | 64 | else false) |
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 pixels = REWARD_ASSET | |
9 | 9 | ||
10 | 10 | let xMIN = 0 | |
11 | 11 | ||
12 | 12 | let xMAX = 1201 | |
13 | 13 | ||
14 | 14 | let yMIN = 0 | |
15 | 15 | ||
16 | 16 | let yMAX = 601 | |
17 | 17 | ||
18 | 18 | let REWARD_AMOUNT = 100000000 | |
19 | 19 | ||
20 | 20 | let START_HEIGHT = 2028020 | |
21 | 21 | ||
22 | 22 | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
23 | 23 | ||
24 | 24 | 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"] | |
25 | 25 | ||
26 | 26 | func isPaymentOk (i) = { | |
27 | 27 | let acceptableAssetId = PAYMENT_ASSET | |
28 | 28 | if ((size(i.payments) == 0)) | |
29 | 29 | then throw("Payment not attached") | |
30 | 30 | else { | |
31 | 31 | let p = i.payments[0] | |
32 | 32 | match p.assetId { | |
33 | 33 | case assetId: ByteVector => | |
34 | 34 | if ((assetId == acceptableAssetId)) | |
35 | 35 | then (p.amount == 1000000) | |
36 | 36 | else false | |
37 | 37 | case _ => | |
38 | 38 | throw("Wrong payment asset") | |
39 | 39 | } | |
40 | 40 | } | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(i) | |
45 | 45 | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
46 | 46 | then (END_HEIGHT > height) | |
47 | 47 | else false) | |
48 | 48 | then { | |
49 | 49 | let color = containsElement(colors, veri) | |
50 | 50 | if (color) | |
51 | 51 | then { | |
52 | 52 | let currentKey = toBase58String(i.caller.bytes) | |
53 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
54 | 53 | let splitter = split(xy, "_") | |
55 | 54 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
56 | 55 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
56 | + | let diffX = (x % (xMAX - 1)) | |
57 | + | let diffY = (y % (yMAX - 1)) | |
58 | + | let coX = (x - diffX) | |
59 | + | let coY = (y - diffY) | |
60 | + | let xy_new = ((toString(coX) + "_") + toString(coY)) | |
61 | + | let wallet = (((currentKey + "_") + xy_new) + "_c") | |
57 | 62 | if (if (if (if ((x >= xMIN)) | |
58 | 63 | then (xMAX > x) | |
59 | 64 | else false) | |
60 | 65 | then (y >= yMIN) | |
61 | 66 | else false) | |
62 | 67 | then (yMAX > y) | |
63 | 68 | else false) | |
64 | 69 | then { | |
65 | 70 | let isEmpty = getString(this, wallet) | |
66 | 71 | if (isPaymentOk(i)) | |
67 | 72 | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
68 | 73 | else throw("Wrong payment amount or asset") | |
69 | 74 | } | |
70 | 75 | else throw("out of context") | |
71 | 76 | } | |
72 | 77 | else throw("wrong color") | |
73 | 78 | } | |
74 | 79 | else throw("game is not active right now") | |
75 | 80 | ||
76 | 81 | ||
77 | 82 | ||
78 | 83 | @Callable(i) | |
79 | 84 | func shutdown () = throw("test") | |
80 | 85 | ||
81 | 86 |
github/deemru/w8io/026f985 23.33 ms ◑