tx · 747ELjUHo2newq1JdHQecMaE58dcbSGHkrvquk54BAUs 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o: -0.01000000 Waves 2022.04.27 16:19 [2026931] smart account 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o > SELF 0.00000000 Waves
{ "type": 13, "id": "747ELjUHo2newq1JdHQecMaE58dcbSGHkrvquk54BAUs", "fee": 1000000, "feeAssetId": null, "timestamp": 1651065580710, "version": 2, "chainId": 84, "sender": "3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o", "senderPublicKey": "E3TwKTkJRoqHq8mpKDYP1GvftP8ECfnCUT5atXuMXq53", "proofs": [ "4oVRSdM8eokSvDpNBmNGekdxFKq3pzeMXZEXCi2Fcw8gh7XX5VLqsUioiWpVxSritkiJ7CDg6fLgNx1qSn6PzMPR" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAEBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAB2Fzc2V0SWQFAAAAByRtYXRjaDADCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAAEWFjY2VwdGFibGVBc3NldElkCQAAAAAAAAIIBQAAAAFwAAAABmFtb3VudAAAAAAAAA9CQAcJAAACAAAAAQIAAAATV3JvbmcgcGF5bWVudCBhc3NldAAAAAEAAAABaQEAAAALY29vcmRpbmF0ZXMAAA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AAAAR4TUFYBQAAAAF4BwkAAGYAAAACBQAAAAF5BQAAAAR5TUlOBwkAAGYAAAACBQAAAAR5TUFYBQAAAAF5BwQAAAAHaXNFbXB0eQkABB0AAAACBQAAAAR0aGlzBQAAAAZ3YWxsZXQDCQEAAAALaXNQYXltZW50T2sAAAABBQAAAAFpCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAABndhbGxldAUAAAAEdmVyaQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAX14QAFAAAABnBpeGVscwUAAAADbmlsCQAAAgAAAAECAAAAHVdyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0CQAAAgAAAAECAAAADm91dCBvZiBjb250ZXh0CQAAAgAAAAECAAAAC3dyb25nIGNvbG9yAAAAAH8ymHk=", "height": 2026931, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GMWFgJ636VDaZ1ePJUvgVGdZPXBzS39oaSP5hzjsCU7G Next: Hsz9rLnjK8By2SdfnJwVhJgr9JcGugjMjU1DBQcvJ7py Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | @Callable(i) | |
23 | 23 | func coordinates (veri,xy) = { | |
24 | 24 | let pixels = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
25 | - | let currentKey = toBase58String(i.caller.bytes) | |
26 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
27 | - | let splitter = split(xy, "_") | |
28 | - | let x = valueOrElse(parseInt(splitter[0]), 0) | |
29 | - | let y = valueOrElse(parseInt(splitter[1]), 0) | |
30 | - | if (if (if (if ((x > 0)) | |
31 | - | then (1201 > x) | |
32 | - | else false) | |
33 | - | then (y > 0) | |
34 | - | else false) | |
35 | - | then (601 > y) | |
36 | - | else false) | |
25 | + | let xMIN = 0 | |
26 | + | let xMAX = 1201 | |
27 | + | let yMIN = 0 | |
28 | + | let yMAX = 601 | |
29 | + | let colors = ["000", "fff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B"] | |
30 | + | let color = containsElement(colors, veri) | |
31 | + | if (color) | |
37 | 32 | then { | |
38 | - | let isEmpty = getString(this, wallet) | |
39 | - | if (isPaymentOk(i)) | |
40 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, 100000000, pixels)] | |
41 | - | else throw("Wrong payment amount or asset") | |
33 | + | let currentKey = toBase58String(i.caller.bytes) | |
34 | + | let wallet = (((currentKey + "_") + xy) + "_c") | |
35 | + | let splitter = split(xy, "_") | |
36 | + | let x = valueOrElse(parseInt(splitter[0]), 0) | |
37 | + | let y = valueOrElse(parseInt(splitter[1]), 0) | |
38 | + | if (if (if (if ((x > xMIN)) | |
39 | + | then (xMAX > x) | |
40 | + | else false) | |
41 | + | then (y > yMIN) | |
42 | + | else false) | |
43 | + | then (yMAX > y) | |
44 | + | else false) | |
45 | + | then { | |
46 | + | let isEmpty = getString(this, wallet) | |
47 | + | if (isPaymentOk(i)) | |
48 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, 100000000, pixels)] | |
49 | + | else throw("Wrong payment amount or asset") | |
50 | + | } | |
51 | + | else throw("out of context") | |
42 | 52 | } | |
43 | - | else throw(" | |
53 | + | else throw("wrong color") | |
44 | 54 | } | |
45 | 55 | ||
46 | 56 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func isPaymentOk (i) = { | |
5 | 5 | let acceptableAssetId = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
6 | 6 | if ((size(i.payments) == 0)) | |
7 | 7 | then throw("Payment not attached") | |
8 | 8 | else { | |
9 | 9 | let p = i.payments[0] | |
10 | 10 | match p.assetId { | |
11 | 11 | case assetId: ByteVector => | |
12 | 12 | if ((assetId == acceptableAssetId)) | |
13 | 13 | then (p.amount == 1000000) | |
14 | 14 | else false | |
15 | 15 | case _ => | |
16 | 16 | throw("Wrong payment asset") | |
17 | 17 | } | |
18 | 18 | } | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func coordinates (veri,xy) = { | |
24 | 24 | let pixels = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
25 | - | let currentKey = toBase58String(i.caller.bytes) | |
26 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
27 | - | let splitter = split(xy, "_") | |
28 | - | let x = valueOrElse(parseInt(splitter[0]), 0) | |
29 | - | let y = valueOrElse(parseInt(splitter[1]), 0) | |
30 | - | if (if (if (if ((x > 0)) | |
31 | - | then (1201 > x) | |
32 | - | else false) | |
33 | - | then (y > 0) | |
34 | - | else false) | |
35 | - | then (601 > y) | |
36 | - | else false) | |
25 | + | let xMIN = 0 | |
26 | + | let xMAX = 1201 | |
27 | + | let yMIN = 0 | |
28 | + | let yMAX = 601 | |
29 | + | let colors = ["000", "fff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B"] | |
30 | + | let color = containsElement(colors, veri) | |
31 | + | if (color) | |
37 | 32 | then { | |
38 | - | let isEmpty = getString(this, wallet) | |
39 | - | if (isPaymentOk(i)) | |
40 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, 100000000, pixels)] | |
41 | - | else throw("Wrong payment amount or asset") | |
33 | + | let currentKey = toBase58String(i.caller.bytes) | |
34 | + | let wallet = (((currentKey + "_") + xy) + "_c") | |
35 | + | let splitter = split(xy, "_") | |
36 | + | let x = valueOrElse(parseInt(splitter[0]), 0) | |
37 | + | let y = valueOrElse(parseInt(splitter[1]), 0) | |
38 | + | if (if (if (if ((x > xMIN)) | |
39 | + | then (xMAX > x) | |
40 | + | else false) | |
41 | + | then (y > yMIN) | |
42 | + | else false) | |
43 | + | then (yMAX > y) | |
44 | + | else false) | |
45 | + | then { | |
46 | + | let isEmpty = getString(this, wallet) | |
47 | + | if (isPaymentOk(i)) | |
48 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, 100000000, pixels)] | |
49 | + | else throw("Wrong payment amount or asset") | |
50 | + | } | |
51 | + | else throw("out of context") | |
42 | 52 | } | |
43 | - | else throw(" | |
53 | + | else throw("wrong color") | |
44 | 54 | } | |
45 | 55 | ||
46 | 56 |
github/deemru/w8io/169f3d6 27.21 ms ◑