tx · 6hBVYB2pvmpeH75aKWcEPPyYvKTb2oUkp1qYqL5GxKmT

3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD:  -0.00500000 Waves

2022.08.02 14:16 [2166798] smart account 3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD > SELF 0.00000000 Waves

{ "type": 13, "id": "6hBVYB2pvmpeH75aKWcEPPyYvKTb2oUkp1qYqL5GxKmT", "fee": 500000, "feeAssetId": null, "timestamp": 1659438976835, "version": 2, "chainId": 84, "sender": "3MwSJhsm3YngKUPgEMsjBNuq5JaETsywtcD", "senderPublicKey": "DuG16HmDLNnqp4eX1MeM1DX5DuWxFCARi1TAXvrekhGb", "proofs": [ "2DuEDUCDGUGaAXdhQHWkhdFJs5XEKgL8yNBeeeofQGJmWSbrCjHCPdVpCZu6zXMqXhXnqRUCtZPiWcrkPLdwWjeU" ], "script": "base64:AAIFAAAAAAAAABQIAhIECgIBARIECgIECBIECgIICAAAABcAAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAthZG1pblB1YktleQEAAAAgqLWmf98toNE9vqPG9aON6EpqB9vXYJJsZXUlC8eDPgUAAAAADlBBWU1FTlRfQU1PVU5UAAAAAAAAD0JAAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAMU1RBUlRfSEVJR0hUAAAAAAAAINEjAAAAAApFTkRfSEVJR0hUCQAAZAAAAAIFAAAADFNUQVJUX0hFSUdIVAkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAAOAAAAAA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Bjb2xvcgkAAAIAAAABAgAAABxnYW1lIGlzIG5vdCBhY3RpdmUgcmlnaHQgbm93AAAAAAGaSiE=", "height": 2166798, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FGdxHFk4Z6tLRuhEBSRi8Wmu7272Xi7Gen3WeMM1MUC Next: HqbspicDkNotWLjfPktmfA9qKviod8xy8c1qeoKGh53o Diff:
OldNewDifferences
8383 let endBlock = (firstBlock + period)
8484 let activeElseValue = (((toString(firstBlock) + "_") + toString(endBlock)) + "_0")
8585 let activeBlock = valueOrElse(getString(this, activeBlockKey), activeElseValue)
86- if (if (if ((height > START_HEIGHT))
87- then (END_HEIGHT > height)
86+ let splitBlock = split(activeBlock, "_")
87+ let start_height = valueOrErrorMessage(parseInt(splitBlock[0]), "int_str err")
88+ let end_height = valueOrErrorMessage(parseInt(splitBlock[1]), "int_str err")
89+ let session = valueOrErrorMessage(parseInt(splitBlock[2]), "int_str err")
90+ if (if (if ((height > start_height))
91+ then (end_height > height)
8892 else false)
8993 then isOpen
9094 else false)
9195 then {
9296 let color = containsElement(colors, veri)
93- let activeSession = valueOrElse(getInteger(this, activeSessionKey), ACTIVE_SESSION)
9497 if (color)
9598 then {
9699 let currentKey = toBase58String(i.caller.bytes)
103106 then throw("not cool.")
104107 else {
105108 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 wallet = (((((currentKey + "_") + xy_new) + "_c") + "_") + toString(session))
110+ let count_key = ((currentKey + "_count") + toString(session))
111+ let pixels_count_key = ("pixels_count" + toString(session))
109112 let count = valueOrElse(getInteger(this, count_key), 0)
110113 let pixels_count = valueOrElse(getInteger(this, pixels_count_key), 0)
111114 if ((MAXIMUM >= pixels_count))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS'
77
88 let adminPubKey = base58'CMa9TJH8JthRv8Uq8pZc4FSpgZ9bvpk6XRsZktUm2ivx'
99
1010 let PAYMENT_AMOUNT = 1000000
1111
1212 let pixels = REWARD_ASSET
1313
1414 let xMIN = 0
1515
1616 let xMAX = 1201
1717
1818 let yMIN = 0
1919
2020 let yMAX = 601
2121
2222 let REWARD_AMOUNT = 100000000
2323
2424 let START_HEIGHT = 2150691
2525
2626 let END_HEIGHT = (START_HEIGHT + (1440 * 14))
2727
2828 let MAXEACH = 1000
2929
3030 let MAXIMUM = 2250000000000
3131
3232 let activeSessionKey = "activeSession"
3333
3434 let activeBlockKey = "activeBlock"
3535
3636 let isOpenKey = "isOpen"
3737
3838 let shutDownReasonKey = "shutDownReason"
3939
4040 let firstBlock = 2166753
4141
4242 let period = (1440 * 7)
4343
4444 let ACTIVE_SESSION = 1
4545
4646 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"]
4747
4848 func isPaymentOk (i) = {
4949 let acceptableAssetId = PAYMENT_ASSET
5050 if ((size(i.payments) == 0))
5151 then throw("Payment not attached")
5252 else {
5353 let p = i.payments[0]
5454 match p.assetId {
5555 case assetId: ByteVector =>
5656 if ((assetId == acceptableAssetId))
5757 then (p.amount == 1000000)
5858 else false
5959 case _ =>
6060 throw("Wrong payment asset")
6161 }
6262 }
6363 }
6464
6565
6666 @Callable(i)
6767 func activeSession (session,block) = if ((adminPubKey != i.callerPublicKey))
6868 then throw("you can not")
6969 else [IntegerEntry(activeSessionKey, session), StringEntry(activeBlockKey, ((((toString(block) + "_") + toString((block + period))) + "_") + toString(session)))]
7070
7171
7272
7373 @Callable(i)
7474 func shutdown (req,reason) = if ((adminPubKey != i.callerPublicKey))
7575 then throw("you can not")
7676 else [BooleanEntry(isOpenKey, req), StringEntry(shutDownReasonKey, reason)]
7777
7878
7979
8080 @Callable(i)
8181 func coordinates (veri,xy) = {
8282 let isOpen = valueOrElse(getBoolean(this, isOpenKey), true)
8383 let endBlock = (firstBlock + period)
8484 let activeElseValue = (((toString(firstBlock) + "_") + toString(endBlock)) + "_0")
8585 let activeBlock = valueOrElse(getString(this, activeBlockKey), activeElseValue)
86- if (if (if ((height > START_HEIGHT))
87- then (END_HEIGHT > height)
86+ let splitBlock = split(activeBlock, "_")
87+ let start_height = valueOrErrorMessage(parseInt(splitBlock[0]), "int_str err")
88+ let end_height = valueOrErrorMessage(parseInt(splitBlock[1]), "int_str err")
89+ let session = valueOrErrorMessage(parseInt(splitBlock[2]), "int_str err")
90+ if (if (if ((height > start_height))
91+ then (end_height > height)
8892 else false)
8993 then isOpen
9094 else false)
9195 then {
9296 let color = containsElement(colors, veri)
93- let activeSession = valueOrElse(getInteger(this, activeSessionKey), ACTIVE_SESSION)
9497 if (color)
9598 then {
9699 let currentKey = toBase58String(i.caller.bytes)
97100 let splitter = split(xy, "_")
98101 let x = valueOrElse(parseInt(splitter[0]), 0)
99102 let y = valueOrElse(parseInt(splitter[1]), 0)
100103 if (if (((x % 8) != 0))
101104 then true
102105 else ((y % 8) != 0))
103106 then throw("not cool.")
104107 else {
105108 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 wallet = (((((currentKey + "_") + xy_new) + "_c") + "_") + toString(session))
110+ let count_key = ((currentKey + "_count") + toString(session))
111+ let pixels_count_key = ("pixels_count" + toString(session))
109112 let count = valueOrElse(getInteger(this, count_key), 0)
110113 let pixels_count = valueOrElse(getInteger(this, pixels_count_key), 0)
111114 if ((MAXIMUM >= pixels_count))
112115 then if ((MAXEACH >= count))
113116 then if (if (if (if ((x >= xMIN))
114117 then (xMAX > x)
115118 else false)
116119 then (y >= yMIN)
117120 else false)
118121 then (yMAX > y)
119122 else false)
120123 then if (isPaymentOk(i))
121124 then [IntegerEntry(count_key, (count + 1)), IntegerEntry(pixels_count_key, (pixels_count + 1)), StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)]
122125 else throw("wrong payment amount or asset")
123126 else throw("out of context")
124127 else throw((("max " + toString(MAXEACH)) + " pixels for each wallet!"))
125128 else throw("all sold. thanx.")
126129 }
127130 }
128131 else throw("wrong color")
129132 }
130133 else throw("game is not active right now")
131134 }
132135
133136

github/deemru/w8io/026f985 
35.83 ms