tx · FGdxHFk4Z6tLRuhEBSRi8Wmu7272Xi7Gen3WeMM1MUC

3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD:  -0.00500000 Waves

2022.08.02 14:10 [2166793] smart account 3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD > SELF 0.00000000 Waves

{ "type": 13, "id": "FGdxHFk4Z6tLRuhEBSRi8Wmu7272Xi7Gen3WeMM1MUC", "fee": 500000, "feeAssetId": null, "timestamp": 1659438662084, "version": 2, "chainId": 84, "sender": "3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD", "senderPublicKey": "DuG16HmDLNnqp4eX1MeM1DX5DuWxFCARi1TAXvrekhGb", "proofs": [ "4y9Yc1dX5GF88EnWHQLSJ4eWEaMaHZo5v4zsnMSVykNTxRLRjK6bJsYubewbjfCRMC9Y2byRUbStrCgkHjQwKLfv" ], "script": "base64:AAIFAAAAAAAAABQIAhIECgIBARIECgIECBIECgIICAAAABcAAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAthZG1pblB1YktleQEAAAAgqLWmf98toNE9vqPG9aON6EpqB9vXYJJsZXUlC8eDPgUAAAAADlBBWU1FTlRfQU1PVU5UAAAAAAAAD0JAAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAINEjAAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAAOAAAAAAd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lZ2VyRW50cnkAAAACBQAAAAljb3VudF9rZXkJAABkAAAAAgUAAAAFY291bnQAAAAAAAAAAAEJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAEHBpeGVsc19jb3VudF9rZXkJAABkAAAAAgUAAAAMcGl4ZWxzX2NvdW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAABndhbGxldAUAAAAEdmVyaQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADVJFV0FSRF9BTU9VTlQFAAAABnBpeGVscwUAAAADbmlsCQAAAgAAAAECAAAAHXdyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0CQAAAgAAAAECAAAADm91dCBvZiBjb250ZXh0CQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAAARtYXggCQABpAAAAAEFAAAAB01BWEVBQ0gCAAAAGCBwaXhlbHMgZm9yIGVhY2ggd2FsbGV0IQkAAAIAAAABAgAAABBhbGwgc29sZC4gdGhhbnguCQAAAgAAAAECAAAAC3dyb25nIGNvbG9yCQAAAgAAAAECAAAAHGdhbWUgaXMgbm90IGFjdGl2ZSByaWdodCBub3cAAAAAc1sUwA==", "height": 2166793, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 6hBVYB2pvmpeH75aKWcEPPyYvKTb2oUkp1qYqL5GxKmT Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
5+
6+let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS'
7+
8+let adminPubKey = base58'CMa9TJH8JthRv8Uq8pZc4FSpgZ9bvpk6XRsZktUm2ivx'
9+
10+let PAYMENT_AMOUNT = 1000000
11+
12+let pixels = REWARD_ASSET
13+
14+let xMIN = 0
15+
16+let xMAX = 1201
17+
18+let yMIN = 0
19+
20+let yMAX = 601
21+
22+let REWARD_AMOUNT = 100000000
23+
24+let START_HEIGHT = 2150691
25+
26+let END_HEIGHT = (START_HEIGHT + (1440 * 14))
27+
28+let MAXEACH = 1000
29+
30+let MAXIMUM = 2250000000000
31+
32+let activeSessionKey = "activeSession"
33+
34+let activeBlockKey = "activeBlock"
35+
36+let isOpenKey = "isOpen"
37+
38+let shutDownReasonKey = "shutDownReason"
39+
40+let firstBlock = 2166753
41+
42+let period = (1440 * 7)
43+
44+let ACTIVE_SESSION = 1
45+
46+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"]
47+
48+func isPaymentOk (i) = {
49+ let acceptableAssetId = PAYMENT_ASSET
50+ if ((size(i.payments) == 0))
51+ then throw("Payment not attached")
52+ else {
53+ let p = i.payments[0]
54+ match p.assetId {
55+ case assetId: ByteVector =>
56+ if ((assetId == acceptableAssetId))
57+ then (p.amount == 1000000)
58+ else false
59+ case _ =>
60+ throw("Wrong payment asset")
61+ }
62+ }
63+ }
64+
65+
66+@Callable(i)
67+func activeSession (session,block) = if ((adminPubKey != i.callerPublicKey))
68+ then throw("you can not")
69+ else [IntegerEntry(activeSessionKey, session), StringEntry(activeBlockKey, ((((toString(block) + "_") + toString((block + period))) + "_") + toString(session)))]
70+
71+
72+
73+@Callable(i)
74+func shutdown (req,reason) = if ((adminPubKey != i.callerPublicKey))
75+ then throw("you can not")
76+ else [BooleanEntry(isOpenKey, req), StringEntry(shutDownReasonKey, reason)]
77+
78+
79+
80+@Callable(i)
81+func coordinates (veri,xy) = {
82+ let isOpen = valueOrElse(getBoolean(this, isOpenKey), true)
83+ let endBlock = (firstBlock + period)
84+ let activeElseValue = (((toString(firstBlock) + "_") + toString(endBlock)) + "_0")
85+ let activeBlock = valueOrElse(getString(this, activeBlockKey), activeElseValue)
86+ if (if (if ((height > START_HEIGHT))
87+ then (END_HEIGHT > height)
88+ else false)
89+ then isOpen
90+ else false)
91+ then {
92+ let color = containsElement(colors, veri)
93+ let activeSession = valueOrElse(getInteger(this, activeSessionKey), ACTIVE_SESSION)
94+ if (color)
95+ then {
96+ let currentKey = toBase58String(i.caller.bytes)
97+ let splitter = split(xy, "_")
98+ let x = valueOrElse(parseInt(splitter[0]), 0)
99+ let y = valueOrElse(parseInt(splitter[1]), 0)
100+ if (if (((x % 8) != 0))
101+ then true
102+ else ((y % 8) != 0))
103+ then throw("not cool.")
104+ else {
105+ let xy_new = ((toString(x) + "_") + toString(y))
106+ let wallet = (((currentKey + "_") + xy_new) + "_c")
107+ let count_key = (currentKey + "_count")
108+ let pixels_count_key = "pixels_count"
109+ let count = valueOrElse(getInteger(this, count_key), 0)
110+ let pixels_count = valueOrElse(getInteger(this, pixels_count_key), 0)
111+ if ((MAXIMUM >= pixels_count))
112+ then if ((MAXEACH >= count))
113+ then if (if (if (if ((x >= xMIN))
114+ then (xMAX > x)
115+ else false)
116+ then (y >= yMIN)
117+ else false)
118+ then (yMAX > y)
119+ else false)
120+ then if (isPaymentOk(i))
121+ then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)]
122+ else throw("wrong payment amount or asset")
123+ else throw("out of context")
124+ else throw((("max " + toString(MAXEACH)) + " pixels for each wallet!"))
125+ else throw("all sold. thanx.")
126+ }
127+ }
128+ else throw("wrong color")
129+ }
130+ else throw("game is not active right now")
131+ }
132+
133+

github/deemru/w8io/026f985 
24.20 ms