tx · HSsEQsvThjfWCbMyPd74wr6yY4XGYvWRNv2v2URssNVC 3MqBZQSfaCVFG3HXjE7Jaeq6Z4ztMU2miPz: -0.00400000 Waves 2022.08.02 13:23 [2166746] smart account 3MqBZQSfaCVFG3HXjE7Jaeq6Z4ztMU2miPz > SELF 0.00000000 Waves
{ "type": 13, "id": "HSsEQsvThjfWCbMyPd74wr6yY4XGYvWRNv2v2URssNVC", "fee": 400000, "feeAssetId": null, "timestamp": 1659435834618, "version": 2, "chainId": 84, "sender": "3MqBZQSfaCVFG3HXjE7Jaeq6Z4ztMU2miPz", "senderPublicKey": "HfEpHsKBiv2JxCkN63ubUCnTfKx6PqsjC6pYWHMwHXYp", "proofs": [ "2DygPqmT7KoPPCsv24BTXJGKBFGifQ9aTNNSxJcUJNqyeSt7fX87jjfY86nQA17kkjb8YYEBBGngaZMDyzXFSFm" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEEEgQKAggIAAAAEQAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgLTcTgdMkN12f4W9209EPk+8sLPTdia1cSlbofMkBchsAAAAADlBBWU1FTlRfQU1PVU5UAAAAAAAAD0JAAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAINEjAAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAAOAAAAAAdNQVhFQUNIAAAAAAAAAAPoAAAAAAdNQVhJTVVNAAAAAgvec2QAAAAAAA5BQ1RJVkVfU0VT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5UBQAAAAZwaXhlbHMFAAAAA25pbAkAAAIAAAABAgAAAB13cm9uZyBwYXltZW50IGFtb3VudCBvciBhc3NldAkAAAIAAAABAgAAAA5vdXQgb2YgY29udGV4dAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAEbWF4IAkAAaQAAAABBQAAAAdNQVhFQUNIAgAAABggcGl4ZWxzIGZvciBlYWNoIHdhbGxldCEJAAACAAAAAQIAAAAPYWxsIHNvbGQuIHRoYW54CQAAAgAAAAECAAAAC3dyb25nIGNvbG9yCQAAAgAAAAECAAAAHGdhbWUgaXMgbm90IGFjdGl2ZSByaWdodCBub3cAAAAAV1XhuQ==", "height": 2166746, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3of6iNHtWsukBtDHy6pU5bBydRw1zWbDwfUVTS81bQYQ Next: HEQyjUJVPPFWRXLLX7MVE3pTRJXBveH5ff7eXcMpX9wR Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | - | ||
8 | - | let STAKING_ACCOUNT = Address(base58'3N4s3CsjSLPaiV5ZsMHNMbPN6YNxYePkD5h') | |
9 | 7 | ||
10 | 8 | let PAYMENT_AMOUNT = 1000000 | |
11 | 9 | ||
29 | 27 | ||
30 | 28 | let MAXIMUM = 2250000000000 | |
31 | 29 | ||
30 | + | let ACTIVE_SESSION = 1 | |
31 | + | ||
32 | + | let adminPubKey = base58'CMa9TJH8JthRv8Uq8pZc4FSpgZ9bvpk6XRsZktUm2ivx' | |
33 | + | ||
32 | 34 | 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"] | |
33 | 35 | ||
34 | 36 | func isPaymentOk (i) = { | |
47 | 49 | } | |
48 | 50 | } | |
49 | 51 | } | |
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func shutdown (req) = if ((adminPubKey != i.callerPublicKey)) | |
56 | + | then throw("you can not") | |
57 | + | else [BooleanEntry("isOpen", req)] | |
58 | + | ||
50 | 59 | ||
51 | 60 | ||
52 | 61 | @Callable(i) | |
82 | 91 | then (yMAX > y) | |
83 | 92 | else false) | |
84 | 93 | then if (isPaymentOk(i)) | |
85 | - | then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels) | |
86 | - | else throw(" | |
94 | + | then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
95 | + | else throw("wrong payment amount or asset") | |
87 | 96 | else throw("out of context") | |
88 | - | else throw("max | |
97 | + | else throw((("max " + toString(MAXEACH)) + " pixels for each wallet!")) | |
89 | 98 | else throw("all sold. thanx") | |
90 | 99 | } | |
91 | 100 | } |
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 STAKING_ACCOUNT = Address(base58'3N4s3CsjSLPaiV5ZsMHNMbPN6YNxYePkD5h') | |
9 | 7 | ||
10 | 8 | let PAYMENT_AMOUNT = 1000000 | |
11 | 9 | ||
12 | 10 | let pixels = REWARD_ASSET | |
13 | 11 | ||
14 | 12 | let xMIN = 0 | |
15 | 13 | ||
16 | 14 | let xMAX = 1201 | |
17 | 15 | ||
18 | 16 | let yMIN = 0 | |
19 | 17 | ||
20 | 18 | let yMAX = 601 | |
21 | 19 | ||
22 | 20 | let REWARD_AMOUNT = 100000000 | |
23 | 21 | ||
24 | 22 | let START_HEIGHT = 2150691 | |
25 | 23 | ||
26 | 24 | let END_HEIGHT = (START_HEIGHT + (1440 * 14)) | |
27 | 25 | ||
28 | 26 | let MAXEACH = 1000 | |
29 | 27 | ||
30 | 28 | let MAXIMUM = 2250000000000 | |
31 | 29 | ||
30 | + | let ACTIVE_SESSION = 1 | |
31 | + | ||
32 | + | let adminPubKey = base58'CMa9TJH8JthRv8Uq8pZc4FSpgZ9bvpk6XRsZktUm2ivx' | |
33 | + | ||
32 | 34 | 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"] | |
33 | 35 | ||
34 | 36 | func isPaymentOk (i) = { | |
35 | 37 | let acceptableAssetId = PAYMENT_ASSET | |
36 | 38 | if ((size(i.payments) == 0)) | |
37 | 39 | then throw("Payment not attached") | |
38 | 40 | else { | |
39 | 41 | let p = i.payments[0] | |
40 | 42 | match p.assetId { | |
41 | 43 | case assetId: ByteVector => | |
42 | 44 | if ((assetId == acceptableAssetId)) | |
43 | 45 | then (p.amount == 1000000) | |
44 | 46 | else false | |
45 | 47 | case _ => | |
46 | 48 | throw("Wrong payment asset") | |
47 | 49 | } | |
48 | 50 | } | |
49 | 51 | } | |
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func shutdown (req) = if ((adminPubKey != i.callerPublicKey)) | |
56 | + | then throw("you can not") | |
57 | + | else [BooleanEntry("isOpen", req)] | |
58 | + | ||
50 | 59 | ||
51 | 60 | ||
52 | 61 | @Callable(i) | |
53 | 62 | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
54 | 63 | then (END_HEIGHT > height) | |
55 | 64 | else false) | |
56 | 65 | then { | |
57 | 66 | let color = containsElement(colors, veri) | |
58 | 67 | if (color) | |
59 | 68 | then { | |
60 | 69 | let currentKey = toBase58String(i.caller.bytes) | |
61 | 70 | let splitter = split(xy, "_") | |
62 | 71 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
63 | 72 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
64 | 73 | if (if (((x % 8) != 0)) | |
65 | 74 | then true | |
66 | 75 | else ((y % 8) != 0)) | |
67 | 76 | then throw("not cool.") | |
68 | 77 | else { | |
69 | 78 | let xy_new = ((toString(x) + "_") + toString(y)) | |
70 | 79 | let wallet = (((currentKey + "_") + xy_new) + "_c") | |
71 | 80 | let count_key = (currentKey + "_count") | |
72 | 81 | let pixels_count_key = "pixels_count" | |
73 | 82 | let count = valueOrElse(getInteger(this, count_key), 0) | |
74 | 83 | let pixels_count = valueOrElse(getInteger(this, pixels_count_key), 0) | |
75 | 84 | if ((MAXIMUM >= pixels_count)) | |
76 | 85 | then if ((MAXEACH >= count)) | |
77 | 86 | then if (if (if (if ((x >= xMIN)) | |
78 | 87 | then (xMAX > x) | |
79 | 88 | else false) | |
80 | 89 | then (y >= yMIN) | |
81 | 90 | else false) | |
82 | 91 | then (yMAX > y) | |
83 | 92 | else false) | |
84 | 93 | then if (isPaymentOk(i)) | |
85 | - | then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels) | |
86 | - | else throw(" | |
94 | + | then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
95 | + | else throw("wrong payment amount or asset") | |
87 | 96 | else throw("out of context") | |
88 | - | else throw("max | |
97 | + | else throw((("max " + toString(MAXEACH)) + " pixels for each wallet!")) | |
89 | 98 | else throw("all sold. thanx") | |
90 | 99 | } | |
91 | 100 | } | |
92 | 101 | else throw("wrong color") | |
93 | 102 | } | |
94 | 103 | else throw("game is not active right now") | |
95 | 104 | ||
96 | 105 |
github/deemru/w8io/169f3d6 28.72 ms ◑