tx · 7didCQbCL9i9yKggAwfEV1qWRJZWYahunAZCBnr7b6gm 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7: -0.01000000 Waves 2022.11.07 10:36 [2306430] smart account 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7 > SELF 0.00000000 Waves
{ "type": 13, "id": "7didCQbCL9i9yKggAwfEV1qWRJZWYahunAZCBnr7b6gm", "fee": 1000000, "feeAssetId": null, "timestamp": 1667806590723, "version": 2, "chainId": 84, "sender": "3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7", "senderPublicKey": "DTmTTp6Rb9XUrniBAnWwdNc39UfdmzmtFCBgey4hsnE", "proofs": [ "a51ikmKkjNyc7QpsMWRG3HRyqUPFGCytTPLZakcdNRgyK7Be47MocPnLmiVewfEpBv44yBY547XssnqrQL8dEvA" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgUKAwEBARIECgIICBIDCgEIAAAAEQAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgITlE6Sl8X8+K+DOSOPUkvq8L9vq51QOPRS3GqFK/+rkAAAAABmFkbVB1YgEAAAAgiT+jgODBttrU9dtTD5uAa0WPP/+tQueYJohnLaEIIAgAAAAABnBpeGVscwUAAAAMUkVXQVJEX0FTU0VUAAAAAAR4TUlOAAAAAAAAAAAAAAAAAAR4TUFYAAAAAAAAAASxAAAAAAR5TUlOAAAAAAAAAAAAAAAAAAR5TUFYAAAAAAAAAAJZAAAAAA1SRVdBUkRfQU1PVU5UAAAAAAAAD0JAAAAAAA5SRUlTU1VFX0FNT1VOVAAAAAAAABbjYAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAIw91AAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAAHAAAAAApwYX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AQIAAAAcZ2FtZSBpcyBub3QgYWN0aXZlIHJpZ2h0IG5vdwAAAAFpAQAAAAZkZWxldGUAAAABAAAAA2FyZwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAANhcmcFAAAAA25pbAAAAAAIUwhF", "height": 2306430, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EseyxLJCcSp9nLbkQbFLgWH4xqD8FBuBT83y5XH1rJh Next: Br4fhLmwPcsF1VLZ1W7Vf6oJpW5dn6efxJLkXvYtwPm Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | - | let REWARD_ASSET = base58' | |
6 | + | let REWARD_ASSET = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | 8 | let admPub = base58'AEm8wmKt8D73TvQifRvCfnZcCWy66TgmGtF2mX1xxKuq' | |
9 | 9 | ||
18 | 18 | let yMAX = 601 | |
19 | 19 | ||
20 | 20 | let REWARD_AMOUNT = 1000000 | |
21 | + | ||
22 | + | let REISSUE_AMOUNT = 1500000 | |
21 | 23 | ||
22 | 24 | let START_HEIGHT = 2297717 | |
23 | 25 | ||
100 | 102 | then (maxPixel >= veri_count) | |
101 | 103 | else false) | |
102 | 104 | then if (isPaymentOk(i)) | |
103 | - | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1))] | |
105 | + | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1)), Reissue(REWARD_ASSET, REISSUE_AMOUNT, true), ScriptTransfer(i.caller, REWARD_AMOUNT, REWARD_ASSET)] | |
104 | 106 | else throw("Wrong payment amount or asset") | |
105 | 107 | else throw("out of context") | |
106 | 108 | } |
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 | - | let REWARD_ASSET = base58' | |
6 | + | let REWARD_ASSET = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | 8 | let admPub = base58'AEm8wmKt8D73TvQifRvCfnZcCWy66TgmGtF2mX1xxKuq' | |
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 | 20 | let REWARD_AMOUNT = 1000000 | |
21 | + | ||
22 | + | let REISSUE_AMOUNT = 1500000 | |
21 | 23 | ||
22 | 24 | let START_HEIGHT = 2297717 | |
23 | 25 | ||
24 | 26 | let END_HEIGHT = (START_HEIGHT + (1440 * 7)) | |
25 | 27 | ||
26 | 28 | let paymentFee = 100000 | |
27 | 29 | ||
28 | 30 | let activeSessionKey = "active_session" | |
29 | 31 | ||
30 | 32 | let maxPixel = 22500 | |
31 | 33 | ||
32 | 34 | let colors = ["7076E9", "5FD8F1", "D30831", "183937", "FFD345", "B04249", "FFB087", "360A90", "000000", "969696", "FF0200", "800080", "020080", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "9F7E69", "FFEEE2", "983C95"] | |
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 == paymentFee) | |
44 | 46 | else false | |
45 | 47 | case _ => | |
46 | 48 | throw("Wrong payment asset") | |
47 | 49 | } | |
48 | 50 | } | |
49 | 51 | } | |
50 | 52 | ||
51 | 53 | ||
52 | 54 | @Callable(i) | |
53 | 55 | func activeSession (session) = if ((i.callerPublicKey == admPub)) | |
54 | 56 | then [IntegerEntry(activeSessionKey, session)] | |
55 | 57 | else throw("you are not allowed") | |
56 | 58 | ||
57 | 59 | ||
58 | 60 | ||
59 | 61 | @Callable(i) | |
60 | 62 | func settings (session,startHeight,duration) = if ((i.callerPublicKey == admPub)) | |
61 | 63 | then { | |
62 | 64 | let endHeight = (startHeight + (1440 * duration)) | |
63 | 65 | [IntegerEntry((("settings_" + toString(session)) + "_startHeight"), startHeight), IntegerEntry((("settings_" + toString(session)) + "_endHeight"), endHeight)] | |
64 | 66 | } | |
65 | 67 | else throw("you are not allowed") | |
66 | 68 | ||
67 | 69 | ||
68 | 70 | ||
69 | 71 | @Callable(i) | |
70 | 72 | func coordinates (veri,xy) = { | |
71 | 73 | let session = valueOrElse(getInteger(this, activeSessionKey), 0) | |
72 | 74 | let startHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_startHeight")), START_HEIGHT) | |
73 | 75 | let endHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_endHeight")), END_HEIGHT) | |
74 | 76 | if (if ((height > startHeight)) | |
75 | 77 | then (endHeight > height) | |
76 | 78 | else false) | |
77 | 79 | then { | |
78 | 80 | let color = containsElement(colors, veri) | |
79 | 81 | if (color) | |
80 | 82 | then { | |
81 | 83 | let currentKey = toBase58String(i.caller.bytes) | |
82 | 84 | let splitter = split(xy, "_") | |
83 | 85 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
84 | 86 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
85 | 87 | if (if (((x % 8) != 0)) | |
86 | 88 | then ((y % 8) != 0) | |
87 | 89 | else false) | |
88 | 90 | then throw("not cool.") | |
89 | 91 | else { | |
90 | 92 | let xy_new = ((toString(x) + "_") + toString(y)) | |
91 | 93 | let veri_count = valueOrElse(getInteger(this, ("stats_" + toString(session))), 0) | |
92 | 94 | let wallet = (((((currentKey + "_") + xy_new) + "_") + toString(session)) + "_c") | |
93 | 95 | if (if (if (if (if ((x >= xMIN)) | |
94 | 96 | then (xMAX > x) | |
95 | 97 | else false) | |
96 | 98 | then (y >= yMIN) | |
97 | 99 | else false) | |
98 | 100 | then (yMAX > y) | |
99 | 101 | else false) | |
100 | 102 | then (maxPixel >= veri_count) | |
101 | 103 | else false) | |
102 | 104 | then if (isPaymentOk(i)) | |
103 | - | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1))] | |
105 | + | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1)), Reissue(REWARD_ASSET, REISSUE_AMOUNT, true), ScriptTransfer(i.caller, REWARD_AMOUNT, REWARD_ASSET)] | |
104 | 106 | else throw("Wrong payment amount or asset") | |
105 | 107 | else throw("out of context") | |
106 | 108 | } | |
107 | 109 | } | |
108 | 110 | else throw("wrong color") | |
109 | 111 | } | |
110 | 112 | else throw("game is not active right now") | |
111 | 113 | } | |
112 | 114 | ||
113 | 115 | ||
114 | 116 | ||
115 | 117 | @Callable(i) | |
116 | 118 | func delete (arg) = [DeleteEntry(arg)] | |
117 | 119 | ||
118 | 120 |
github/deemru/w8io/026f985 54.56 ms ◑