tx · Bgdm4soiajM5HHf7sZqpKUFXR55QeLV7zWJpuK7ETYif 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7: -0.01000000 Waves 2022.11.09 14:32 [2309535] smart account 3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7 > SELF 0.00000000 Waves
{ "type": 13, "id": "Bgdm4soiajM5HHf7sZqpKUFXR55QeLV7zWJpuK7ETYif", "fee": 1000000, "feeAssetId": null, "timestamp": 1667993583028, "version": 2, "chainId": 84, "sender": "3N1A95vbYuuE2ZFFUu6S1UubcE3eSpJNDE7", "senderPublicKey": "DTmTTp6Rb9XUrniBAnWwdNc39UfdmzmtFCBgey4hsnE", "proofs": [ "3r4gqvfkvF3mRkCxprpBipdg7nK2U89L4tMazM5DCgGRU7PGCq7fyF8rfX1gdHgfpJ7x7f1A8w1YRj8Yr2rhMmDS" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgUKAwEBARIDCgEEEgQKAggIAAAAEgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgITlE6Sl8X8+K+DOSOPUkvq8L9vq51QOPRS3GqFK/+rkAAAAABmFkbVB1YgEAAAAgAzE8E3rcXzF1OuMAzzMaXCnJteRr390CYXJiTeh4zHcAAAAABnBpeGVscwUAAAAMUkVXQVJEX0FTU0VUAAAAAAR4TUlOAAAAAAAAAAAAAAAAAAR4TUFYAAAAAAAAAASxAAAAAAR5TUlOAAAAAAAAAAAAAAAAAAR5TUFYAAAAAAAAAAJZAAAAAA1SRVdBUkRfQU1PVU5UAAAAAAAAD0JAAAAAAA5SRUlTU1VFX0FNT1VOVAAAAAAAABbjYAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAIw91AAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAA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nMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmuJqWw", "height": 2309535, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8QeHooFcy7B7BNrugtGPFYtUEDRyEYX7FHVKosezBvS3 Next: EcHDeiVYvS4beYT3u6AEbvK1c9CSbjPNBNT2My8SThCk Diff:
Old | New | Differences | |
---|---|---|---|
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | + | @Verifier(tx) | |
132 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
133 | + |
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'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | 8 | let admPub = base58'DTmTTp6Rb9XUrniBAnWwdNc39UfdmzmtFCBgey4hsnE' | |
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 | 21 | ||
22 | 22 | let REISSUE_AMOUNT = 1500000 | |
23 | 23 | ||
24 | 24 | let START_HEIGHT = 2297717 | |
25 | 25 | ||
26 | 26 | let END_HEIGHT = (START_HEIGHT + (1440 * 7)) | |
27 | 27 | ||
28 | 28 | let paymentFee = 100000 | |
29 | 29 | ||
30 | 30 | let activeSessionKey = "active_session" | |
31 | 31 | ||
32 | 32 | let maxPixel = 22500 | |
33 | 33 | ||
34 | 34 | let maxWallet = 1000 | |
35 | 35 | ||
36 | 36 | let colors = ["7076E9", "5FD8F1", "D30831", "183937", "FFD345", "B04249", "FFB087", "360A90", "000000", "969696", "FF0200", "800080", "020080", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "9F7E69", "FFEEE2", "983C95", "228F19", "F080C2", "F5DA19", "F56C19", "6CF519"] | |
37 | 37 | ||
38 | 38 | func isPaymentOk (i) = { | |
39 | 39 | let acceptableAssetId = PAYMENT_ASSET | |
40 | 40 | if ((size(i.payments) == 0)) | |
41 | 41 | then throw("Payment not attached") | |
42 | 42 | else { | |
43 | 43 | let p = i.payments[0] | |
44 | 44 | match p.assetId { | |
45 | 45 | case assetId: ByteVector => | |
46 | 46 | if ((assetId == acceptableAssetId)) | |
47 | 47 | then (p.amount == paymentFee) | |
48 | 48 | else false | |
49 | 49 | case _ => | |
50 | 50 | throw("Wrong payment asset") | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func activeSession (session) = if ((i.callerPublicKey == admPub)) | |
58 | 58 | then [IntegerEntry(activeSessionKey, session)] | |
59 | 59 | else throw("you are not allowed") | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func settings (session,startHeight,duration) = if ((i.callerPublicKey == admPub)) | |
65 | 65 | then { | |
66 | 66 | let endHeight = (startHeight + (1440 * duration)) | |
67 | 67 | [IntegerEntry((("settings_" + toString(session)) + "_startHeight"), startHeight), IntegerEntry((("settings_" + toString(session)) + "_endHeight"), endHeight)] | |
68 | 68 | } | |
69 | 69 | else throw("you are not allowed") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func shutdown (shutdown) = if ((i.callerPublicKey == admPub)) | |
75 | 75 | then [BooleanEntry("shutdown", shutdown)] | |
76 | 76 | else throw("you are not the chosen one") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func coordinates (veri,xy) = { | |
82 | 82 | let session = valueOrElse(getInteger(this, activeSessionKey), 0) | |
83 | 83 | let currentKey = toBase58String(i.caller.bytes) | |
84 | 84 | let startHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_startHeight")), START_HEIGHT) | |
85 | 85 | let endHeight = valueOrElse(getInteger(this, (("settings_" + toString(session)) + "_endHeight")), END_HEIGHT) | |
86 | 86 | let walletCount = valueOrElse(getInteger(this, ((("count_" + toString(session)) + "_") + currentKey)), 0) | |
87 | 87 | let shutdown = valueOrElse(getBoolean(this, "shutdown"), false) | |
88 | 88 | if (if (if ((height > startHeight)) | |
89 | 89 | then (endHeight > height) | |
90 | 90 | else false) | |
91 | 91 | then !(shutdown) | |
92 | 92 | else false) | |
93 | 93 | then { | |
94 | 94 | let color = containsElement(colors, veri) | |
95 | 95 | if (color) | |
96 | 96 | then { | |
97 | 97 | let splitter = split(xy, "_") | |
98 | 98 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
99 | 99 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
100 | 100 | if (if (((x % 8) != 0)) | |
101 | 101 | then ((y % 8) != 0) | |
102 | 102 | else false) | |
103 | 103 | then throw("not cool.") | |
104 | 104 | else { | |
105 | 105 | let xy_new = ((toString(x) + "_") + toString(y)) | |
106 | 106 | let veri_count = valueOrElse(getInteger(this, ("stats_" + toString(session))), 0) | |
107 | 107 | let wallet = (((((currentKey + "_") + xy_new) + "_") + toString(session)) + "_c") | |
108 | 108 | if (if (if (if (if (if ((x >= xMIN)) | |
109 | 109 | then (xMAX > x) | |
110 | 110 | else false) | |
111 | 111 | then (y >= yMIN) | |
112 | 112 | else false) | |
113 | 113 | then (yMAX > y) | |
114 | 114 | else false) | |
115 | 115 | then (maxPixel >= veri_count) | |
116 | 116 | else false) | |
117 | 117 | then (maxWallet >= walletCount) | |
118 | 118 | else false) | |
119 | 119 | then if (isPaymentOk(i)) | |
120 | 120 | then [StringEntry(wallet, veri), IntegerEntry(("stats_" + toString(session)), (veri_count + 1)), IntegerEntry(((("count_" + toString(session)) + "_") + currentKey), (walletCount + 1)), Reissue(REWARD_ASSET, REISSUE_AMOUNT, true), ScriptTransfer(i.caller, REWARD_AMOUNT, REWARD_ASSET)] | |
121 | 121 | else throw("Wrong payment amount or asset") | |
122 | 122 | else throw("out of context") | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | else throw("wrong color") | |
126 | 126 | } | |
127 | 127 | else throw("game is not active right now") | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | + | @Verifier(tx) | |
132 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
133 | + |
github/deemru/w8io/026f985 26.14 ms ◑